private void CopyFieldInfo(IFieldInfoEx field) { FieldName = field.FieldName; NickName = field.NickName; DataType = field.DataType; IsKey = field.IsKey; IsAutoInc = field.IsAutoInc; Length = field.Length; IsEmpty = field.IsEmpty; Precision = field.Precision; DisplayName = field.DisplayName; Decoder = field.Decoder; Expression = field.Expression; Layout = new SimpleFieldLayout(field.Layout); Kind = field.Kind; }
private void Arrange(List <Tk5FieldInfoEx> Fields) { if (Fields.Count == 0) { return; } int currentRow = 0; int currentCol = 0; foreach (var item in Fields) { SimpleFieldLayout layout = (SimpleFieldLayout)item.Layout; switch (layout.Layout) { case FieldLayout.PerUnit: if (layout.UnitNum >= ColumnCount) { layout.Layout = FieldLayout.PerLine; layout.UnitNum = ColumnCount; goto case FieldLayout.PerLine; } if (layout.UnitNum + currentCol <= ColumnCount) { currentCol += layout.UnitNum; } else { ++currentRow; } break; case FieldLayout.PerLine: if (currentCol != 0) { currentCol = 0; ++currentRow; } currentRow++; break; } } RowCount = currentRow + 1; }