Exemple #1
0
 public ListViewShowMenuEventArgs(SelectInfo info, DatabaseInfo databaseInfo, MouseEventArgs e)
     :
     base()
 {
     this.selectInfo   = info;
     this.databaseInfo = databaseInfo;
     this.mouseEvent   = e;
 }
Exemple #2
0
        public SelectInfo AddSelectInfo(string name)
        {
            SelectInfo info = new SelectInfo();

            info.Name         = name;
            info.DatabaseInfo = this;
            this.selects.Add(info);
            this.selectMaps.Add(info.Name, info);
            return(info);
        }
Exemple #3
0
 public void RefreshSelect()
 {
     try
     {
         if (!this.isOpen)
         {
             return;
         }
         ;
         List <SelectInfo> newSelects  = new List <SelectInfo>();
         List <SelectInfo> openSelects = new List <SelectInfo>();
         using (DbConnection connection = new SQLiteConnection(ConnectInfo.LocalConnectionString))
         {
             connection.Open();
             DataSet   ds      = new DataSet();
             DbCommand command = connection.CreateCommand();
             command.CommandText = Resources.LoadSelectScript;
             command.Parameters.Add(new SQLiteParameter("@database", this.name));
             command.Parameters.Add(new SQLiteParameter("@connect", this.connectInfo.Name));
             DbDataAdapter da = new SQLiteDataAdapter(command as SQLiteCommand);
             da.Fill(ds);
             foreach (DataRow dr in ds.Tables[0].Rows)
             {
                 string selectName = dr[0].ToString();
                 if (this.selectMaps.ContainsKey(selectName))
                 {
                     SelectInfo selectInfo = this.selectMaps[selectName];
                     if (selectInfo.IsOpen)
                     {
                         openSelects.Add(selectInfo);
                     }
                 }
                 else
                 {
                     SelectInfo selectInfo = this.AddSelectInfo(selectName);
                     newSelects.Add(selectInfo);
                 }
             }
         }
         this.OnRefreshSelects(new RefreshSelectsEventArgs(this, newSelects, openSelects));
     }
     catch (Exception ex)
     {
         LogHelper.Error(ex);
     }
 }
Exemple #4
0
 public OpenSelectEventArgs(SelectInfo info)
     :
     base()
 {
     this.info = info;
 }