Esempio n. 1
0
 public ExtendedLogViewerItem(ZForge.Controls.Logs.LogLevel level, CameraView view, string msg)
 {
     this.mLogLevel = level;
     this.mCameraID = view.CameraClass.ID;
     this.mCameraName = view.CameraClass.Name;
     this.mMsg = msg;
     this.mLogTime = DateTime.Now.ToLocalTime();
 }
Esempio n. 2
0
 private void updateDownloader_GotContentLength(object sender, ZForge.Controls.Net.GotContentLengthEventArgs e)
 {
     if (e.Length != 0)
     {
         string m = string.Format(Translator.Instance.T("�����ļ���С: ({0}�ֽ�)"), e.Length);
         this.logViewer.LogAdd(new LogItem(LogLevel.LOG_INFO, m));
     }
     else
     {
         this.logViewer.LogAdd(new LogItem(LogLevel.LOG_WARNING, Translator.Instance.T("�����ļ���С����֪.")));
     }
 }
Esempio n. 3
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);
             }
         }
     }
 }
Esempio n. 4
0
 private void FillRowMark(ZForge.Controls.Logs.LogLevel level, int pos)
 {
     switch (level)
     {
         case ZForge.Controls.Logs.LogLevel.LOG_ERROR:
             this.logGrid[pos, 1] = new SourceGrid.Cells.Cell(Translator.Instance.T("错误"));
             this.logGrid[pos, 1].Image = this.imageListLog.Images[0];
             this.logGrid.Rows[pos].Visible = this.ShowError;
             this.CountError++;
             break;
         case ZForge.Controls.Logs.LogLevel.LOG_WARNING:
             this.logGrid[pos, 1] = new SourceGrid.Cells.Cell(Translator.Instance.T("警告"));
             this.logGrid[pos, 1].Image = this.imageListLog.Images[1];
             this.logGrid.Rows[pos].Visible = this.ShowWarning;
             this.CountWarn++;
             break;
         default:
             this.logGrid[pos, 1] = new SourceGrid.Cells.Cell(Translator.Instance.T("普通"));
             this.logGrid[pos, 1].Image = this.imageListLog.Images[2];
             this.CountInfo++;
             this.logGrid.Rows[pos].Visible = this.ShowInfo;
             break;
     }
 }
Esempio n. 5
0
 public void Add(ZForge.Controls.Logs.LogLevel level, CameraView view, string msg)
 {
     ExtendedLogViewerItem i = new ExtendedLogViewerItem(level, view, msg);
     this.mMutex.WaitOne();
     this.mLogs.Add(i);
     this.mMutex.ReleaseMutex();
 }
Esempio n. 6
0
 private void PlugIn_Instance_Log(object sender, ZForge.Controls.Logs.LogEventArgs e)
 {
     OnCameraViewLog(new CameraViewLogEventArgs(e.Level, e.Message, this));
 }
Esempio n. 7
0
 public CameraViewLogEventArgs(ZForge.Controls.Logs.LogLevel loglevel, string msg, CameraView v)
     : base(v)
 {
     this.loglevel = loglevel;
     this.msg = msg;
 }
Esempio n. 8
0
 private void tableList_SelectionChanged(object sender, ZForge.Controls.XPTable.Events.SelectionEventArgs e)
 {
     this.SwapToolStripButtonStates();
 }
Esempio n. 9
0
 private void tableList_EditingStopped(object sender, ZForge.Controls.XPTable.Events.CellEditEventArgs e)
 {
     Table table = this.tableList;
     Row row = table.TableModel.Rows[e.Row];
     UpdateSite us = row.Tag as UpdateSite;
     TextCellEditor editor = e.Editor as TextCellEditor;
     string v = (editor.TextBox.Text != null) ? editor.TextBox.Text.Trim() : null;
     if (v == null || v.Length == 0)
     {
         e.Cancel = true;
         return;
     }
     switch (e.Column)
     {
         case 0:
             us.Description = v;
             break;
         case 1:
             List<string> msgs = new List<string>();
             if (false == ZForge.Configuration.Validator.ValidateURL(msgs, Translator.Instance.T("��ַ(URL)"), v))
             {
                 MessageBox.Show(ZForge.Configuration.Validator.MergeMessages(msgs), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                 e.Cancel = true;
             }
             else
             {
                 us.URL = v;
             }
             break;
     }
     this.AutosizeColumnWidth();
 }
Esempio n. 10
0
 public ExtendedLogViewerTag(ZForge.Controls.Logs.LogLevel l, string id, string n)
 {
     this.mID = id;
     this.mLevel = l;
     this.mViewName = n;
 }