public EditorConfigConfiguration(string formatConfigFile)
        {
            var parser = new EditorConfig.Core.EditorConfigParser(formatConfigFile);
            FileConfiguration configFile = parser.Parse(formatConfigFile).First();

            if (configFile.Properties.ContainsKey("allowed_extensions"))
            {
                configFile.Properties.TryGetValue("allowed_extensions", out allowed);
            }

            if (configFile.Properties.ContainsKey("denied_extensions"))
            {
                configFile.Properties.TryGetValue("denied_extensions", out denied);
            }

            if (configFile.Properties.ContainsKey("command"))
            {
                configFile.Properties.TryGetValue("command", out command);
            }

            string enableInDebugAsString;

            if (configFile.Properties.ContainsKey("enable_in_debug"))
            {
                configFile.Properties.TryGetValue("enable_in_debug", out enableInDebugAsString);
                bool.TryParse(enableInDebugAsString, out enableInDebug);
            }
        }
Beispiel #2
0
        public EditorConfigWorkspace(FileInfo rootEditorConfigFile, string configFileName = ".editorconfig",
                                     Version developmentVersion = null)
        {
            _parser = new EditorConfigParser(configFileName, developmentVersion);

            var directory = rootEditorConfigFile.Directory;

            _editorconfigFiles =
                directory.EnumerateFiles(configFileName, SearchOption.AllDirectories)
                .Select(d => new EditorConfigFile(d.Name));
        }
Beispiel #3
0
        public EditorConfigConfiguration(string formatConfigFile)
        {
            var parser = new EditorConfig.Core.EditorConfigParser(formatConfigFile);
            FileConfiguration configFile = parser.Parse(formatConfigFile).First();

            if (configFile.Properties.ContainsKey("allowed_extensions"))
            {
                configFile.Properties.TryGetValue("allowed_extensions", out allowed);
            }

            if (configFile.Properties.ContainsKey("denied_extensions"))
            {
                configFile.Properties.TryGetValue("denied_extensions", out denied);
            }

            if (configFile.Properties.ContainsKey("command"))
            {
                configFile.Properties.TryGetValue("command", out command);
            }
        }