示例#1
0
        private void toolStripComboBoxView_SelectedIndexChanged(object sender, EventArgs e)
        {
            ExtendedLogViewerTag s = (ExtendedLogViewerTag)toolStripComboBoxView.SelectedItem;

            this.mMutex.WaitOne();
            foreach (SourceGrid.Grid.GridRow row in this.logGrid.Rows)
            {
                if (row.Tag != null)
                {
                    ExtendedLogViewerTag t = (ExtendedLogViewerTag)row.Tag;
                    row.Visible = (s.ID.Equals("0") || s.ID.Equals(t.ID));
                }
            }
            this.mMutex.ReleaseMutex();
        }
示例#2
0
 public int CompareTo(object obj)
 {
     if (obj is ExtendedLogViewerTag)
     {
         ExtendedLogViewerTag t = (ExtendedLogViewerTag)obj;
         if (t.ID.Equals("0"))
         {
             return(1);
         }
         if (this.ID.Equals("0"))
         {
             return(-1);
         }
     }
     return(this.ToString().CompareTo(obj.ToString()));
 }
示例#3
0
        private void UpdateUIAdd(ExtendedLogViewerItem item)
        {
            int pos = this.logGrid.RowsCount;

            this.logGrid.RowsCount++;

            this.logGrid[pos, 0] = new SourceGrid.Cells.Cell(pos);
            this.FillRowMark(item.LogLevel, pos);
            this.logGrid[pos, 2] = new SourceGrid.Cells.Cell(item.TimeStamp.ToString());
            this.logGrid[pos, 3] = new SourceGrid.Cells.Cell(item.Name);

            this.logGrid[pos, 4] = new SourceGrid.Cells.Cell(item.Message);
            this.logGrid[pos, 4].View.WordWrap = true;

            ExtendedLogViewerTag tag = new ExtendedLogViewerTag(item.LogLevel, item.ID, item.Name);

            this.logGrid.Rows[pos].Tag = tag;

            this.ShortcutAdd(tag);
        }
示例#4
0
 private void SetShowFlags(ZForge.Controls.Logs.LogLevel f, bool set)
 {
     lock (this)
     {
         if (set == true)
         {
             this.mShowLogs = this.mShowLogs | (int)f;
         }
         else
         {
             this.mShowLogs = this.mShowLogs & (~(int)f);
         }
         foreach (SourceGrid.Grid.GridRow row in this.logGrid.Rows)
         {
             if (row.Tag != null)
             {
                 ExtendedLogViewerTag t = (ExtendedLogViewerTag)row.Tag;
                 row.Visible = (((int)t.LogLevel & this.mShowLogs) != 0);
             }
         }
     }
 }
示例#5
0
 private void ShortcutAdd(ExtendedLogViewerTag tag)
 {
     foreach (ExtendedLogViewerTag t in this.toolStripComboBoxView.Items)
     {
         if (t.ID.Equals(tag.ID))
         {
             return;
         }
     }
     this.toolStripComboBoxView.Items.Add(tag);
     try
     {
         object    o    = this.toolStripComboBoxView.SelectedItem;
         ArrayList list = ArrayList.Adapter(this.toolStripComboBoxView.Items);
         list.Sort();
         this.toolStripComboBoxView.SelectedItem = o;
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message);
     }
 }
示例#6
0
        private void UpdateCultureGrid()
        {
            foreach (SourceGrid.Grid.GridRow row in this.logGrid.Rows)
            {
                ExtendedLogViewerTag t = row.Tag as ExtendedLogViewerTag;
                if (t != null)
                {
                    switch (t.LogLevel)
                    {
                    case ZForge.Controls.Logs.LogLevel.LOG_ERROR:
                        this.logGrid[row.Index, 1].Value = Translator.Instance.T("错误");
                        break;

                    case ZForge.Controls.Logs.LogLevel.LOG_WARNING:
                        this.logGrid[row.Index, 1].Value = Translator.Instance.T("警告");
                        break;

                    default:
                        this.logGrid[row.Index, 1].Value = Translator.Instance.T("普通");
                        break;
                    }
                }
            }
        }
示例#7
0
        private void UpdateUIAdd(ExtendedLogViewerItem item)
        {
            int pos = this.logGrid.RowsCount;
            this.logGrid.RowsCount++;

            this.logGrid[pos, 0] = new SourceGrid.Cells.Cell(pos);
            this.FillRowMark(item.LogLevel, pos);
            this.logGrid[pos, 2] = new SourceGrid.Cells.Cell(item.TimeStamp.ToString());
            this.logGrid[pos, 3] = new SourceGrid.Cells.Cell(item.Name);

            this.logGrid[pos, 4] = new SourceGrid.Cells.Cell(item.Message);
            this.logGrid[pos, 4].View.WordWrap = true;

            ExtendedLogViewerTag tag = new ExtendedLogViewerTag(item.LogLevel, item.ID, item.Name);
            this.logGrid.Rows[pos].Tag = tag;

            this.ShortcutAdd(tag);
        }
示例#8
0
 private void ShortcutAdd(ExtendedLogViewerTag tag)
 {
     foreach (ExtendedLogViewerTag t in this.toolStripComboBoxView.Items)
     {
         if (t.ID.Equals(tag.ID))
         {
             return;
         }
     }
     this.toolStripComboBoxView.Items.Add(tag);
     try
     {
         object o = this.toolStripComboBoxView.SelectedItem;
         ArrayList list = ArrayList.Adapter(this.toolStripComboBoxView.Items);
         list.Sort();
         this.toolStripComboBoxView.SelectedItem = o;
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message);
     }
 }