Пример #1
0
 public void AddToLog(string s)
 {
     lock (UpdateLog)
     {
         UpdateLog.Add(RealPlugin.FormatDateTime(DateTime.Now) + " - " + s);
     }
 }
Пример #2
0
        private void DgvLog_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
        {
            InternalLog il = virtualData[e.RowIndex];

            switch (e.ColumnIndex)
            {
            case 0:
                e.Value = RealPlugin.FormatDateTime(il.Timestamp);
                break;

            case 1:
                e.Value = I18n.Translate("internal/Plugin/loglevel" + il.Level.ToString(), "{0}", il.Level.ToString());
                break;

            case 2:
                e.Value = il.Message;
                break;
            }
        }
Пример #3
0
        private void RefreshViewStatic()
        {
            List <DataGridViewRow> rows = new List <DataGridViewRow>();
            List <InternalLog>     p1   = BuildDataset();

            foreach (InternalLog il in p1)
            {
                DataGridViewRow row = (DataGridViewRow)dgvLog.RowTemplate.Clone();
                row.CreateCells(dgvLog, RealPlugin.FormatDateTime(il.Timestamp), I18n.Translate("internal/Plugin/loglevel" + il.Level.ToString(), "{0}", il.Level.ToString()), il.Message);
                switch (il.Level)
                {
                case RealPlugin.DebugLevelEnum.Verbose:
                    row.DefaultCellStyle.BackColor = Color.LightGray;
                    row.DefaultCellStyle.ForeColor = Color.Black;
                    break;

                case RealPlugin.DebugLevelEnum.Info:
                    row.DefaultCellStyle.BackColor = Color.White;
                    row.DefaultCellStyle.ForeColor = Color.Black;
                    break;

                case RealPlugin.DebugLevelEnum.Warning:
                    row.DefaultCellStyle.BackColor = Color.Yellow;
                    row.DefaultCellStyle.ForeColor = Color.Black;
                    break;

                case RealPlugin.DebugLevelEnum.Error:
                    row.DefaultCellStyle.BackColor = Color.Red;
                    row.DefaultCellStyle.ForeColor = Color.Yellow;
                    break;
                }
                rows.Add(row);
            }
            dgvLog.Rows.Clear();
            dgvLog.Rows.AddRange(rows.ToArray());
            dgvLog.ClearSelection();
            lblStatus.Text = I18n.Translate("internal/LogForm/displaying", "Displaying {0} out of {1}", p1.Count, logData.Count);
        }
Пример #4
0
 public override string ToString()
 {
     return(RealPlugin.FormatDateTime(Timestamp) + " - " + I18n.Translate("internal/Plugin/loglevel" + Level.ToString(), "{0}", Level.ToString()) + " - " + Message);
 }