Esempio n. 1
0
        public static bool IsFixedType(PropertyTag propertyTag)
        {
            if (_markerHash.Count == 0)
                Init();

            return _fixedTypeHash.Contains(propertyTag.PropType);
        }
Esempio n. 2
0
        public SpecialFixProperty(int tag, byte[] value)
        {
            PropTag = new PropertyTag((uint)tag);
            Tag = (uint)tag;
            Bytes = value;

            PropValue = new SpecialPropertyValue() { Bytes = this.Bytes, BytesCount = this.BytesCount };
        }
Esempio n. 3
0
 public IPropValue CreatePropValue(PropertyTag propertyTag)
 {
     if (PropertyTag.IsFixedType(propertyTag))
     {
         return new FixPropValue(propertyTag);
     }
     else if(PropertyTag.IsVarType(propertyTag))
     {
         return new VarPropValue(propertyTag);
     }
     else if(PropertyTag.IsMultiType(propertyTag))
     {
         return new MvPropValue(propertyTag);
     }
     else
     {
         throw new ArgumentException(string.Format("Don't support this propertyTag:[{0}].", propertyTag.Data));
     }
 }
Esempio n. 4
0
 internal Attachment CreateAttachment(PropertyTag propertyTag)
 {
     return new Attachment();
 }
Esempio n. 5
0
 internal static bool IsAttachmentBeginTag(PropertyTag propertyTag)
 {
     return propertyTag.Data == PropertyTag.NewAttach;
 }
Esempio n. 6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="tag"></param>
 /// <param name="value">doesnot contain the terminate character.</param>
 public SpecialVarBaseProperty(uint tag, byte[] value)
 {
     Bytes = value;
     Tag = tag;
     PropTag = new PropertyTag(tag);
     PropValue = new SpecialVarStrValue(Bytes, BytesCount);
 }
Esempio n. 7
0
        public static bool IsMetaProperty(PropertyTag propertyTag)
        {
            Init();

            return _metaPropertyHash.Contains(propertyTag.Data);
        }
Esempio n. 8
0
 public Recipient CreateRecipient(PropertyTag propertyTag)
 {
     return new Recipient();
 }
Esempio n. 9
0
        internal ISizeValue CreateSizeValue(PropertyTag propertyTag, PropValueLength propValueLength)
        {
            ushort baseType = (ushort)(propertyTag.PropType & 0x00FF);
            switch (baseType)
            {
                case (UInt16)PropertyType.PT_I2:
                case (UInt16)PropertyType.PT_LONG:
                case (UInt16)PropertyType.PT_R4:
                case (UInt16)PropertyType.PT_DOUBLE:
                case (UInt16)PropertyType.PT_CURRENCY:
                case (UInt16)PropertyType.PT_APPTIME:
                case (UInt16)PropertyType.PT_BOOLEAN:
                case (UInt16)PropertyType.PT_I8:
                case (UInt16)PropertyType.PT_SYSTIME:
                case (UInt16)PropertyType.PT_CLSID:
                    return new MvFixedSizeValue(propertyTag ,propValueLength);

                case (UInt16)PropertyType.PT_BINARY:
                case (UInt16)PropertyType.PT_SERVERID:
                case (UInt16)PropertyType.PT_STRING8:
                case (UInt16)PropertyType.PT_OBJECT:
                    return new MvVarSizeValue(propertyTag, propValueLength);
                default:
                    if ((propertyTag.PropType & 0x8000) == 0x8000)
                    {
                        return new MvVarSizeValue(propertyTag, propValueLength);
                    }
                    else
                        throw new ArgumentException(string.Format("The type {0} is not the Mv type.", propertyTag.PropType.ToString("X4")));
            }
        }
Esempio n. 10
0
        public static bool IsVarType(PropertyTag propertyTag)
        {
            if (_markerHash.Count == 0)
                Init();

            if (_varTypeHash.Contains(propertyTag.PropType))
                return true;
            else
            {
                if((propertyTag.PropType & 0x8000) == 0x8000 && (propertyTag.PropType & 0x1000) != 0x1000)
                    return true;
            }
            return false;
        }
Esempio n. 11
0
 public static bool IsProperty(PropertyTag propertyTag)
 {
     return (!IsMarker(propertyTag) && !IsMetaProperty(propertyTag)) &&
         (IsFixedType(propertyTag) || IsVarType(propertyTag) || IsMultiType(propertyTag));
 }
Esempio n. 12
0
        public static bool IsMultiType(PropertyTag propertyTag)
        {
            if (_markerHash.Count == 0)
                Init();

            bool result = _mvTypeHash.Contains(propertyTag.PropType);
            if(!result)
            {
                if ((propertyTag.PropType & 0x9000) == 0x9000)
                    return true;
            }
            return result;
        }
Esempio n. 13
0
 public bool IsTagRight(PropertyTag propertyTag)
 {
     return propertyTag.Data == PropertyTag.StartEmbed;
 }
Esempio n. 14
0
 public static bool IsVarType(PropertyTag propertyTag)
 {
     return IsVarProperty(propertyTag.PropType);
 }
Esempio n. 15
0
 public static bool IsMultiVarType(PropertyTag propertyTag)
 {
     return IsMultiVarType(propertyTag.PropType);
 }
Esempio n. 16
0
 internal MvVarSizeItem CreateMvVarSizeItem(PropertyTag propertyTag)
 {
     return new MvVarSizeItem(propertyTag);
 }
Esempio n. 17
0
 internal IPropInfo CreatePropInfo(PropertyTag propertyTag)
 {
     var propId = propertyTag.PropId;
     if(propId < 0x8000)
     {
         return new TagPropId();
     }
     else
     {
         return new NamePropInfo();
     }
 }
Esempio n. 18
0
        public static bool IsMarker(PropertyTag propertyTag)
        {
            if (_markerHash.Count == 0)
                Init();

            return _markerHash.Contains(propertyTag.Data);
        }
Esempio n. 19
0
        public ISpecialValue CreateNewPropValue(int propertyTag, Int64 value)
        {
            PropertyTag tag = new PropertyTag((uint)propertyTag);

            if (PropertyTag.IsFixedType(tag))
            {
                return new SpecialFixProperty(propertyTag, value);
            }
            else if (PropertyTag.IsVarType(tag))
            {
                if (tag.PropType == (ushort)PropertyType.PT_UNICODE)
                    return new SpecialVarStringProperty(propertyTag, value);
                else
                    return new SpecialVarBaseProperty(propertyTag, value);
            }
            else if (PropertyTag.IsMultiType(tag))
            {
                return new SpecialMvBaseProperty(propertyTag, value);
            }
            else
                throw new InvalidProgramException();
        }
Esempio n. 20
0
 public SpecialVarBaseProperty(int tag, Int64 parseValueFromMsg)
 {
     PropTag = new PropertyTag((uint)tag);
     Tag = (uint)tag;
     _parseValueFromMsg = parseValueFromMsg;
 }
Esempio n. 21
0
 internal static bool IsRecipientBegin(PropertyTag propertyTag)
 {
     return propertyTag.Data == PropertyTag.StartRecip;
 }
Esempio n. 22
0
 public static bool IsFixedType(PropertyTag propertyTag)
 {
     return IsFixProperty(propertyTag.PropType);
 }