private void SomethingDifferent(object sender, EventArgs e) { TableData.Clear(); if (SelectedLayout != null) { //Заполнить Layers согласно заданным строке и столбцу int colNum = Convert.ToInt32(СolumnNumberVM.NumValue) - 1; int startRowNum = Convert.ToInt32(RowNumberVM.NumValue) - 1; DataTable table = (DataTable)SelectedLayout; DataColumnCollection columns = table.Columns; if (columns.Count > colNum) { DataColumn column = table.Columns[colNum]; int currRowNum = 0; foreach (DataRow row in table.Rows) { if (currRowNum >= startRowNum) { TableData.Add(new LayerData() { Name = row[colNum].ToString() }); } currRowNum++; } } } SetResultLayerNames(); OnPropertyChanged("AcceptBtnIsEnabled"); }
private void readTGameplayDamageResistanceContainer(NdfObject obj) { var armourFamilies = obj.PropertyValues[1].Value as NdfCollection; var damageFamilies = obj.PropertyValues[0].Value as NdfCollection; var values = obj.PropertyValues[2].Value as NdfCollection; TableData.Clear(); TableData.TableName = "table"; foreach (var armourFamily in armourFamilies) { TableData.Columns.Add(armourFamily.Value.ToString()); } int k = 0; for (var i = 0; i < damageFamilies.Count; i++) { RowHeaders.Add(damageFamilies[i].Value.ToString()); var row = TableData.NewRow(); TableData.Rows.Add(row); var damageFamily = new ObservableCollection <NdfPropertyValue>(); for (var j = 0; j < armourFamilies.Count; j++) { row[j] = values[k++].Value; } } TableData.AcceptChanges(); }