Exemple #1
0
        public void openConfigTool()
        {
            var locateProjectFile = new LocateFileProject();

            configPath = locateProjectFile.returnConfigFilePath();

            var configTool = new LayerConfigEditor.MainWindow();

            configTool.MainViewModel.configFilePath = configPath;
            configTool.MainViewModel.ReloadConfig();
            configTool.ShowDialog();

            var configToolVM = configTool.MainViewModel;

            if (configToolVM.configSelected)
            {
                configPath = configToolVM.configFilePath;

                var writer = new WriteXml();
                writer.UpdateConfigPath(configPath);

                var configWriter = new ConfigFileWriter();

                configWriter.writeConfig(configPath, configToolVM.LayerFilterList);
            }
        }
 /// <summary>
 /// Puts the specified input.
 /// </summary>
 /// <param name="input">The input.</param>
 /// <returns></returns>
 public HttpResponseMessage Put(ServerDetailsModel input)
 {
     var configFileWriter = new ConfigFileWriter().UpdateConfigFile(input);
     return configFileWriter
         ? Request.CreateResponse(HttpStatusCode.Created, "Updated successfully")
         : Request.CreateErrorResponse(HttpStatusCode.NotModified, "Config file not modified");
 }
Exemple #3
0
        /// <summary>
        /// Puts the specified input.
        /// </summary>
        /// <param name="input">The input.</param>
        /// <returns></returns>
        public HttpResponseMessage Put(ServerDetailsModel input)
        {
            var configFileWriter = new ConfigFileWriter().UpdateConfigFile(input);

            return(configFileWriter
                ? Request.CreateResponse(HttpStatusCode.Created, "Updated successfully")
                : Request.CreateErrorResponse(HttpStatusCode.NotModified, "Config file not modified"));
        }
 public ExportWorkflow(
     IKongAdminReader kongReader,
     IOptions <Settings> configuration,
     ConfigFileWriter configWriter,
     ConfigBuilder configBuilder) : base(kongReader, configuration)
 {
     _configWriter  = configWriter;
     _configBuilder = configBuilder;
 }
 public void Should_Store()
 {
     var fileName = Guid.NewGuid().ToString();
     var data = "some data";
     IConfigWriter configWriter = new ConfigFileWriter(fileName);
     configWriter.Save(data);
     var fileData = File.ReadAllText(fileName);
     Assert.That(data, Is.EqualTo(fileData));
 }
Exemple #6
0
 public ExportWorkflow(
     IKongAdminReader kongReader,
     ExportWorkflowArguments arguments,
     ConfigFileWriter configWriter,
     ConfigBuilder configBuilder) : base(kongReader)
 {
     _arguments     = arguments;
     _configWriter  = configWriter;
     _configBuilder = configBuilder;
 }
Exemple #7
0
 /// <summary>
 /// Saves the file
 /// </summary>
 public void Flush()
 {
     if (NeedsFlush)
     {
         this.cleanUpVariables();
         ConfigFileWriter configWriter = new ConfigFileWriter(this);
         configWriter.writeConfigFile(FilePath);
         needsFlush = false;
     }
 }
Exemple #8
0
        private void SaveConfig()
        {
            if (string.IsNullOrEmpty(configFilePath))
            {
                SaveAsConfig();
            }

            var configWriter = new ConfigFileWriter();

            configWriter.writeConfig(configFilePath, LayerFilterList);
        }
        public void readConfigFile()
        {
            var configPath = @"C:\Users\frte\Documents\Projects\Config\MH2 layer plot teknisk.txt";

            var reader          = new ConfigFileReader();
            var LayerFilterList = reader.readConfigFile(configPath);

            var configWriter = new ConfigFileWriter();

            configWriter.writeConfig(configPath, LayerFilterList);
        }
        public void readWriteConfigFile()
        {
            var configPath = @"O:\A005000\A009727\BUSP 2\3.7 Tegninger\Kladd\FRTE\BUS2.txt";

            var reader          = new ConfigFileReader();
            var LayerFilterList = reader.readConfigFile(configPath);

            var configWriter = new ConfigFileWriter();

            configWriter.writeConfig(configPath, LayerFilterList);
        }
Exemple #11
0
        private void ObjectLayerToConfigFile(string layer)
        {
            if (!string.IsNullOrEmpty(layer))
            {
                var window = new MainWindow();
                window.MainViewModel.MapLayerStringToLayerFilter(layer);
                window.ShowDialog();

                if (window.MainViewModel.addLayerFilter)
                {
                    var projectFileLocator = new LocateFileProject();
                    var configFilePath     = projectFileLocator.returnConfigFilePath();

                    if (string.IsNullOrEmpty(configFilePath))
                    {
                        configFilePath = connectDrawingToConfigFile(configFilePath);
                        if (string.IsNullOrEmpty(configFilePath))
                        {
                            return;
                        }
                    }

                    var reader = new ConfigFileReader();
                    var writer = new ConfigFileWriter();

                    var layerFilterList = reader.readConfigFile(configFilePath);

                    foreach (var layerFilter in window.MainViewModel.NewLayerFilterList)
                    {
                        layerFilterList.Add(layerFilter);
                    }

                    writer.writeConfig(configFilePath, layerFilterList);
                }
            }
        }
 /// <summary>
 /// Saves the file
 /// </summary>
 public void Flush()
 {
     if (NeedsFlush) {
         this.cleanUpVariables();
         ConfigFileWriter configWriter = new ConfigFileWriter(this);
         configWriter.writeConfigFile(FilePath);
         needsFlush = false;
     }
 }