예제 #1
0
        /// <summary>
        /// Load the syntax filter information found in the Components and
        /// Plug-Ins folder and its subfolders.
        /// </summary>
        private static void LoadSyntaxFilters()
        {
            List <string>    allFiles = new List <string>();
            XPathDocument    configFile;
            XPathNavigator   navConfig;
            SyntaxFilterInfo info;
            string           id;

            SetPaths();

            syntaxFilters = new Dictionary <string, SyntaxFilterInfo>();

            if (Directory.Exists(buildComponentFolder))
            {
                allFiles.AddRange(Directory.GetFiles(buildComponentFolder,
                                                     "*.filters", SearchOption.AllDirectories));
            }

            // Add the standard syntax filter config file and any third-party
            // component config files in the installation folder too.  This
            // allows for XCOPY deployments of SHFB to build servers.
            allFiles.AddRange(Directory.GetFiles(shfbFolder, "*.filters",
                                                 SearchOption.AllDirectories));

            foreach (string file in allFiles)
            {
                configFile = new XPathDocument(file);
                navConfig  = configFile.CreateNavigator();

                foreach (XPathNavigator filter in navConfig.Select(
                             "syntaxFilters/filter"))
                {
                    info = new SyntaxFilterInfo(filter);

                    // The dictionary stores the keys in lowercase so as to
                    // match keys without regard to the case entered in the
                    // project property.
                    id = info.Id.ToLowerInvariant();

                    // Ignore components with duplicate IDs
                    if (!syntaxFilters.ContainsKey(id))
                    {
                        syntaxFilters.Add(id, info);
                    }
                }
            }
        }
        /// <summary>
        /// Load the syntax filter information found in the Components and
        /// Plug-Ins folder and its subfolders.
        /// </summary>
        private static void LoadSyntaxFilters()
        {
            List<string> allFiles = new List<string>();
            XPathDocument configFile;
            XPathNavigator navConfig;
            SyntaxFilterInfo info;
            string id;

            SetPaths();

            syntaxFilters = new Dictionary<string, SyntaxFilterInfo>();

            if(Directory.Exists(buildComponentFolder))
                allFiles.AddRange(Directory.GetFiles(buildComponentFolder,
                    "*.filters", SearchOption.AllDirectories));

            // Add the standard syntax filter config file and any third-party
            // component config files in the installation folder too.  This
            // allows for XCOPY deployments of SHFB to build servers.
            allFiles.AddRange(Directory.GetFiles(shfbFolder, "*.filters",
                SearchOption.AllDirectories));

            foreach(string file in allFiles)
            {
                configFile = new XPathDocument(file);
                navConfig = configFile.CreateNavigator();

                foreach(XPathNavigator filter in navConfig.Select(
                  "syntaxFilters/filter"))
                {
                    info = new SyntaxFilterInfo(filter);

                    // The dictionary stores the keys in lowercase so as to
                    // match keys without regard to the case entered in the
                    // project property.
                    id = info.Id.ToLowerInvariant();

                    // Ignore components with duplicate IDs
                    if(!syntaxFilters.ContainsKey(id))
                        syntaxFilters.Add(id, info);
                }
            }
        }