Пример #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposedValue)
     {
         if (disposing)
         {
             DataEnumerator.Dispose();
             DataEnumerator = null;
         }
         disposedValue = true;
     }
 }
Пример #2
0
 public bool Read()
 {
     return(DataEnumerator.MoveNext());
 }
Пример #3
0
        /// <summary>
        /// Обновление данных на ListView
        /// </summary>
        public void UpdateListViewData()
        {
            ListViewGrid.Columns.Clear();
            DataTable table = new DataTable();

            table.TableName = "Data";
            //Формирование заголовка таблицы
            DataColumn Num_col = new DataColumn();

            Num_col.DataType   = System.Type.GetType("System.String");
            Num_col.Caption    = "Number";
            Num_col.ColumnName = "Number";
            table.Columns.Add(Num_col);

            DataColumn Time_col = new DataColumn();

            Time_col.DataType   = System.Type.GetType("System.String");
            Time_col.Caption    = "Time";
            Time_col.ColumnName = "Time";
            table.Columns.Add(Time_col);

            DataColumn Delta_col = new DataColumn();

            Delta_col.DataType   = System.Type.GetType("System.String");
            Delta_col.Caption    = "Delta";
            Delta_col.ColumnName = "Delta";
            table.Columns.Add(Delta_col);

            GridViewColumn Num = new GridViewColumn();

            Num.Header = "Number";
            Num.DisplayMemberBinding = new Binding("Number");
            ListViewGrid.Columns.Add(Num);


            GridViewColumn Time = new GridViewColumn();

            Time.Header = "Time";
            Time.DisplayMemberBinding = new Binding("Time");
            ListViewGrid.Columns.Add(Time);

            GridViewColumn Delta = new GridViewColumn();

            Delta.Header = "Delta";
            Delta.DisplayMemberBinding = new Binding("Delta");
            ListViewGrid.Columns.Add(Delta);

            foreach (My_Variable var in CurrentDump)
            {
                GridViewColumn Name = new GridViewColumn();
                Name.Header = var.FullName;
                Name.DisplayMemberBinding = new Binding(var.FullName.Replace('.', '_'));
                ListViewGrid.Columns.Add(Name);
            }

            foreach (My_Variable var in CurrentDump)
            {
                DataColumn Name_col = new DataColumn();
                Name_col.DataType   = System.Type.GetType("System.String");
                Name_col.ColumnName = var.FullName.Replace('.', '_');
                Name_col.Caption    = var.FullName;
                table.Columns.Add(Name_col);
            }

            if (TotalPageCount != 0)
            {
                bool isEmpty = true;
                foreach (List <string []> lines in GetPagedEnumerator())
                {
                    foreach (string [] line in lines)
                    {
                        isEmpty = false;
                        DataRow row = table.NewRow();
                        row["Number"] = line[0];
                        row["Time"]   = line[1];
                        row["Delta"]  = line[2];
                        int i = 0;
                        foreach (My_Variable var in currentDump)
                        {
                            row[var.FullName.Replace('.', '_')] = line[i + 3];
                            i++;
                        }

                        table.Rows.Add(row);
                    }
                }
                if (isEmpty == true)
                {
                    DataEnumerator   enumerator = pageIterator.GetEnumerator() as DataEnumerator;
                    List <string []> lines      = enumerator.Current;
                    foreach (string[] line in lines)
                    {
                        isEmpty = false;
                        DataRow row = table.NewRow();
                        row["Number"] = line[0];
                        row["Time"]   = line[1];
                        row["Delta"]  = line[2];
                        int i = 0;
                        foreach (My_Variable var in currentDump)
                        {
                            row[var.FullName.Replace('.', '_')] = line[i + 3];
                            i++;
                        }

                        table.Rows.Add(row);
                    }
                }
            }

            ListViewData.DataContext = ((IListSource)table).GetList();
        }