コード例 #1
0
        public static bool IsDeliveryFolderInfoBytesDenoteInbox(byte[] deliveryFolderInfoBytes)
        {
            bool result = false;

            if (deliveryFolderInfoBytes != null)
            {
                OriginalDeliveryFolderInfo originalDeliveryFolderInfo = OriginalDeliveryFolderInfo.Deserialize(deliveryFolderInfoBytes);
                if (originalDeliveryFolderInfo != null && originalDeliveryFolderInfo.IsDeliveryFolderInbox)
                {
                    result = true;
                }
            }
            return(result);
        }
コード例 #2
0
        public static OriginalDeliveryFolderInfo Deserialize(byte[] folderInfoBytes)
        {
            ArgumentValidator.ThrowIfNull("folderInfoBytes", folderInfoBytes);
            OriginalDeliveryFolderInfo result = null;

            if (folderInfoBytes.Length == 9)
            {
                using (MemoryStream memoryStream = new MemoryStream(folderInfoBytes, false))
                {
                    BinaryReader binaryReader = new BinaryReader(memoryStream);
                    short        num          = binaryReader.ReadInt16();
                    if (num > 1)
                    {
                        return(null);
                    }
                    binaryReader.ReadInt16();
                    byte b    = binaryReader.ReadByte();
                    int  num2 = binaryReader.ReadInt32();
                    result = new OriginalDeliveryFolderInfo((OriginalDeliveryFolderInfo.DeliveryFolderType)b, num2);
                }
                return(result);
            }
            return(result);
        }