public MessageSenderUi(MessageSender sender) // constructor / конструктор { _sender = sender; InitializeComponent(); LoadDateOnForm(); Title = OsLocalization.Logging.TitleMessageSenderUi; Label3.Content = OsLocalization.Logging.Label3; Label4.Content = OsLocalization.Logging.Label4; Label19.Content = OsLocalization.Logging.Label19; Label5.Content = OsLocalization.Logging.Label5; Label52.Content = OsLocalization.Logging.Label5; Label53.Content = OsLocalization.Logging.Label5; ButtonAccept.Content = OsLocalization.Logging.Button1; ButtonSmsGlobeSet.Content = OsLocalization.Logging.Button2; ButtonMailGlobeSet.Content = OsLocalization.Logging.Button2; ButtonWebhookGlobeSet.Content = OsLocalization.Logging.Button2; CheckBoxSmsSignal.Content = OsLocalization.Logging.Label6; CheckBoxSmsTrade.Content = OsLocalization.Logging.Label7; CheckBoxSmsError.Content = OsLocalization.Logging.Label8; CheckBoxSmsSystem.Content = OsLocalization.Logging.Label9; CheckBoxSmsConnect.Content = OsLocalization.Logging.Label10; CheckBoxMailSignal.Content = OsLocalization.Logging.Label6; CheckBoxMailTrade.Content = OsLocalization.Logging.Label7; CheckBoxMailError.Content = OsLocalization.Logging.Label8; CheckBoxMailSystem.Content = OsLocalization.Logging.Label9; CheckBoxMailConnect.Content = OsLocalization.Logging.Label10; CheckBoxWebhookSignal.Content = OsLocalization.Logging.Label6; CheckBoxWebhookTrade.Content = OsLocalization.Logging.Label7; CheckBoxWebhookError.Content = OsLocalization.Logging.Label8; CheckBoxWebhookSystem.Content = OsLocalization.Logging.Label9; CheckBoxWebhookConnect.Content = OsLocalization.Logging.Label10; }
// объект лога /// <summary> /// конструктор /// </summary> /// <param name="uniqName">имя объекта которому принадлежит лог</param> public Log(string uniqName) { _uniqName = uniqName; if (Watcher == null) { Activate(); } LogsToCheck.Add(this); _grid = new DataGridView(); _grid.AllowUserToOrderColumns = true; _grid.AllowUserToResizeRows = true; _grid.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; _grid.AllowUserToDeleteRows = false; _grid.AllowUserToAddRows = false; _grid.RowHeadersVisible = false; _grid.SelectionMode = DataGridViewSelectionMode.FullRowSelect; _grid.MultiSelect = false; DataGridViewCellStyle style = new DataGridViewCellStyle(); style.Alignment = DataGridViewContentAlignment.TopLeft; style.WrapMode = DataGridViewTriState.True; _grid.DefaultCellStyle = style; DataGridViewTextBoxCell cell0 = new DataGridViewTextBoxCell(); cell0.Style = style; DataGridViewColumn column0 = new DataGridViewColumn(); column0.CellTemplate = cell0; column0.HeaderText = @"Время"; column0.ReadOnly = true; column0.Width = 170; _grid.Columns.Add(column0); DataGridViewColumn column1 = new DataGridViewColumn(); column1.CellTemplate = cell0; column1.HeaderText = @"Тип"; column1.ReadOnly = true; column1.Width = 100; _grid.Columns.Add(column1); DataGridViewColumn column = new DataGridViewColumn(); column.CellTemplate = cell0; column.HeaderText = @"Сообщение"; column.ReadOnly = true; column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; _grid.Columns.Add(column); _grid.Rows.Add(null, null); _grid.DoubleClick += _grid_DoubleClick; _messageSender = new MessageSender(uniqName); CreateErrorLogGreed(); }
private readonly MessageSender _sender; // менедженр рассылки public MessageSenderUi(MessageSender sender) // конструктор { _sender = sender; InitializeComponent(); LoadDateOnForm(); }