コード例 #1
0
        internal void SetMetaReference(FtMetaReferenceType type, string reference)
        {
            Remove(MetaFileParameterName);
            Remove(MetaUrlParameterName);
            Remove(MetaEmbeddedParameterName);

            switch (type)
            {
            case FtMetaReferenceType.Embedded:
                Add(MetaEmbeddedParameterName, MetaEmbeddedParameterValue);
                break;

            case FtMetaReferenceType.File:
                Add(MetaFileParameterName, reference);
                break;

            case FtMetaReferenceType.Url:
                Add(MetaUrlParameterName, reference);
                break;

            case FtMetaReferenceType.None:
                break;

            default:
                throw FtInternalException.Create(InternalError.DeclaredParameters_SetMetaReference_UnknownMetaReferenceType, type.ToString());
            }
        }
コード例 #2
0
        internal void GetMetaReference(out FtMetaReferenceType type, out string reference)
        {
            int idx = IndexOfName(MetaUrlParameterName);

            if (idx >= 0)
            {
                reference = list[idx].Value;
                type      = FtMetaReferenceType.Url;
            }
            else
            {
                idx = IndexOfName(MetaFileParameterName);
                if (idx >= 0)
                {
                    reference = list[idx].Value;
                    type      = FtMetaReferenceType.File;
                }
                else
                {
                    idx = IndexOfName(MetaEmbeddedParameterName);
                    if (idx >= 0)
                    {
                        reference = list[idx].Value; // not relevant
                        type      = FtMetaReferenceType.Embedded;
                    }
                    else
                    {
                        reference = ""; // not relevant
                        type      = FtMetaReferenceType.None;
                    }
                }
            }
        }
コード例 #3
0
        internal static bool TryParseAttributeValue(string attributeValue, out FtMetaReferenceType enumerator)
        {
            enumerator = FtMetaReferenceType.Embedded; // avoid compiler error
            bool result = false;

            foreach (FormatRec rec in formatRecArray)
            {
                if (String.Equals(rec.AttributeValue, attributeValue, StringComparison.OrdinalIgnoreCase))
                {
                    enumerator = rec.Enumerator;
                    result     = true;
                    break;
                }
            }
            return(result);
        }
コード例 #4
0
        protected new void Reset()
        {
            base.Reset();

            declarationRead      = false;
            embeddedMetaRead     = false;
            headingLineReadCount = 0;
            headingLinesRead     = false;
            headerRead           = !declared && HeadingLineCount == 0;
            finished             = false;

            declaredParameters.Clear();
            lineParser.Reset();
            embeddedMetaParser.Reset();
            metaReferenceType      = FtMetaReferenceType.None;
            metaReference          = "";
            metaEmbedded           = false;
            newTableStarted        = false;
            tableStartSuspended    = false;
            tableStartRecordPeeked = false;
            lineType = FtLineType.Blank;

            lineBuilder.Clear();
        }
コード例 #5
0
 internal static string ToAttributeValue(FtMetaReferenceType enumerator)
 {
     return(formatRecArray[(int)enumerator].AttributeValue);
 }