internal protected override bool TryCreate(MetaElementType elementType, out ReadElement element) { switch (elementType) { case MetaElementType.Field: FieldReadElement fieldReadElement = new FieldReadElement(); fieldList.Add(fieldReadElement); element = fieldReadElement; return(true); case MetaElementType.Sequence: SequenceReadElement sequenceReadElement = new SequenceReadElement(); sequenceList.Add(sequenceReadElement); element = sequenceReadElement; return(true); case MetaElementType.Substitution: SubstitutionReadElement substitutionReadElement = new SubstitutionReadElement(); substitutionList.Add(substitutionReadElement); element = substitutionReadElement; return(true); default: element = null; return(false); } }
internal protected override bool TryCreate(MetaElementType elementType, out ReadElement element) { switch (elementType) { case MetaElementType.SequenceItem: SequenceItemReadElement itemReadElement = new SequenceItemReadElement(); itemList.Add(itemReadElement); element = itemReadElement; return(true); default: element = null; return(false); } }
internal protected override bool TryCreate(MetaElementType elementType, out ReadElement element) { switch (elementType) { case MetaElementType.SequenceRedirect: SequenceRedirectReadElement redirectReadElement = new SequenceRedirectReadElement(); redirectList.Add(redirectReadElement); element = redirectReadElement; return(true); default: element = null; return(false); } }
internal static bool TryParseElementName(string elementName, out MetaElementType enumerator) { enumerator = MetaElementType.FieldedText; // avoid compiler error bool result = false; foreach (FormatRec rec in formatRecArray) { if (String.Equals(rec.ElementName, elementName, StringComparison.OrdinalIgnoreCase)) { enumerator = rec.Enumerator; result = true; break; } } return(result); }
internal protected abstract bool TryCreate(MetaElementType elementType, out ReadElement element);
internal protected override bool TryCreate(MetaElementType elementType, out ReadElement element) { element = null; return(false); }
internal static string ToElementName(MetaElementType enumerator) { return(formatRecArray[(int)enumerator].ElementName); }