コード例 #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);
            }
        }
コード例 #2
0
        private void SaveConfig()
        {
            if (string.IsNullOrEmpty(configFilePath))
            {
                SaveAsConfig();
            }

            var configWriter = new ConfigFileWriter();

            configWriter.writeConfig(configFilePath, LayerFilterList);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
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);
                }
            }
        }