public void UpdateLayersThisDrawing() { string configPath = string.Empty; var projectLocator = new LocateFileProject(); configPath = projectLocator.returnConfigFilePath(); if (string.IsNullOrEmpty(configPath)) { var res = System.Windows.Forms.MessageBox.Show("Drawing is not connected to a project. Do you want to create a new project?", "Drawing not connected to project", System.Windows.Forms.MessageBoxButtons.YesNo); if (res == System.Windows.Forms.DialogResult.Yes) { UpdateLayers(); } return; } var reader = new ConfigFileReader(); propertyList = reader.readConfigFile(configPath); Document document = Application.DocumentManager.MdiActiveDocument; ModifyOpenDrawing(document); document.Editor.WriteMessage("\nModified " + layersModified + " out of " + totalLayers + " layers\n"); }
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 OpenConfig() { var dialog = new System.Windows.Forms.OpenFileDialog() { DefaultExt = "Text files | *.txt" }; dialog.ShowDialog(); if (File.Exists(dialog.FileName)) { var reader = new ConfigFileReader(); LayerFilterList = reader.readConfigFile(dialog.FileName); configFilePath = dialog.FileName; } }
public void UpdateLayers() { using (var form = new Forms.UpdateLayerForm()) { form.ShowDialog(); if (string.IsNullOrEmpty(form.configPath)) { return; } var configFileReader = new ConfigFileReader(); propertyList = configFileReader.readConfigFile(form.configPath); drawingList = form.DrawingList; } ChangeLayersOnDrawings(propertyList, drawingList); }
public void AddXrefSpecialized() { Editor ed = Application.DocumentManager.MdiActiveDocument.Editor; PromptResult prConfigPath = ed.GetString("\nEnter path to config file: "); if (prConfigPath.Status != PromptStatus.OK) { ed.WriteMessage("No string was provided\n"); return; } var reader = new ConfigFileReader(); var propertyList = reader.readConfigFile(prConfigPath.StringResult); var AX = new AddXref(); var LU = new LayerUpdate(); var drawingList = AX.addXrefSpecialized(); if (drawingList != null) { LU.ChangeLayersOnDrawings(propertyList, drawingList); } }
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); } } }
public void ReloadConfig() { var reader = new ConfigFileReader(); LayerFilterList = reader.readConfigFile(configFilePath); }