예제 #1
0
        private void DuplicateConfClick()
        {
            var temp   = new ConfigurationOptions();
            var random = new Random();

            temp.LoadConfiguration(this.hostApp.DisplayMngr.CurrentConfiguration, this.hostApp.DisplayMngr.Dictionarys);
            temp.FileLocation = "";
            temp.Name        += "-Duplicate" + random.Next(0, 100).ToString(CultureInfo.InvariantCulture);
            Configuration temp2 = temp.SaveConfiguration(this.hostApp.DisplayMngr.Dictionarys);

            this.hostApp.DisplayMngr.Configurations.Add(temp2);
            this.hostApp.DisplayMngr.CurrentConfiguration  = temp2;
            this.hostApp.CurrentConfigurationLabel.Content = temp2.Name;
            this.hostApp.TrySetComPort(temp2.SerialPortSettings.PreferredComPort);
            ReloadConfList();
        }