Exemplo n.º 1
0
 public MobaRow this[MobaRow row]
 {
     get
     {
         MobaRow result;
         foreach (MobaRow current in this.rows)
         {
             if (current == row)
             {
                 result = current;
                 return(result);
             }
         }
         result = null;
         return(result);
     }
     set
     {
         bool flag = false;
         foreach (MobaRow current in this.rows)
         {
             if (current == row)
             {
                 row  = value;
                 flag = true;
             }
         }
         if (!flag)
         {
             Log.error("找不到指定的MobaRow");
             throw new Exception("找不到指定的MobaRow");
         }
     }
 }
Exemplo n.º 2
0
        public MobaRow CopyTo()
        {
            MobaRow mobaRow = new MobaRow();

            foreach (KeyValuePair <string, MobaColumn> current in this.RowItem)
            {
                mobaRow.Add(current.Key, current.Value.MobaColumnText);
            }
            return(mobaRow);
        }
Exemplo n.º 3
0
 public void CopyToDictionaryAndParms(Dictionary <byte, object> dic)
 {
     if (dic.Count > 0)
     {
         this.Refresh();
         this.deleteRows.Clear();
         this.Clear();
         foreach (KeyValuePair <byte, object> current in dic)
         {
             if (current.Key == 0)
             {
                 Dictionary <string, string> dictionary = (Dictionary <string, string>)current.Value;
                 this.tableName = dictionary["TableName"];
                 this.tableKey  = dictionary["TableKey"];
             }
             else if (current.Key == 1)
             {
                 this.mParms = (Dictionary <byte, object>)current.Value;
             }
             else
             {
                 string[] array   = (string[])current.Value;
                 int      num     = 0;
                 string   rowName = string.Empty;
                 string[] array2  = array;
                 for (int i = 0; i < array2.Length; i++)
                 {
                     string text = array2[i];
                     if (num == 0)
                     {
                         rowName = text;
                     }
                     else if (this.rows.Count < num)
                     {
                         MobaRow mobaRow = new MobaRow();
                         mobaRow.Add(rowName, text);
                         this.rows.Add(mobaRow);
                     }
                     else
                     {
                         this.rows[num - 1].Add(rowName, text);
                     }
                     num++;
                 }
             }
         }
     }
 }
Exemplo n.º 4
0
        public bool Delete(MobaRow row)
        {
            bool result;

            try
            {
                this[row].RowState = MobaRowState.Delete;
                this.deleteRows.Add(row);
                this.rows.Remove(row);
                result = true;
            }
            catch
            {
                throw;
            }
            return(result);
        }
Exemplo n.º 5
0
        public MobaRow[] SelectRowsEqual(string strName, string strValue)
        {
            List <MobaRow> list = new List <MobaRow>();

            foreach (MobaRow current in this.rows)
            {
                if (current[strName].MobaColumnText == strValue)
                {
                    list.Add(current);
                }
            }
            MobaRow[] result;
            if (list.Count > 0)
            {
                MobaRow[] array = new MobaRow[list.Count];
                list.CopyTo(array);
                result = array;
            }
            else
            {
                result = null;
            }
            return(result);
        }
Exemplo n.º 6
0
 public void Add(MobaRow row)
 {
     row.RowState = MobaRowState.Insert;
     this.rows.Add(row);
 }