Exemple #1
0
        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);
            }
        }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
        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);
        }
Exemple #5
0
 internal protected abstract bool TryCreate(MetaElementType elementType, out ReadElement element);
Exemple #6
0
 internal protected override bool TryCreate(MetaElementType elementType, out ReadElement element)
 {
     element = null;
     return(false);
 }
Exemple #7
0
 internal static string ToElementName(MetaElementType enumerator)
 {
     return(formatRecArray[(int)enumerator].ElementName);
 }