Пример #1
0
 private void OnDeserializing(StreamingContext c)
 {
     base.Uid               = "0";
     this._flags            = new MessageFlagCollection();
     this._partToIndex      = new Dictionary <IPart, string>();
     this._indexToPart      = new Dictionary <string, IPart>();
     this._attachmentToPart = new Dictionary <Attachment, IPart>();
 }
Пример #2
0
 public ImapMessage()
 {
     base.Uid               = "0";
     this._flags            = new MessageFlagCollection();
     this._partToIndex      = new Dictionary <IPart, string>();
     this._indexToPart      = new Dictionary <string, IPart>();
     this._attachmentToPart = new Dictionary <Attachment, IPart>();
 }
Пример #3
0
 internal Message(ImapClient client, Folder folder)
     : this()
 {
     Flags = new MessageFlagCollection(client, this);
     Labels = new GMailMessageLabelCollection(client, this);
     _client = client;
     Folder = folder;
 }
Пример #4
0
        internal Message(ImapClient client, Folder folder)
            : this()
        {
            Flags  = new MessageFlagCollection(client, this);
            Labels = new GMailMessageLabelCollection(client, this);

            _client = client;
            Folder  = folder;
        }
Пример #5
0
        public MessageFlagCollection ParseMessageFlagCollection(byte[] source)
        {
            MessageFlagCollection flags = new MessageFlagCollection();
            Regex  regex = new Regex(@"\\([^\s]+)");
            string input = this.DefaultEncoding.GetString(source, 0, source.Length);

            foreach (Match match in regex.Matches(input))
            {
                flags.Add(new MessageFlag(match.Groups[1].Value));
            }
            return(flags);
        }
Пример #6
0
        public MessageFlagCollection ParseFlags(string flags)
        {
            MessageFlagCollection messageFlagCollection = new MessageFlagCollection();

            if (!string.IsNullOrEmpty(flags) && flags.Contains(@"\"))
            {
                string[] flagNames = flags.Split(new char[] { '\\', ' ' }, StringSplitOptions.RemoveEmptyEntries);
                foreach (string flag in flagNames)
                {
                    messageFlagCollection.Add(new MessageFlag(flag));
                }
            }
            return(messageFlagCollection);
        }
Пример #7
0
        private void ProcessOKPermanentFlags(string flags)
        {
            Regex  regex = new Regex(@"\((?<flags>[^\)]*)\)");
            string str   = regex.Match(flags).Groups["flags"].Value;

            this._permanentFlags         = new MessageFlagCollection();
            this._permanentFlagsRecieved = true;
            if (str != "")
            {
                string[] strArray = str.Split(new char[] { ' ' });
                for (int i = 0; i < strArray.Length; i++)
                {
                    if (strArray[i][0] == '\\')
                    {
                        this._permanentFlags.Add(new MessageFlag(strArray[i].Substring(1)));
                    }
                }
            }
        }
Пример #8
0
 public UIDSTORECommand(ISequence sequence, MessageFlagCollection flags, EFlagMode mode)
 {
     this._sequence = sequence;
     this._mode     = mode;
     this._flags    = flags;
 }
Пример #9
0
 private string decodeCollection(MessageFlagCollection a)
 {
     string b = "";
     for (int i = 0; i < a.Count; i++)
     {
         b += a[i].ToString();
         b += "; ";
     }
     return b;
 }