private void cmbDBType_SelectionChanged(object sender, SelectionChangedEventArgs e) { m_doc = new XmlDocument(); m_doc.Load("dbviewerconfig.xml"); EnumDBType enuDBType; switch (cmbDBType.SelectedIndex) { case 0: //SQL Server enuDBType = EnumDBType.SQLServer; txtServer.Visibility = Visibility.Visible; lblServer.Visibility = Visibility.Visible; break; case 1: enuDBType = EnumDBType.Oracle; txtServer.Visibility = Visibility.Hidden; lblServer.Visibility = Visibility.Hidden; break; default: return; } m_currentDBConfig = DBViewerConfig.Create(GetDBTypeNode(enuDBType)); txtServer.Text = m_currentDBConfig.Server; txtDBName.Text = m_currentDBConfig.DbName; txtDBUser.Text = m_currentDBConfig.User; txtPassword.Text = m_currentDBConfig.Password; chkDisplayNull.IsChecked = m_currentDBConfig.DisplayNull; txtUserFieldName.Text = m_currentDBConfig.UserFieldName; txtUser.Text = m_currentDBConfig.TraceUser; }
private Control GetPanelControl(EnumDBType enuDBType) { m_currentConfig = ConfigService.CreateConfigModel(enuDBType); m_currentDBConfig = DBViewerConfig.Create(GetDBTypeNode(enuDBType)); Control ctl = m_currentConfig.GetConfigPanel(m_currentDBConfig); return(ctl); }