Пример #1
0
        private dynamic AddFields(OneMail oneMail, List <String> fields, dynamic tmp)
        {
            if (fields.Count == 0)
            {
                fields.Add("subject");
            }

            var p = tmp as IDictionary <String, object>;

            foreach (var field in fields)
            {
                p[field] = oneMail.Get(field);
            }
            return(tmp);
        }
Пример #2
0
        //メールの取得
        List <OneMail> GetMailList(List <string> owner, int limit)
        {
            var ar = new List <OneMail>();

            //各ユーザのメール取得
            //Ver5.9.8
            if (_mailBox != null)
            {
                foreach (var user in _mailBox.UserList)
                {
                    if (owner.Count == 0 || owner.IndexOf(user) != -1)
                    {
                        var folder = string.Format("{0}\\{1}", _mailBox.Dir, user);
                        var files  = Directory.GetFiles(folder, "DF_*");
                        foreach (var fileName in files)
                        {
                            if (limit == 0 || ar.Count < limit)
                            {
                                var oneMail = new OneMail(user, fileName);
                                ar.Add(oneMail);
                            }
                        }
                    }
                }
            }
            //メールキューのメール取得
            //Ver5.9.8
            if (_mailQueue != null)
            {
                if (owner.Count == 0 || owner.IndexOf("mqueue") != -1)
                {
                    var files = Directory.GetFiles(_mailQueue, "DF_*");
                    foreach (var fileName in files)
                    {
                        if (limit == 0 || ar.Count < limit)
                        {
                            var oneMail = new OneMail("mailQueue", fileName);
                            ar.Add(oneMail);
                        }
                    }
                }
            }
            //時刻デーソート

            ar.Sort((a, b) => ((string)a.Get("date")).CompareTo(((string)b.Get("date"))));
            return(ar);
        }
Пример #3
0
        //メールの取得
        List<OneMail> GetMailList(List<string> owner,int limit)
        {
            var ar = new List<OneMail>();
            //各ユーザのメール取得
            //Ver5.9.8
            if (_mailBox != null){
                foreach (var user in _mailBox.UserList){
                    if (owner.Count == 0 || owner.IndexOf(user) != -1){
                        var folder = string.Format("{0}\\{1}", _mailBox.Dir, user);
                        var files = Directory.GetFiles(folder, "DF_*");
                        foreach (var fileName in files){
                            if (limit == 0 || ar.Count < limit){
                                var oneMail = new OneMail(user, fileName);
                                ar.Add(oneMail);
                            }
                        }
                    }
                }
            }
            //メールキューのメール取得
            //Ver5.9.8
            if(_mailQueue!=null){
                if (owner.Count==0 || owner.IndexOf("mqueue")!=-1){
                    var files = Directory.GetFiles(_mailQueue, "DF_*");
                    foreach (var fileName in files){
                        if (limit == 0 || ar.Count < limit){
                            var oneMail = new OneMail("mailQueue", fileName);
                            ar.Add(oneMail);
                        }
                    }
                }
            }
            //時刻デーソート

            ar.Sort((a, b) => ((string)a.Get("date")).CompareTo(((string)b.Get("date"))));
            return ar;
        }
Пример #4
0
        private dynamic AddFields(OneMail oneMail, List<String> fields, dynamic tmp)
        {
            if (fields.Count == 0){
                fields.Add("subject");
            }

            var p = tmp as IDictionary<String, object>;
            foreach (var field in fields){
                p[field] = oneMail.Get(field);
            }
            return tmp;
        }