public VarPropValue(PropertyTag propertyTag) : base() { PropTag = propertyTag; _varPropType = FTFactory.Instance.CreateVarPropType(); _propInfo = FTFactory.Instance.CreatePropInfo(propertyTag); _length = FTFactory.Instance.CreatePropValueLength(); _varSizeValue = FTFactory.Instance.CreateVarSizeValue(_varPropType, _length, propertyTag.PropType); Children.Add(_varPropType); Children.Add(_propInfo); Children.Add(_length); Children.Add(_varSizeValue); }
public MvPropValue(PropertyTag propertyTag) : base() { PropTag = propertyTag; _mvPropType = FTFactory.Instance.CreateMvPropType(); _propInfo = FTFactory.Instance.CreatePropInfo(propertyTag); _length = FTFactory.Instance.CreatePropValueLength(); _SizeValue = FTFactory.Instance.CreateSizeValue(propertyTag, _length); Children.Add(_mvPropType); Children.Add(_propInfo); Children.Add(_length); Children.Add(_SizeValue); }
internal IVarSizeValue CreateVarSizeValue(VarPropType propType, PropValueLength propValueLength, UInt16 varPropTypeIntValue) { switch (varPropTypeIntValue) { case (UInt16)PropertyType.PT_BINARY: return new VarBinaryValue(propType, propValueLength); case (UInt16)PropertyType.PT_SERVERID: return new VarServerIdValue(propType, propValueLength); case (UInt16)PropertyType.PT_STRING8: return new VarString8Value(propType, propValueLength); case (UInt16)PropertyType.PT_OBJECT: return new VarObjectValue(propType, propValueLength); default: if ((varPropTypeIntValue & 0x8000) == 0x8000) { return new VarStringValue(propType, propValueLength); } throw new ArgumentException(string.Format("Vartype data {0} is wrong.", propType.Data.ToString("X4"))); } }
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"))); } }