public DownloadListUC() { InitializeComponent(); //----------------------------------------// _Settings = Settings.Default; _LastSortInfo = SortInfo.FromJson(_Settings.LastSortInfoJson); _RestoreSortIfNeedAction = new Action(RestoreSortIfNeed); _CommonUpdateTimer = new Timer() { Interval = 1_000, Enabled = false }; _CommonUpdateTimer.Tick += CommonUpdateTimer_Tick; _ErrorCellStyle = new CellStyle(DGV.DefaultCellStyle) { ForeColor = Color.Red, SelectionForeColor = Color.White, SelectionBackColor = Color.Red, }; _CanceledCellStyle = new CellStyle(DGV.DefaultCellStyle) { ForeColor = Color.DimGray, SelectionForeColor = Color.WhiteSmoke, }; _FinishedCellStyle = new CellStyle(DGV.DefaultCellStyle) { Font = new Font(DGV.Font, FontStyle.Bold) }; _RNP = RowNumbersPainter.Create(DGV); _SF_Left = new StringFormat(StringFormatFlags.NoWrap) { Trimming = StringTrimming.EllipsisCharacter, Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }; _SF_Center = new StringFormat(StringFormatFlags.NoWrap) { Trimming = StringTrimming.EllipsisCharacter, Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }; //----------------------------------------// CreateColumnsContextMenu(); }
private FileNameExcludesWordsEditor() { InitializeComponent(); _RPN = RowNumbersPainter.Create(DGV, useSelectedBackColor: false); }
public LogUC() { InitializeComponent(); //----------------------------------------------// _SetRowInvisibleAction = new Action <LogRow>(SetRowInvisible); _Model_CollectionChangedAction = new Action <_CollectionChangedTypeEnum_>(Model_CollectionChanged); //----------------------------------------------// _RNP = RowNumbersPainter.Create(DGV, useSelectedBackColor: true, useColumnsHoverHighlight: false); _SF = new StringFormat(StringFormatFlags.LineLimit) { Trimming = StringTrimming.EllipsisCharacter, Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Near }; //----------------------------------------------// var font = DGV.Font; var alg = DataGridViewContentAlignment.TopLeft; var wm = DataGridViewTriState.True; var dcs = DGV.DefaultCellStyle; var fc_suc = Color.DimGray; var bc_suc = dcs.BackColor; var fc_err = Color.Red; var bc_err = Color.Yellow; //----------------------------------------------// _DefaultCellStyle_4ResponseReceived = new CellStyle(dcs) { WrapMode = wm, Alignment = alg, ForeColor = fc_suc }; //----------------------------------------------// _Req_ReceivedCellStyle = new CellStyle(dcs) { WrapMode = wm, Font = font, ForeColor = fc_suc, BackColor = bc_suc, Alignment = alg }; _Rsp_ReceivedCellStyle = new CellStyle(dcs) { WrapMode = wm, Font = font, ForeColor = fc_suc, BackColor = bc_suc, Alignment = alg }; _Req_ErrorCellStyle = new CellStyle(dcs) { WrapMode = wm, Font = font, ForeColor = fc_err, BackColor = bc_err, Alignment = alg }; _Rsp_ErrorCellStyle = new CellStyle(dcs) { WrapMode = wm, Font = font, ForeColor = fc_err, BackColor = bc_err, Alignment = alg }; var smallFont_1 = new Font(font.FontFamily, font.Size * 4 / 5); var smallFont_2 = new Font(smallFont_1.FontFamily, smallFont_1.Size * 4 / 5); _Req_ErrorCellStyleSmallFont_1 = new CellStyle(dcs) { WrapMode = wm, Font = smallFont_1, ForeColor = fc_err, BackColor = bc_err, Alignment = alg }; _Rsp_ErrorCellStyleSmallFont_1 = new CellStyle(dcs) { WrapMode = wm, Font = smallFont_1, ForeColor = fc_err, BackColor = bc_err, Alignment = alg }; _Req_ErrorCellStyleSmallFont_2 = new CellStyle(dcs) { WrapMode = wm, Font = smallFont_2, ForeColor = fc_err, BackColor = bc_err, Alignment = alg }; _Rsp_ErrorCellStyleSmallFont_2 = new CellStyle(dcs) { WrapMode = wm, Font = smallFont_2, ForeColor = fc_err, BackColor = bc_err, Alignment = alg }; _Req_CellStyleSmallFont_1 = new CellStyle(dcs) { WrapMode = wm, Font = smallFont_1, ForeColor = fc_suc, BackColor = bc_suc, Alignment = alg }; _Rsp_CellStyleSmallFont_1 = new CellStyle(dcs) { WrapMode = wm, Font = smallFont_1, ForeColor = fc_suc, BackColor = bc_suc, Alignment = alg }; _Req_CellStyleSmallFont_2 = new CellStyle(dcs) { WrapMode = wm, Font = smallFont_2, ForeColor = fc_suc, BackColor = bc_suc, Alignment = alg }; _Rsp_CellStyleSmallFont_2 = new CellStyle(dcs) { WrapMode = wm, Font = smallFont_2, ForeColor = fc_suc, BackColor = bc_suc, Alignment = alg }; //----------------------------------------------// _ShowOnlyRequestRowsWithErrors = SettingsPropertyChangeController.SettingsDefault.ShowOnlyRequestRowsWithErrors; _ShowOnlyRequestRowsWithErrorsMenuItem = new ToolStripMenuItem("Show only request rows with errors", null, _ShowOnlyRequestRowsWithErrors_Click) { Checked = _ShowOnlyRequestRowsWithErrors }; _ContextMenu = new ContextMenuStrip(); _ContextMenu.Items.Add(_ShowOnlyRequestRowsWithErrorsMenuItem); }