public static void Print <TKey, TValue>(ref int line, IIndexProvider provider, DisplayableProperty <TKey, TValue> generalProperties, AttributeList list) where TValue : Tuple { int lineOffset = -1; List <int> indexes = provider.GetIndexes(); for (int i = 0; i < indexes.Count; i += 2) { if (indexes[i] > -1 && indexes[i] < list.Attributes.Count && list.Attributes[indexes[i]].Visibility == VisibleState.Visible) { generalProperties.AddLabel(list.Attributes[indexes[i]], ++lineOffset, 0, false); generalProperties.AddProperty(list.Attributes[indexes[i]], lineOffset, 1); } if (i + 1 < indexes.Count) { if (indexes[i + 1] > -1 && indexes[i + 1] < list.Attributes.Count && list.Attributes[indexes[i + 1]].Visibility == VisibleState.Visible) { generalProperties.AddLabel(list.Attributes[indexes[i + 1]], lineOffset, 3, false); generalProperties.AddProperty(list.Attributes[indexes[i + 1]], lineOffset, 4); } } lineOffset++; line += 2; } }
public static Grid PrintGrid <TKey, TValue>(ref int line, int col, int rowSpan, int colSpan, IIndexProvider provider, int c0, int c1, int c2, int c3, DisplayableProperty <TKey, TValue> generalProperties, AttributeList list) where TValue : Tuple { Grid grid = generalProperties.AddGrid(line, col, rowSpan, colSpan); grid.ColumnDefinitions.Add(_getColumnDef(c0)); grid.ColumnDefinitions.Add(_getColumnDef(c1)); grid.ColumnDefinitions.Add(_getColumnDef(c2)); grid.ColumnDefinitions.Add(_getColumnDef(c3)); int lineOffset = -1; List <int> indexes = provider.GetIndexes(); for (int i = 0; i < indexes.Count; i += 2) { if (indexes[i] > -1 && indexes[i] < list.Attributes.Count && list.Attributes[indexes[i]].Visibility == VisibleState.Visible) { generalProperties.AddLabel(list.Attributes[indexes[i]], ++lineOffset, 0, false, grid); generalProperties.AddProperty(list.Attributes[indexes[i]], lineOffset, 1, grid); } if (i + 1 < indexes.Count) { if (indexes[i + 1] > -1 && indexes[i + 1] < list.Attributes.Count && list.Attributes[indexes[i + 1]].Visibility == VisibleState.Visible) { generalProperties.AddLabel(list.Attributes[indexes[i + 1]], lineOffset, 2, false, grid); generalProperties.AddProperty(list.Attributes[indexes[i + 1]], lineOffset, 3, grid); } } lineOffset++; } line++; return(grid); }
public static void InPairsLabel <T>(DbAttribute att1, DbAttribute att2, ref int line, DisplayableProperty <T, ReadableTuple <T> > generalProperties) { if (att1 != null && att1.Visibility == VisibleState.Visible) { generalProperties.AddLabel(att1, line, 0); } if (att2 != null && att2.Visibility == VisibleState.Visible) { generalProperties.AddLabel(att2, line, 3); } line += 2; }