Example #1
0
 private VarPropType_PropInfo_Length_VarSizeValue(IVarPropType varPropType)
 {
     VarPropType = varPropType;
 }
Example #2
0
        internal static IVarSizeValue CreateVarSizeValue(IVarPropType VarPropType, ILength Length, byte[] buffer, ref int pos)
        {
            var int16Value = (VarPropType as PtypInteger16).Value;
            CreateVarPropValue createFunc = null;
            if (CreateVarPropValueDic.TryGetValue(int16Value, out createFunc))
            {
                IVarSizeValue varValueObj = createFunc();
                varValueObj.ParseValue(buffer, ref pos, (Length as PTypInteger32).Value);
                return varValueObj;
            }
            else if ((int16Value & 0x8000) == 0x8000)
            {
                IVarSizeValue varValueObj = PTypStrWithCodePage.CreateVarPropValue(VarPropType);
                varValueObj.ParseValue(buffer, ref pos, (Length as PTypInteger32).Value);
                return varValueObj;
            }

            throw new ArgumentException(string.Format("fixedPropType [{0}] is invalid.", int16Value.ToString("X4")));
        }