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"); }
/// <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)); }
public ExportWorkflow( IKongAdminReader kongReader, ExportWorkflowArguments arguments, ConfigFileWriter configWriter, ConfigBuilder configBuilder) : base(kongReader) { _arguments = arguments; _configWriter = configWriter; _configBuilder = configBuilder; }
/// <summary> /// Saves the file /// </summary> public void Flush() { if (NeedsFlush) { this.cleanUpVariables(); ConfigFileWriter configWriter = new ConfigFileWriter(this); configWriter.writeConfigFile(FilePath); needsFlush = false; } }
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); }
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); } } }