コード例 #1
0
 public bool TryAdd(VgcApis.Models.Datas.LuaMail mail)
 {
     try
     {
         return(mails.TryAdd(mail));
     }
     catch (System.ObjectDisposedException) { }
     catch (System.InvalidOperationException) { }
     return(false);
 }
コード例 #2
0
        public bool Send(string address, double code, string title, bool state, string content)
        {
            var mail = new VgcApis.Models.Datas.LuaMail
            {
                from    = myAddress,
                title   = title,
                content = content,
                code    = code,
                state   = state,
            };

            return(postOffice.Send(address, mail));
        }
コード例 #3
0
        public bool Send(string address, VgcApis.Models.Datas.LuaMail mail)
        {
            if (string.IsNullOrEmpty(address) || mail == null)
            {
                return(false);
            }

            if (!mailboxes.TryGetValue(address, out var mailbox))
            {
                return(false);
            }
            return(mailbox.TryAdd(mail));
        }