} // @formatter:on // -------------------------------------------------------- GetEnumerableOfType() // -- GetEnumerableOfType() ----------------------------------------------------- public static IEnumerable <T> GetEnumerableOfType <T>(params object[] constructorArgs) where T : class, IComparable <T> { var objects = new List <T>(); foreach (var type in Assembly.GetAssembly(typeof(T)).GetTypes().Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(T)))) { objects.Add((T)Activator.CreateInstance(type, constructorArgs)); } objects.Sort(); return(objects); }
static VRModuleManagerEditor() { s_symbolReqList = new List <SymbolRequirement>(); foreach (var type in Assembly.GetAssembly(typeof(SymbolRequirementCollection)).GetTypes().Where(t => t.IsClass && !t.IsAbstract && t.IsSubclassOf(typeof(SymbolRequirementCollection)))) { s_symbolReqList.AddRange((SymbolRequirementCollection)Activator.CreateInstance(type)); } s_symbolReqList.Add(new SymbolRequirement() { symbol = "VIU_PLUGIN", validateFunc = (req) => true, }); s_symbolReqList.Add(new SymbolRequirement() { symbol = "VIU_PACKAGE", validateFunc = (req) => VIUSettingsEditor.PackageManagerHelper.IsPackageInList(VIUSettings.VIU_PACKAGE_NAME), }); s_symbolReqList.Add(new SymbolRequirement() { symbol = "VIU_SIUMULATOR_SUPPORT", validateFunc = (req) => Vive.VIUSettingsEditor.supportSimulator, }); // Obsolete symbol, will be removed in all condition s_symbolReqList.Add(new SymbolRequirement() { symbol = "VIU_EXTERNAL_CAMERA_SWITCH", validateFunc = (req) => false, }); // Obsolete symbol, will be removed in all condition s_symbolReqList.Add(new SymbolRequirement() { symbol = "VIU_BINDING_INTERFACE_SWITCH", validateFunc = (req) => false, }); #if !UNITY_2017_1_OR_NEWER EditorUserBuildSettings.activeBuildTargetChanged += UpdateScriptingDefineSymbols; #endif }
public DataServiceProvider(ObjectContext Context, Assembly Assembly, string RepositoryTypeTemplate) { _context = Context; _assembly = Assembly ?? Assembly.GetAssembly(this.GetType()); _repositoryTypeTemplate = RepositoryTypeTemplate; }