示例#1
0
 public static CampaignInfo GetCampaign(Assembly source)
 {
     foreach (var assembly in AddonSystem.GetAssemblies())
     {
         if (assembly.Key.Object == source)
         {
             return(GetCampaignByGuid(assembly.Value));
         }
     }
     return(null);
 }
示例#2
0
        public static List <Type> GetExportedTypesOfType(Type baseType)
        {
            List <Type> typeList = new List <Type>();

            List <Assembly> assemblies = new List <Assembly>();

            assemblies.AddRange(AddonSystem.GetAssemblies().Select((entry) => entry.Key.Object));
            assemblies.Add(Assembly.GetAssembly(typeof(Entry)));

            foreach (Assembly asm in assemblies)
            {
                foreach (Type type in asm.GetTypes())
                {
                    if (baseType?.IsAssignableFrom(type) == true && type != baseType)
                    {
                        typeList.Add(type);
                    }
                }
            }

            return(typeList);
        }