Exemple #1
0
        public static MailDestination Decode(G2Header root)
        {
            MailDestination dest  = new MailDestination();
            G2Header        child = new G2Header(root.Data);

            while (G2Protocol.ReadNextChild(root, child) == G2ReadResult.PACKET_GOOD)
            {
                if (!G2Protocol.ReadPayload(child))
                {
                    continue;
                }

                switch (child.Name)
                {
                case Packet_Key:
                    dest.Key   = Utilities.ExtractBytes(child.Data, child.PayloadPos, child.PayloadSize);
                    dest.KeyID = Utilities.KeytoID(dest.Key);
                    break;

                case Packet_CC:
                    dest.CC = BitConverter.ToBoolean(child.Data, child.PayloadPos);
                    break;
                }
            }

            return(dest);
        }
Exemple #2
0
        public static MailDestination Decode(G2Header root)
        {
            MailDestination dest = new MailDestination();
            G2Header child = new G2Header(root.Data);

            while (G2Protocol.ReadNextChild(root, child) == G2ReadResult.PACKET_GOOD)
            {
                if (!G2Protocol.ReadPayload(child))
                    continue;

                switch (child.Name)
                {
                    case Packet_Key:
                        dest.Key = Utilities.ExtractBytes(child.Data, child.PayloadPos, child.PayloadSize);
                        dest.KeyID = Utilities.KeytoID(dest.Key);
                        break;

                    case Packet_CC:
                        dest.CC = BitConverter.ToBoolean(child.Data, child.PayloadPos);
                        break;
                }
            }

            return dest;
        }