Ejemplo n.º 1
0
 public List <SourseData> Read()
 {
     try
     {
         if (!IsOpen)
         {
             Open();
         }
         List <SourseData> data = new List <SourseData>();
         for (var row = Position; row < Position + Step; row++)
         {
             SourseData rowData = new SourseData(
                 Range.Cells[row, ColumnIndexes[0]].Text,
                 Range.Cells[row, ColumnIndexes[1]].Text,
                 Range.Cells[row, ColumnIndexes[2]].Text,
                 Range.Cells[row, ColumnIndexes[3]].Text,
                 Range.Cells[row, ColumnIndexes[4]].Text,
                 Range.Cells[row, ColumnIndexes[5]].Text,
                 Range.Cells[row, ColumnIndexes[6]].Text,
                 Range.Cells[row, ColumnIndexes[7]].Text
                 );
             data.Add(rowData);
         }
         return(data);
     }
     catch (Exception)
     {
         return(new List <SourseData>());
     }
 }
Ejemplo n.º 2
0
 private void Table_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (e.AddedItems.Count > 0)
     {
         SourseData data = e.AddedItems[0] as SourseData;
         Id.Text              = data.Id;
         NameD.Text           = data.Name;
         Description.Text     = data.Description;
         Sourse.Text          = data.Sourse;
         Target.Text          = data.Target;
         Confidentiality.Text = data.Confidentiality;
         Integrity.Text       = data.Integrity;
         Access.Text          = data.Access;
     }
 }