Exemple #1
0
        public MessageHeader(int uid, Folder f)
        {
            if (uid < 0)
            {
                throw new System.ArgumentException("Invalid UID Value", "uid");
            }

            folder_ = f;
            Uid     = uid;
            id      = uid; // Set this as a default, but the server might update it.

            flags_ = new BehaviorSubject <MessageFlags>(MessageFlags.None);

            UnRead  = flags_.Select((flags) => flags.HasFlag(MessageFlags.Seen) == false);
            Deleted = flags_.Select((flags) => flags.HasFlag(MessageFlags.Deleted));
            Flagged = flags_.Select((flags) => flags.HasFlag(MessageFlags.Flagged));

            UnRead.Subscribe(val => IsUnRead   = val);
            Deleted.Subscribe(val => IsDeleted = val);

            attachments_ = new List <BodyPart>();
            related_     = new List <BodyPart>();

            To = new MailAddressCollection();
            Cc = new MailAddressCollection();

            // Build the BodyPart required to pull the whole message.
            FullMessage            = new BodyPart(this, "text/plain");
            FullMessage.PartNumber = "";
        }