public ComplexMessageViewer(ComplexMessage message)
        {
            InitializeComponent();
            this.Text = message.subject;
            string html = "<!DOCTYPE html><html>Subject: " + message.subject + "<hr><br>From: " + message.from + "<br>To: " + message.to + "<hr><br>" + message.body + "</html>";

            HTMLDisplay.DocumentText = html;
            this.ShowDialog();
        }
Ejemplo n.º 2
0
 private void OKButton_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(Subject.Text))
     {
         Subject.Text = "No Subject";
     }
     if (string.IsNullOrEmpty(Body.Text))
     {
         MessageBox.Show("The message body is empty. That isn't allowed", "Zoom Messenger", MessageBoxButtons.OK, MessageBoxIcon.Stop);
         return;
     }
     output   = new ComplexMessage(FromInput.Text, ToInput.Text, Subject.Text, Body.Text);
     canceled = false;
     this.Close();
 }
Ejemplo n.º 3
0
 public void RefreshMessageQueue()
 {
     if (!string.IsNullOrEmpty(currenttalk))
     {
         MessageQueue.Items.Clear();
         string[] messages = messenger.getMessages(currenttalk);
         foreach (string message in messages)
         {
             if (message.Contains("‰"))
             {
                 try
                 {
                     ComplexMessage cm = ComplexMessage.ParseDataString(message);
                     if (cm.to == name || cm.from == name)
                     {
                         MessageQueue.Items.Add("↓↓↓To read this complex message below, use the read complex message button↓↓↓");
                         MessageQueue.Items.Add(message);
                     }
                 }
                 catch
                 {
                 }
             }
             else if (message.Contains("startapp>"))
             {
                 MessageQueue.Items.Add("↓↓↓Click the message below to start it↓↓↓");
                 MessageQueue.Items.Add(message);
             }
             else
             {
                 MessageQueue.Items.Add(message);
             }
         }
         MessageQueue.TopIndex = MessageQueue.Items.Count - 1;
         if (this.messages != null)
         {
             if (this.messages != messages)
             {
                 RefreshTimer.Enabled = false;
                 MessageBox.Show("Changes to the talk have been made.", "Zoom Messenger", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 RefreshTimer.Enabled = true;
             }
         }
         this.messages = messages;
     }
 }
Ejemplo n.º 4
0
 private void ReadComplexMessageButton_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(MessageInput.Text))
     {
         RefreshTimer.Enabled = false;
         string temp = MessageInput.Text;
         try
         {
             ComplexMessage       message = ComplexMessage.ParseDataString(temp);
             ComplexMessageViewer viewer  = new ComplexMessageViewer(message);
         }
         catch
         {
             MessageBox.Show("That's not a complex message.", "Zoom Messenger", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         MessageQueue.SelectedItem = null;
         RefreshTimer.Enabled      = true;
     }
 }