/// <summary>Sets up the global lookup by searching for any classes which inherit from CssProperty.</summary> public static void Setup(Type[] allTypes) { if (Properties != null) { return; } Properties = new Dictionary <string, CssProperty>(); TextProperties = new Dictionary <string, CssProperty>(); // Load any existing CssProperties. // For each type.. for (int i = allTypes.Length - 1; i >= 0; i--) { Type type = allTypes[i]; if (type.IsGenericType) { continue; } if (TypeData.IsSubclassOf(type, typeof(CssProperty))) { // Got one! Add it now. Add((CssProperty)Activator.CreateInstance(type)); } } // Setup CSS functions (and units): CssFunctions.Setup(allTypes); }
public static void Setup() { if (Properties != null) { return; } Properties = new Dictionary <string, CssProperty>(); TextProperties = new Dictionary <string, CssProperty>(); // For each type.. foreach (TypeInfo type in Assemblies.Current.DefinedTypes) { if (type.IsGenericType) { continue; } if (type.IsSubclassOf(typeof(CssProperty))) { // Got one! Add it now. Add((CssProperty)Activator.CreateInstance(type.AsType())); } } // Setup CSS functions (and units): CssFunctions.Setup(); }