示例#1
0
            public NntpMessage(Account account, Hashtable data, string workfile)
                : base(account, data, workfile)
            {
                foreach (string key in data.Keys)
                {
                    if (key == "id")
                    {
                        SetObject(key, data [key]);
                    }
                    else if (key == "subject")
                    {
                        SetObject(key, Utils.HeaderDecodeText((string)data [key]));
                    }
                    else if (key == "sender")
                    {
                        SetObject(key, Utils.HeaderDecodePhrase((string)data [key]));
                    }
                    else if (key == "date")
                    {
                        SetObject(key, Thunderbird.HexDateToString((string)data [key]));
                    }
                    else if (key == "size")
                    {
                        SetObject(key, Thunderbird.Hex2Dec((string)data [key]));
                    }
                }

                Uri = NewUri(account, ConstructMailboxString(workfile, account), GetString("id"));
            }
示例#2
0
            public Mail(Account account, Hashtable data, string workfile)
            {
                foreach (string key in data.Keys)
                {
                    if (key == "id")
                    {
                        SetObject(key, data [key]);
                    }
                    else if (key == "sender")
                    {
                        SetObject(key, Utils.HeaderDecodePhrase((string)data [key]));
                    }
                    else if (key == "subject")
                    {
                        SetObject(key, Utils.HeaderDecodeText((string)data [key]));
                    }
                    else if (key == "recipients")
                    {
                        SetObject(key, Utils.HeaderDecodePhrase((string)data [key]));
                    }
                    else if (key == "date")
                    {
                        SetObject(key, Thunderbird.HexDateToString((string)data [key]));
                    }
                    else if (key == "size")
                    {
                        SetObject(key, Thunderbird.Hex2Dec((string)data [key]));
                    }
                    else if (key == "msgOffset")
                    {
                        SetObject(key, Thunderbird.Hex2Dec((string)data[key]));
                    }
                    else if (key == "offlineMsgSize")
                    {
                        SetObject(key, Thunderbird.Hex2Dec((string)data [key]));
                    }
                    else if (key == "message-id")
                    {
                        SetObject(key, (string)data [key]);
                    }
                    else if (key == "references")
                    {
                        SetObject(key, (data [key] as string).Replace("\\", ""));
                    }
                }

                this.account  = account;
                this.workfile = workfile;
                SetObject("mailbox", Thunderbird.ConstructMailboxString(workfile, account));
                this.uri = Thunderbird.NewUri(Account, GetString("mailbox"), GetString("id"));
            }