示例#1
0
文件: Topic.cs 项目: yongwuhou/NCache
        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;
                }
            }
        }
示例#2
0
 public MessageItem(MessageItemType type, string message, Document doc, int line, int col)
 {
     Type     = type;
     Message  = message;
     Document = doc;
     Line     = line;
     Column   = col;
 }
示例#3
0
 public MessageItem(MessageItemType type, string message, Document doc, int line, int col)
 {
     Type = type;
     Message = message;
     Document = doc;
     Line = line;
     Column = col;
 }
示例#4
0
 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;
     }
 }
示例#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;
            }
        }
示例#6
0
 public MessageItem(MessageBody body, MessageItemType type, string text)
 {
     this.body = body;
     this.type = type;
     this.Text = text;
 }
示例#7
0
 private Image GetImage(MessageItemType type)
 {
     return(type == MessageItemType.Error ? Bitmaps.Load("Error") :
            type == MessageItemType.Warning ? Bitmaps.Load("Warning") :
            Bitmaps.Load("Message"));
 }
示例#8
0
 private Image GetImage(MessageItemType type)
 {
     return type == MessageItemType.Error ? Bitmaps.Load("Error") :
         type == MessageItemType.Warning ? Bitmaps.Load("Warning") :
         Bitmaps.Load("Message");
 }