public FtMetaField New(int dataType) { FtMetaField result = FieldFactory.CreateMetaField(dataType, HeadingCount); Add(result); return(result); }
protected internal override FtMetaField CreateCopy() { FtMetaField field = FieldFactory.CreateMetaField(DataType, HeadingCount); field.Assign(this); return(field); }
protected internal virtual void Assign(FtMetaField source) { Id = source.Id; Name = source.Name; headings = new string[source.HeadingCount]; Array.Copy(source.Headings, headings, source.HeadingCount); FixedWidth = source.FixedWidth; Width = source.Width; Constant = source.Constant; Null = source.Null; ValueQuotedType = source.ValueQuotedType; ValueAlwaysWriteOptionalQuote = source.ValueAlwaysWriteOptionalQuote; ValueWritePrefixSpace = source.ValueWritePrefixSpace; ValuePadAlignment = source.ValuePadAlignment; ValuePadCharType = source.ValuePadCharType; ValuePadChar = source.ValuePadChar; ValueTruncateType = source.ValueTruncateType; ValueTruncateChar = source.ValueTruncateChar; ValueEndOfValueChar = source.ValueEndOfValueChar; ValueNullChar = source.ValueNullChar; HeadingConstraint = source.HeadingConstraint; HeadingQuotedType = source.HeadingQuotedType; HeadingAlwaysWriteOptionalQuote = source.HeadingAlwaysWriteOptionalQuote; HeadingWritePrefixSpace = source.HeadingWritePrefixSpace; HeadingPadAlignment = source.HeadingPadAlignment; HeadingPadCharType = source.HeadingPadCharType; HeadingPadChar = source.HeadingPadChar; HeadingTruncateType = source.HeadingTruncateType; HeadingTruncateChar = source.HeadingTruncateChar; HeadingEndOfValueChar = source.HeadingEndOfValueChar; }
public void RemoveField(FtMetaField field) { foreach (FtMetaSequence sequence in list) { sequence.RemoveItemsWithField(field); } }
internal protected override void LoadMeta(FtMetaField metaField, CultureInfo myCulture, int myMainHeadingIndex) { base.LoadMeta(metaField, myCulture, myMainHeadingIndex); FtFloatMetaField floatMetaField = metaField as FtFloatMetaField; formatter.Format = floatMetaField.Format; formatter.Styles = floatMetaField.Styles; }
public void Remove(FtMetaField field) { int idx = list.IndexOf(field); if (idx >= 0) { RemoveAt(idx); } }
protected internal override void Assign(FtMetaField source) { base.Assign(source); FtFloatMetaField typedSource = source as FtFloatMetaField; Format = typedSource.Format; Styles = typedSource.Styles; }
protected internal override void Assign(FtMetaField source) { base.Assign(source); FtBooleanMetaField typedSource = source as FtBooleanMetaField; FalseText = typedSource.FalseText; TrueText = typedSource.TrueText; Styles = typedSource.Styles; }
internal protected override void LoadMeta(FtMetaField metaField, CultureInfo myCulture, int myMainHeadingIndex) { base.LoadMeta(metaField, myCulture, myMainHeadingIndex); FtDateTimeMetaField dateTimeMetaField = metaField as FtDateTimeMetaField; formatter.Format = dateTimeMetaField.Format; formatter.Styles = dateTimeMetaField.Styles; constantValue = dateTimeMetaField.Value; }
internal protected override void LoadMeta(FtMetaField metaField, CultureInfo myCulture, int myMainHeadingIndex) { base.LoadMeta(metaField, myCulture, myMainHeadingIndex); if (metaField.Constant && !metaField.Null) { FtGenericMetaField <T> genericMetaField = metaField as FtGenericMetaField <T>; value = genericMetaField.Value; } }
public void RemoveItemsWithField(FtMetaField field) { for (int i = itemList.Count - 1; i >= 0; i--) { if (itemList[i].Field == field) { itemList.RemoveAt(i); } } }
internal protected override void LoadMeta(FtMetaField metaField, CultureInfo myCulture, int myMainHeadingIndex) { base.LoadMeta(metaField, myCulture, myMainHeadingIndex); FtBooleanMetaField booleanMetaField = metaField as FtBooleanMetaField; formatter.FalseText = booleanMetaField.FalseText; formatter.TrueText = booleanMetaField.TrueText; formatter.Styles = booleanMetaField.Styles; }
public void Assign(FtMetaFieldList source) { list.Clear(); list.Capacity = source.Count; for (int i = 0; i < source.Count; i++) { FtMetaField field = source[i].CreateCopy(); Add(field); } }
private void UnbindFieldEvents(FtMetaField field) { field.DefaultHeadingConstraintRequiredEvent -= HandleDefaultHeadingConstraintRequiredEvent; field.DefaultHeadingQuotedTypeRequiredEvent -= HandleDefaultHeadingQuotedTypeRequiredEvent; field.DefaultHeadingAlwaysWriteOptionalQuoteRequiredEvent -= HandleDefaultHeadingAlwaysWriteOptionalQuoteRequiredEvent; field.DefaultHeadingWritePrefixSpaceRequiredEvent -= HandleDefaultHeadingWritePrefixSpaceRequiredEvent; field.DefaultHeadingPadAlignmentRequiredEvent -= HandleDefaultHeadingPadAlignmentRequiredEvent; field.DefaultHeadingPadCharTypeRequiredEvent -= HandleDefaultHeadingPadCharTypeRequiredEvent; field.DefaultHeadingPadCharRequiredEvent -= HandleDefaultHeadingPadCharRequiredEvent; field.DefaultHeadingTruncateTypeRequiredEvent -= HandleDefaultHeadingTruncateTypeRequiredEvent; field.DefaultHeadingTruncateCharRequiredEvent -= HandleDefaultHeadingTruncateCharRequiredEvent; field.DefaultHeadingEndOfValueCharRequiredEvent -= HandleDefaultHeadingEndOfValueCharRequiredEvent; }
public void MoveItemToBefore(int fromIdx, int beforeIdx) { if ((beforeIdx != fromIdx) && (beforeIdx != (fromIdx + 1))) { FtMetaField field = list[fromIdx]; list.RemoveAt(fromIdx); int insertIdx; if (beforeIdx < fromIdx) { insertIdx = beforeIdx; } else { insertIdx = --beforeIdx; } list.Insert(insertIdx, field); } }
public void MoveItemToAfter(int fromIdx, int afterIdx) { if ((afterIdx != fromIdx) && (afterIdx != (fromIdx - 1))) { FtMetaField field = list[fromIdx]; list.RemoveAt(fromIdx); int insertIdx; if (afterIdx > fromIdx) { insertIdx = afterIdx; } else { insertIdx = ++afterIdx; } list.Insert(insertIdx, field); } }
public void Add(FtMetaField field) { list.Add(field); field.HeadingCount = headingCount; BindFieldEvents(field); }
internal protected virtual void LoadMeta(FtMetaField metaField, CultureInfo myCulture, int myMainHeadingIndex) { dataType = metaField.DataType; id = metaField.Id; metaName = metaField.Name; metaHeadings = metaField.Headings; mainHeadingIndex = myMainHeadingIndex; culture = myCulture; fixedWidth = metaField.FixedWidth; width = metaField.Width; constant = metaField.Constant; _null = metaField.Null; valueQuotedType = metaField.ValueQuotedType; valueAlwaysWriteOptionalQuote = metaField.ValueAlwaysWriteOptionalQuote; valueWritePrefixSpace = metaField.ValueWritePrefixSpace; valuePadAlignment = metaField.ValuePadAlignment; valuePadCharType = metaField.ValuePadCharType; valuePadChar = metaField.ValuePadChar; valueTruncateType = metaField.ValueTruncateType; valueTruncateChar = metaField.ValueTruncateChar; valueEndOfValueChar = metaField.ValueEndOfValueChar; valueNullChar = metaField.ValueNullChar; headingConstraint = metaField.HeadingConstraint; headingQuotedType = metaField.HeadingQuotedType; headingAlwaysWriteOptionalQuote = metaField.HeadingAlwaysWriteOptionalQuote; headingWritePrefixSpace = metaField.HeadingWritePrefixSpace; headingPadAlignment = metaField.HeadingPadAlignment; headingPadCharType = metaField.HeadingPadCharType; headingPadChar = metaField.HeadingPadChar; headingTruncateType = metaField.HeadingTruncateType; headingTruncateChar = metaField.HeadingTruncateChar; headingEndOfValueChar = metaField.HeadingEndOfValueChar; formatter.Culture = culture; if ( ((headingConstraint == FtHeadingConstraint.NameIsMain) || (headingConstraint == FtHeadingConstraint.NameConstant)) && (mainHeadingIndex >= 0) && (mainHeadingIndex < MetaHeadingCount) ) { metaHeadings[mainHeadingIndex] = metaName; } switch (headingPadAlignment) { case FtPadAlignment.Left: headingLeftPad = true; break; case FtPadAlignment.Right: headingLeftPad = false; break; case FtPadAlignment.Auto: headingLeftPad = autoLeftPad; break; default: throw FtInternalException.Create(InternalError.FtFieldFieldDefinition_LoadMeta_UnsupportedHeadingPadAlignment, headingPadAlignment.ToString()); } switch (valuePadAlignment) { case FtPadAlignment.Left: valueLeftPad = true; break; case FtPadAlignment.Right: valueLeftPad = false; break; case FtPadAlignment.Auto: valueLeftPad = autoLeftPad; break; default: throw FtInternalException.Create(InternalError.FtFieldFieldDefinition_LoadMeta_UnsupportedValuePadAlignment, headingPadAlignment.ToString()); } if (fixedWidth) { fixedWidthNullValueText = new string(ValueNullChar, Width); } }
public int IndexOf(FtMetaField field) { return(list.IndexOf(field)); }