/// <summary>
 /// Parse the PtypMultipleTime structure.
 /// </summary>
 /// <param name="s">A stream containing the PtypMultipleTime structure</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     HelpMethod help = new HelpMethod();
     this.Count = help.ReadCount(this.countWide, s);
     List<PtypTime> tempvalue = new List<PtypTime>();
     for (int i = 0; i < this.Count.GetHashCode(); )
     {
         PtypTime time = new PtypTime();
         time.Parse(s);
         tempvalue.Add(time);
         i = i + sizeof(Int64);
     }
     this.Value = tempvalue.ToArray();
 }
 /// <summary>
 /// Parse the PROP_VAL_UNION payload of session.
 /// </summary>
 /// <param name="s">The stream to parse</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     switch (this.tag)
     {
         case 0x00000002:
             this.i = ReadINT16();
             break;
         case 0x00000003:
             this.l = ReadINT32();
             break;
         case 0x0000000B:
             this.b = ReadUshort();
             break;
         case 0x0000001E:
             this.lpszA = new String_r();
             this.lpszA.Parse(s);
             break;
         case 0x00000102:
             this.bin = new Binary_r();
             this.bin.Parse(s);
             break;
         case 0x0000001F:
             this.lpszW = new WString_r();
             this.lpszW.Parse(s);
             break;
         case 0x00000048:
             this.lpguid = new FlatUID_r();
             this.lpguid.Parse(s);
             break;
         case 0x00000040:
             this.ft = new PtypTime();
             this.ft.Parse(s);
             break;
         case 0x0000000A:
             this.err = ReadINT32();
             break;
         case 0x00001002:
             this.MVi = new ShortArray_r();
             this.MVi.Parse(s);
             break;
         case 0x00001003:
             this.MVl = new LongArray_r();
             this.MVl.Parse(s);
             break;
         case 0x0000101E:
             this.MVszA = new StringArray_r();
             this.MVszA.Parse(s);
             break;
         case 0x00001102:
             this.MVbin = new BinaryArray_r();
             this.MVbin.Parse(s);
             break;
         case 0x00001048:
             this.MVguid = new FlatUIDArray_r();
             this.MVguid.Parse(s);
             break;
         case 0x0000101F:
             this.MVszW = new WStringArray_r();
             this.MVszW.Parse(s);
             break;
         case 0x00001040:
             this.MVft = new DateTimeArray_r();
             this.MVft.Parse(s);
             break;
         case 0x00000001:
         case 0x0000000D:
             this.lReserved = ReadINT32();
             break;
         default:
             break;
     }
 }
        /// <summary>
        /// The method to return the object of PropertyValue.
        /// </summary>
        /// <param name="dataType">The Property data type.</param>
        /// <param name="s">A stream containing the PropertyValue structure</param>
        /// <param name="ptypMultiCountSize">The Count wide size of ptypMutiple type.</param>
        /// <returns>The object of PropertyValue.</returns>
        public object ReadPropertyValue(PropertyDataType dataType, Stream s, CountWideEnum ptypMultiCountSize = CountWideEnum.twoBytes)
        {
            base.Parse(s);
            object propertyValue;
            switch (dataType)
            {
                case PropertyDataType.PtypInteger16:
                    {
                        PtypInteger16 tempPropertyValue = new PtypInteger16();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypInteger32:
                    {
                        PtypInteger32 tempPropertyValue = new PtypInteger32();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypFloating32:
                    {
                        PtypFloating32 tempPropertyValue = new PtypFloating32();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypFloating64:
                    {
                        PtypFloating64 tempPropertyValue = new PtypFloating64();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypCurrency:
                    {
                        PtypCurrency tempPropertyValue = new PtypCurrency();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypFloatingTime:
                    {
                        PtypFloatingTime tempPropertyValue = new PtypFloatingTime();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypErrorCode:
                    {
                        PtypErrorCode tempPropertyValue = new PtypErrorCode();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypBoolean:
                    {
                        PtypBoolean tempPropertyValue = new PtypBoolean();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypInteger64:
                    {
                        PtypInteger64 tempPropertyValue = new PtypInteger64();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypString:
                    {
                        PtypString tempPropertyValue = new PtypString();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypString8:
                    {
                        PtypString8 tempPropertyValue = new PtypString8();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypTime:
                    {
                        PtypTime tempPropertyValue = new PtypTime();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypGuid:
                    {
                        PtypGuid tempPropertyValue = new PtypGuid();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypServerId:
                    {
                        PtypServerId tempPropertyValue = new PtypServerId();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypRestriction:
                    {
                        PtypRestriction tempPropertyValue = new PtypRestriction();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypRuleAction:
                    {
                        PtypRuleAction tempPropertyValue = new PtypRuleAction();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypUnspecified:
                    {
                        PtypUnspecified tempPropertyValue = new PtypUnspecified();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypNull:
                    {
                        PtypNull tempPropertyValue = new PtypNull();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypBinary:
                    {
                        PtypBinary tempPropertyValue = new PtypBinary(ptypMultiCountSize);
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypMultipleInteger16:
                    {
                        PtypMultipleInteger16 tempPropertyValue = new PtypMultipleInteger16(ptypMultiCountSize);
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypMultipleInteger32:
                    {
                        PtypMultipleInteger32 tempPropertyValue = new PtypMultipleInteger32(ptypMultiCountSize);
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypMultipleFloating32:
                    {
                        PtypMultipleFloating32 tempPropertyValue = new PtypMultipleFloating32(ptypMultiCountSize);
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypMultipleFloating64:
                    {
                        PtypMultipleFloating64 tempPropertyValue = new PtypMultipleFloating64(ptypMultiCountSize);
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypMultipleCurrency:
                    {
                        PtypMultipleCurrency tempPropertyValue = new PtypMultipleCurrency(ptypMultiCountSize);
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypMultipleFloatingTime:
                    {
                        PtypMultipleFloatingTime tempPropertyValue = new PtypMultipleFloatingTime(ptypMultiCountSize);
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypMultipleInteger64:
                    {
                        PtypMultipleInteger64 tempPropertyValue = new PtypMultipleInteger64(ptypMultiCountSize);
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypMultipleString:
                    {
                        PtypMultipleString tempPropertyValue = new PtypMultipleString(ptypMultiCountSize);
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypMultipleString8:
                    {
                        PtypMultipleString8 tempPropertyValue = new PtypMultipleString8(ptypMultiCountSize);
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypMultipleTime:
                    {
                        PtypMultipleTime tempPropertyValue = new PtypMultipleTime(ptypMultiCountSize);
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypMultipleGuid:
                    {
                        PtypMultipleGuid tempPropertyValue = new PtypMultipleGuid(ptypMultiCountSize);
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypMultipleBinary:
                    {
                        PtypMultipleBinary tempPropertyValue = new PtypMultipleBinary(ptypMultiCountSize);
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;
                    }
                case PropertyDataType.PtypObject_Or_PtypEmbeddedTable:
                    {
                        PtypObject_Or_PtypEmbeddedTable tempPropertyValue = new PtypObject_Or_PtypEmbeddedTable();
                        tempPropertyValue.Parse(s);
                        propertyValue = tempPropertyValue;
                        break;

                    }
                default:
                    propertyValue = null;
                    break;
            }
            return propertyValue;
        }
 /// <summary>
 /// Parse the DateTimeArray_r payload of session.
 /// </summary>
 /// <param name="s">The stream to parse</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.cValues = ReadUint();
     List<PtypTime> temBytes = new List<PtypTime>();
     for (ulong i = 0; i < this.cValues; i++)
     {
         PtypTime pt = new PtypTime();
         pt.Parse(s);
         temBytes.Add(pt);
     }
     this.lpft = temBytes.ToArray();
 }