예제 #1
0
 public static ConnectionManagerV2 GetConnectionManager()
 {
     if (connectionManager == null)
     {
         connectionManager = new ConnectionManagerV2();
     }
     return(connectionManager);
 }
예제 #2
0
        void Refresh_Connection()
        {
            var conns = ConnectionManagerV2.GetConnectionManager().conn_list
                        .Values
                        .Where(x => x.IsConnectionActive)
                        .ToList();

            if (conns != null && conns.Count > 0)
            {
                cmb_connections.DataSource    = conns;
                cmb_connections.DisplayMember = "Name";
                cmb_connections.ValueMember   = "ID";
            }
        }
예제 #3
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(textBox1.Text) && !string.IsNullOrEmpty(textBox2.Text))
     {
         try
         {
             ConnectionManagerV2.GetConnectionManager().SaveConnection(textBox2.Text, textBox1.Text);
             MessageBox.Show("Connection Added");
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
예제 #4
0
 private SQLiteConnection GetConnection(int Id)
 {
     return(ConnectionManagerV2.GetConnectionManager().GetConnection(Id).GetActiveConnection());
 }
예제 #5
0
 public frmMain()
 {
     InitializeComponent();
     obj_sql           = new SQLWorker();
     connectionManager = ConnectionManagerV2.GetConnectionManager();
 }