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); }
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"))); } }