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); }
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); } }
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); } } }
// For designer support. public virtual void HandleMessage(LogMessage message) { throw new NotImplementedException(); }