Exemple #1
0
        /// <summary>
        /// Adds all the type checkers to the given scanner.
        /// They basically automatically find CSS properties, units etc in assemblies.
        /// </summary>
        public static void AddToScanner(Modular.AssemblyScanner scanner)
        {
            // CSS functions:
            scanner.FindAllSubTypes(typeof(CssFunction), delegate(Type type){
                // Add it:
                CssFunctions.Add(type);
            });

            // CSS at rules:
            scanner.FindAllSubTypes(typeof(CssAtRule), delegate(Type type){
                // Add it:
                CssAtRules.Add(type);
            });

            // CSS units:
            scanner.FindAllSubTypes(typeof(CssUnit), delegate(Type type){
                // Add it:
                CssUnits.Add(type);
            });

            // CSS keywords:
            scanner.FindAllSubTypes(typeof(CssKeyword), delegate(Type type){
                // Add it:
                CssKeywords.Add(type);
            });

            // CSS properties (secondary pass; requires default values which can be any of the above):
            scanner.FindAllSubTypes(1, typeof(CssProperty), delegate(Type type){
                // Add it:
                CssProperties.Add(type);
            });
        }