public static bool IsFixedType(PropertyTag propertyTag) { if (_markerHash.Count == 0) Init(); return _fixedTypeHash.Contains(propertyTag.PropType); }
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 }; }
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)); } }
internal Attachment CreateAttachment(PropertyTag propertyTag) { return new Attachment(); }
internal static bool IsAttachmentBeginTag(PropertyTag propertyTag) { return propertyTag.Data == PropertyTag.NewAttach; }
/// <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); }
public static bool IsMetaProperty(PropertyTag propertyTag) { Init(); return _metaPropertyHash.Contains(propertyTag.Data); }
public Recipient CreateRecipient(PropertyTag propertyTag) { return new Recipient(); }
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"))); } }
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; }
public static bool IsProperty(PropertyTag propertyTag) { return (!IsMarker(propertyTag) && !IsMetaProperty(propertyTag)) && (IsFixedType(propertyTag) || IsVarType(propertyTag) || IsMultiType(propertyTag)); }
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; }
public bool IsTagRight(PropertyTag propertyTag) { return propertyTag.Data == PropertyTag.StartEmbed; }
public static bool IsVarType(PropertyTag propertyTag) { return IsVarProperty(propertyTag.PropType); }
public static bool IsMultiVarType(PropertyTag propertyTag) { return IsMultiVarType(propertyTag.PropType); }
internal MvVarSizeItem CreateMvVarSizeItem(PropertyTag propertyTag) { return new MvVarSizeItem(propertyTag); }
internal IPropInfo CreatePropInfo(PropertyTag propertyTag) { var propId = propertyTag.PropId; if(propId < 0x8000) { return new TagPropId(); } else { return new NamePropInfo(); } }
public static bool IsMarker(PropertyTag propertyTag) { if (_markerHash.Count == 0) Init(); return _markerHash.Contains(propertyTag.Data); }
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(); }
public SpecialVarBaseProperty(int tag, Int64 parseValueFromMsg) { PropTag = new PropertyTag((uint)tag); Tag = (uint)tag; _parseValueFromMsg = parseValueFromMsg; }
internal static bool IsRecipientBegin(PropertyTag propertyTag) { return propertyTag.Data == PropertyTag.StartRecip; }
public static bool IsFixedType(PropertyTag propertyTag) { return IsFixProperty(propertyTag.PropType); }