示例#1
0
        public void AddSetting()
        {
            StringCollection scopes = new StringCollection();

            scopes.Add(Setting.Scopes.Base.ToString());
            scopes.Add(Setting.Scopes.DistributionSource.ToString());
            scopes.Add(Setting.Scopes.DistributionTarget.ToString());
            scopes.Add(Setting.Scopes.DistributionExe.ToString());
            foreach (var tab in Tabs)
            {
                scopes.Add(tab.TabName);
            }
            var dialog = new SettingCreationDialog()
            {
                Owner = Application.Current.MainWindow, Scopes = scopes
            };                                                                                                    // TODO #GUI access SettingsDialog

            if (dialog.ShowDialog() == true)
            {
                View.MainWindow mainWindow = (View.MainWindow)System.Windows.Application.Current.MainWindow;
                if (mainWindow != null)
                {
                    SettingsList.Add(new Setting()
                    {
                        Scope = dialog.Scope, Key = dialog.Key, Value = dialog.Value
                    });
                }
            }
        }
示例#2
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     View.MainWindow wnd = new View.MainWindow();
     wnd.Show();
 }