[Core] Add proper method to check double loading

This commit is contained in:
LORDofDOOM 2018-03-22 03:53:52 +01:00
parent 5e060a160b
commit e52f1caeee

View file

@ -13,8 +13,6 @@ namespace TeleSharp.TL
private static Dictionary<int, Type> Types;
public static void Init()
{
try
{
Types = new Dictionary<int, Type>();
Types = (from t in Assembly.GetExecutingAssembly().GetTypes()
@ -22,11 +20,10 @@ namespace TeleSharp.TL
where t.IsSubclassOf(typeof(TLObject))
where t.GetCustomAttribute(typeof(TLObjectAttribute)) != null
select t).ToDictionary(x => ((TLObjectAttribute)x.GetCustomAttribute(typeof(TLObjectAttribute))).Constructor, x => x);
Types.Add(481674261, typeof(TLVector<>));
}
catch
{
if (!Types.ContainsKey(481674261))
{
Types.Add(481674261, typeof(TLVector<>));
}
}
public static Type getType(int Constructor)