Esempio n. 1
0
        void gvTables_RowPrePaint(object sender, System.Windows.Forms.DataGridViewRowPrePaintEventArgs e)
        {
            int row = e.RowIndex;

            if (row < 0)
            {
                return;
            }
            DataGridViewRow dr     = gvTables.Rows[row];
            string          exists = "未生成";
            DBTableInfo     info   = dr.DataBoundItem as DBTableInfo;

            if (info != null)
            {
                string fileName = DBEntityInfo.GetEntityRealFileName(info, _dbInfo, DesignerInfo);

                try
                {
                    if (File.Exists(fileName))
                    {
                        exists = "已生成";
                        dr.DefaultCellStyle.ForeColor = Color.Red;
                    }
                }
                catch { }
            }
            dr.Cells["ColExists"].Value = exists;
        }
Esempio n. 2
0
 /// <summary>
 /// 填充是否存在的列
 /// </summary>
 private void RefreashExistsInfo()
 {
     foreach (DataGridViewRow dr in gvTables.Rows)
     {
         string      exists = "未生成";
         DBTableInfo info   = dr.DataBoundItem as DBTableInfo;
         if (info != null)
         {
             string fileName = DBEntityInfo.GetEntityRealFileName(info, _dbInfo, DesignerInfo);
             try
             {
                 if (File.Exists(fileName))
                 {
                     exists = "已生成";
                     dr.DefaultCellStyle.ForeColor = Color.Red;
                 }
             }
             catch { }
         }
         dr.Cells["ColExists"].Value = exists;
     }
 }