private void readConfiguration()
 {
     _isInitializing = true;
     var parser = new ConfigParser(_watchToken);
     _writer = new ConfigurationFormWriter(_isLocal, parser.Parse(), new MSBuildLocator());
     setWorkflowSettings();
     setIgnoreFileSettings();
     setTestIgnoreSettings();
     setNotifySettings();
     setVariousSettings();
     setMinimizerSettings();
     _originalMinimizer = _writer.Configuration.MinimizerLevel.Exists ? _writer.Configuration.MinimizerLevel.Item : null;
     _originalProfiler = _writer.Configuration.ProfilerSetup.Exists ? _writer.Configuration.ProfilerSetup.Item : null;
     _disableAllOriginalValue = checkBoxDisableAll.Checked;
     _anonFeedbackOriginalValue = checkBoxAnalytics.Checked;
     _isInitializing = false;
 }
        private void setLocalMooseMode()
        {
            if (_writer.Configuration.StartPaused.Exists && _writer.Configuration.StartPaused.Item)
            {
                setMooseModeControls(MooseMode.Manual);
                return;
            }
            if (_writer.Configuration.MSBuild.Where(x => x.Exists && x.ShouldExclude).Count() > 0)
            {
                setMooseModeControls(MooseMode.Auto);
                return;
            }
            if (_writer.Configuration.MSBuild.Where(x => x.Exists && File.Exists(x.Item.Path)).Count() > 0)
            {
                setMooseModeControls(MooseMode.Mighty);
                return;
            }

            var parser = new ConfigParser("");
            var globalConfig = parser.Parse();
            setGlobalMooseMode(globalConfig.MSBuild);
        }
        private void setLocalIgnoreFileSetting(string file)
        {
            var parser = new ConfigParser("");
            var globalConfig = parser.Parse();
            if (globalConfig.IgnoreFile.Exists && globalConfig.IgnoreFile.Item.File == file)
                _writer.SetIgnoreFilePath("");
            else
                _writer.SetIgnoreFilePath(file);

            if (_writer.Configuration.IgnoreFile.Exists && File.Exists(Path.Combine(_writer.Configuration.IgnoreFile.Item.ContentPath, file)))
                readPatterns(file);
        }
 private void setIgnoreFileSettings()
 {
     var parser = new ConfigParser("");
     var globalConfig = parser.Parse();
     if (_writer.Configuration.IgnoreFile.Exists)
         textBoxIgnoreFile.Text = _writer.Configuration.IgnoreFile.Item.File;
     else
     {
         if (globalConfig.IgnoreFile.Exists)
             textBoxIgnoreFile.Text = globalConfig.IgnoreFile.Item.File;
     }
     if (_isLocal)
     {
         var fileName = "";
         if (_writer.Configuration.IgnoreFile.Exists && _writer.Configuration.IgnoreFile.Item.File.Trim().Length > 0)
         {
             if (Path.IsPathRooted(_writer.Configuration.IgnoreFile.Item.File.Trim()))
                 fileName = _writer.Configuration.IgnoreFile.Item.File.Trim();
             else
                 fileName = Path.Combine(_writer.Configuration.IgnoreFile.Item.ContentPath, _writer.Configuration.IgnoreFile.Item.File.Trim());
         }
         else
         {
             if (globalConfig.IgnoreFile.Exists && globalConfig.IgnoreFile.Item.File.Trim().Length > 0)
             {
                 if (Path.IsPathRooted(globalConfig.IgnoreFile.Item.File.Trim()))
                     fileName = globalConfig.IgnoreFile.Item.File.Trim();
                 else
                     fileName = Path.Combine(_writer.Configuration.IgnoreFile.Item.ContentPath, globalConfig.IgnoreFile.Item.File.Trim());
                 _writer.Configuration.IgnoreFile.Item.File = globalConfig.IgnoreFile.Item.File.Trim();
             }
         }
         if (File.Exists(fileName))
             textBoxIgnoreFilePatterns.Text = File.ReadAllText(fileName);
     }
     textBoxIgnoreFilePatterns.Enabled = _isLocal;
 }