Beispiel #1
0
        private void ConfigurationCreatedHandler(string configurationName)
        {
            var config = Configuration.Load();

            var newConfig = config[configurationName];

            ProfileConfigsInternal.Add(new ProfileConfigViewModel(newConfig));

            OnPropertyChanged("ProfileConfigs");
        }
Beispiel #2
0
        private void ReloadConfigs()
        {
            ProfileConfigsInternal.Clear();

            var configuration = Configuration.Load();

            foreach (var config in configuration.ProfileConfigurations.Select(x => new ProfileConfigViewModel(x)))
            {
                ProfileConfigsInternal.Add(config);
            }

            OnPropertyChanged("ProfileConfigs");
        }
Beispiel #3
0
        public void DeleteConfiguration(object parameter)
        {
            var config = (ProfileConfigViewModel)parameter;


            if (MessageBox.Show("Are you sure you want to delete this configuration?", "Confirm Delete", MessageBoxButton.OKCancel, MessageBoxImage.Warning) == MessageBoxResult.OK)
            {
                ConfigurationManager.DeleteProfileConfiguration(config.Name);

                ProfileConfigsInternal.Remove(config);

                _events.GetEvent <ConfigurationDeletedEvent>().Publish(config.Name);

                OnPropertyChanged("ProfileConfigs");
            }
        }