Пример #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();
 }