ArchiverMain(Project prj) { _project = prj; channelSettings = new RulesSettings(_project); databaseSettings = new DatabaseSettings(_project); databaseSettings.Load(); channelSettings.Load(); Accessor = new ArchiverAccessor(this); Accessor.Open(); SubscribeEvents(); if (Env.Current.Mode == EnvironmentMode.Designer) { ICommandContext context = Env.Current.Commands.GetContext(PredefinedContexts.Project); context.AddCommand(new PropertyCommand()); } }
void LoadSettings() { DatabaseSettings settings = new DatabaseSettings(); settings.Load(); if (settings.EnableArchiving == false) { disableAchivation.Checked = true; } else if (settings.DbProvider == DatabaseFactory.SQLiteName) { dbType1.Checked = true; fileNameBox.Text = settings.DbFile; } else if (settings.DbFile.Length == 0 && settings.DbSource.Length == 0) { dbType3.Checked = true; connectionStringBox.Text = settings.DbConnectionString; } else { dbType2.Checked = true; serverBox.Text = settings.DbSource; dbNameBox.Text = settings.DbCatalog; userBox.Text = settings.DbUser; passwordBox.Text = settings.DbPassword; } int provider = dbProvidersInvariantNames.IndexOf(settings.DbProvider); if (provider >= 0) { providerCombo1.SelectedIndex = provider; providerCombo2.SelectedIndex = provider; } }
void OnProjectLoaded(object sender, System.EventArgs e) { databaseSettings.Load(); channelSettings.Load(); }