public object Clone() { FieldsCollections collections = new FieldsCollections(); foreach (FieldItem item in this) { FieldItem fieldItem = new FieldItem(); fieldItem.CalcType = item.CalcType; fieldItem.DataTableName = item.DataTableName; fieldItem.TableAliasName = item.TableAliasName; fieldItem.DisplayOrder = item.DisplayOrder; fieldItem.Expression = item.Expression; fieldItem.FieldChineseName = item.FieldChineseName; fieldItem.FieldName = item.FieldName; fieldItem.FieldType = item.FieldType; fieldItem.FunctionName = item.FunctionName; fieldItem.IsGroup = item.IsGroup; fieldItem.Precision = item.Precision; fieldItem.ColumnVisible = item.ColumnVisible; fieldItem.Converge = item.Converge; fieldItem.DisplayWidth = item.DisplayWidth; fieldItem.DecimalDigits = item.DecimalDigits; StyleFormat[] s = new StyleFormat[item.StyleFormat.Count]; item.StyleFormat.CopyTo(s); fieldItem.StyleFormat = new System.Collections.Generic.List <StyleFormat>(); foreach (StyleFormat st in s) { fieldItem.StyleFormat.Add(st); } collections.Add(fieldItem); } return(collections); }
public object Clone() { StyleFormat styleFormat = new StyleFormat(); styleFormat.BackColorRed = BackColorRed; styleFormat.BackColorGreen = BackColorGreen; styleFormat.BackColorBlue = BackColorBlue; styleFormat.ForeColorRed = ForeColorRed; styleFormat.ForeColorGreen = ForeColorGreen; styleFormat.ForeColorBlue = ForeColorBlue; styleFormat.ApplyToRow = ApplyToRow; styleFormat.Condition = Condition; styleFormat.Type1 = Type1; styleFormat.Value1 = Value1; styleFormat.Type2 = Type2; styleFormat.Value2 = Value2; return(styleFormat); }