Exemplo n.º 1
0
 //Called for every incoming email(or unreaded one)
 private void OnEmailMessageEvent(IMAPIMessageID newMessageID, IMAPIMessageID oldMessageID, EEventMask messageFlags)
 {
     try
     {
         IMAPIMessage msg = newMessageID.OpenMessage();
         msg.PopulateProperties(EMessageProperties.Body | EMessageProperties.DeliveryTime | EMessageProperties.Sender | EMessageProperties.Subject);
         if ((msg.Flags & EMessageFlags.MSGFLAG_READ) == 0)
         {
             CheckMessage(msg.Body, msg.Sender.FullAddress, msg.LocalDeliveryTime);
         }
     }
     catch (Exception exc)
     {
     }
 }
Exemplo n.º 2
0
        public SmsBox(IMAPIMessage msg)
        {
            msg.PopulateProperties(EMessageProperties.DeliveryTime | EMessageProperties.Sender |
                                   EMessageProperties.Subject);
            IMAPIContact sender = msg.Sender;
            DateTime delivery = msg.LocalDeliveryTime;

            // Subject:
            AddElement(
                new TextElement(msg.Subject)
                {
                    Size = new Size(450, 50),
                    AutoSizeMode = TextElement.AutoSizeModeOptions.WrapText,
                    Style = new TextStyle(MetroTheme.PhoneFontFamilyNormal, 10, Color.White),
                }
                );

            var add = "";
            // Delivery Date:
            if (delivery != null)
            {
                add += delivery.ToString(" d/MM/yy H:mm   ");
            }

            // Sender:
            if (sender != null)
            {
                add += sender.FullAddress;
            }

            if (( (uint)msg.Status & (uint)EMessageStatus.MSGSTATUS_RECTYPE_SMTP) == 0)
                add += " (SMS) ";

            add += " " + msg.Flags.ToString() + " " + msg.Status.ToString();

            if (! string.IsNullOrEmpty(add))
                AddElement( new TextElement(add)
                    {
                        Size = new Size(450, 30),
                        Style = new TextStyle(MetroTheme.PhoneFontFamilyLight, 7, Color.LightSteelBlue),
                    }
                );

            // Recipients:
            /*
            IMAPIContact[] recipients = msg.Recipients;
            if (recipients.Length > 0)
            {
                TreeNode recipNode = new TreeNode("Recipients");
                foreach (IMAPIContact recipient in recipients)
                {
                    n = new TreeNode(recipient.Name + " (" + recipient.FullAddress + ')');
                    n.Tag = recipient;
                    recipNode.Nodes.Add(n);
                }
                node.Nodes.Add(recipNode);
            }
            nodes[i] = node;
            */

            AddElement( new Canvas() { Size = new Size(10, 10), } );
        }