예제 #1
0
 public ConnectionStringEditor(ConnectionStringSettings obj)
     : this()
 {
     this.m_OriginalConnectionString = obj.get_ConnectionString();
     this.m_OriginalProviderName = obj.get_ProviderName();
     this.m_ConnectionBindingSource.set_DataSource(obj);
     if (!string.IsNullOrEmpty(obj.get_Name()))
     {
         this.m_NameBox.set_Enabled(false);
     }
     if (string.IsNullOrEmpty(obj.get_ProviderName()))
     {
         obj.set_ProviderName("System.Data.SqlClient");
     }
 }
예제 #2
0
 private void m_AddButton_Click(object sender, System.EventArgs e)
 {
     ConnectionStringSettings settings = new ConnectionStringSettings();
     ConnectionStringEditor editor = new ConnectionStringEditor(settings);
     if (System.Windows.Forms.DialogResult.OK == editor.ShowDialog(this))
     {
         ConnectionsConfigurator.Add(settings.get_Name(), settings.get_ConnectionString(), settings.get_ProviderName());
     }
     this.RefreshGrid();
 }