Exemple #1
0
        private void GetMessagePayLoad(MessageItem messageItem)
        {
            if (messageItem != null && messageItem.Payload != null)
            {
                MessageItemType type = GetMessageItemType(messageItem);

                switch (type)
                {
                case MessageItemType.MessageItems:
                    GetMessageItemPayLoad(messageItem);
                    break;

                case MessageItemType.MessageEventItem:
                    messageItem.Payload = GetMessageEventItemPayLoad((MessageEventItem)messageItem.Payload);
                    break;

                case MessageItemType.MessageEventItems:
                    MessageEventItem[] items = (MessageEventItem[])messageItem.Payload;

                    if (items != null)
                    {
                        MessageEventItem[] payLoads = new MessageEventItem[items.Length];

                        for (int count = 0; count < items.Length; count++)
                        {
                            payLoads[count] = GetMessageEventItemPayLoad(items[count]);
                        }
                        messageItem.Payload = payLoads;
                    }
                    break;
                }
            }
        }
Exemple #2
0
 public MessageItem(MessageItemType type, string message, Document doc, int line, int col)
 {
     Type     = type;
     Message  = message;
     Document = doc;
     Line     = line;
     Column   = col;
 }
Exemple #3
0
 public MessageItem(MessageItemType type, string message, Document doc, int line, int col)
 {
     Type = type;
     Message = message;
     Document = doc;
     Line = line;
     Column = col;
 }
 public MessageView(MessageItemType type)
 {
     InitializeComponent();
     Type = type;
     if (type == MessageItemType.Course)
     {
         chItem.HeaderText = "課程";
         lblTempCount.Text = "" + K12.Presentation.NLDPanels.Course.TempSource.Count;
     }
     else
     {
         chItem.HeaderText = "學生";
         lblTempCount.Text = "" + K12.Presentation.NLDPanels.Student.TempSource.Count;
     }
 }
Exemple #5
0
        /// <summary>
        /// Handles what to do when a selective event message is received
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        internal void OnSelectiveEventMessageReceived(object sender, MessageEventArgs args)
        {
            MessageItemType type = GetMessageItemType(args);

            switch (type)
            {
            case MessageItemType.MessageEventItem:
                OnSelectiveEventsMessageRecieved((MessageEventItem)args.Message.Payload);
                break;

            case MessageItemType.MessageEventItems:
                MessageEventItem[] messages = args.Message.Payload as MessageEventItem[];
                if (messages != null)
                {
                    foreach (MessageEventItem item in messages)
                    {
                        OnSelectiveEventsMessageRecieved(item);
                    }
                }
                break;
            }
        }
Exemple #6
0
 public MessageItem(MessageBody body, MessageItemType type, string text)
 {
     this.body = body;
     this.type = type;
     this.Text = text;
 }
Exemple #7
0
 private Image GetImage(MessageItemType type)
 {
     return(type == MessageItemType.Error ? Bitmaps.Load("Error") :
            type == MessageItemType.Warning ? Bitmaps.Load("Warning") :
            Bitmaps.Load("Message"));
 }
Exemple #8
0
 private Image GetImage(MessageItemType type)
 {
     return type == MessageItemType.Error ? Bitmaps.Load("Error") :
         type == MessageItemType.Warning ? Bitmaps.Load("Warning") :
         Bitmaps.Load("Message");
 }