Ejemplo n.º 1
0
        public void LogMessageHandler(object _, LogMessage logMessage)
        {
            string module = logMessage.LogModule;

            _messages.Add(logMessage);
            if (!_categoryDic.ContainsKey(module))
            {
                var config = new CategoryConfiguration(true, LogLevel.Debug, module);
                try
                {
                    _categoryDic.Add(module, config);
                }
                catch { }
            }
            try
            {
                Invoke((MethodInvoker) delegate
                {
                    var cat = _categoryDic[logMessage.LogModule];
                    if (IsVisible(logMessage))
                    {
                        MaybeAddTimeSkip(logMessage.Date);
                        this.AppendLogMessage(logMessage, cat.Color);
                    }
                });
            }
            catch { }
        }
Ejemplo n.º 2
0
        private void Category_SelectedIndexChanged(object sender, EventArgs e)
        {
            int index = list_category.SelectedIndex;

            if (index != -1)
            {
                var category = _categoryDic.Values.ToArray()[index];
                _category             = category;
                cb_level.SelectedItem = category.MinLevel.ToString();
                cb_show.Checked       = category.Show;
            }
        }