示例#1
0
		public override void HandleMessage(LogMessage message) {
			if (InvokeRequired) {
				this.BeginInvoke(new Handler(HandleMessage), message);
				return;
			}
			if (message.Name == "MM_Alloc") {
				HeapUsage += UInt32.Parse(message["Length"].Substring(2), NumberStyles.HexNumber);
				return;
			}
			if (message.Name == "MM_Init") {
				lblAvailValue.Text = GetValueString(UInt32.Parse(message["Length"].Substring(2), NumberStyles.HexNumber));
				return;
			}
		}
        public override void HandleMessage(LogMessage message)
        {
            if (InvokeRequired)
            {
                this.BeginInvoke(new Handler(HandleMessage), message);
                return;
            }

            // We only handle these.
            if (message.Name != "Warning" && message.Name != "Error" && message.Name != "Message")
                return;

            // Create the item.
            ListViewItem item = new ListViewItem(new string[] { message["Module"], message["String"] });
            item.ImageKey = message.Name.ToLowerInvariant();

            // Add it.
            listView.Items.Add(item);
        }
示例#3
0
        public override void HandleMessage(LogMessage message)
        {
            if (InvokeRequired)
            {
                this.BeginInvoke(new Handler(HandleMessage), message);
                return;
            }

            if (message.Name == "TestCase_Started")
            {
                _currentGroup = new ListViewGroup(message["Name"]);
                listView.Groups.Add(_currentGroup);
            }
            else if (message.Name == "TestCase")
            {
                ListViewItem item = new ListViewItem(message["Message"]);
                item.ImageKey = message["Success"];
                item.Group = _currentGroup;
                listView.Items.Add(item);
            }
        }
示例#4
0
        void _watcher_Changed(object sender, FileSystemEventArgs e)
        {
            if (_watching)
            {
                XmlReader _reader = CreateXmlReader();
                bool reading = true;
                while (reading)
                {
                    try
                    {
                        reading = true;
                        reading = _reader.Read();
                    }
                    catch { }

                    LogMessage message = new LogMessage(_reader.Name);
                    for (int i = 0; i < _reader.AttributeCount; i++)
                    {
                        _reader.MoveToAttribute(i);
                        message.AddAttribute(_reader.Name, _reader.Value);
                    }
                    foreach (LogHandler handler in this._handlers)
                        handler.HandleMessage(message);
                }
            }
        }
示例#5
0
 // For designer support.
 public virtual void HandleMessage(LogMessage message)
 {
     throw new NotImplementedException();
 }