public mainForm() { try { IConfigurationSource configSource = ConfigurationSourceFactory.Create(); LogWriterFactory lwFactory = new LogWriterFactory(configSource); Logger.SetLogWriter(lwFactory.Create(), false); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(string.Format("Failed to set logger. {0}", ex.Message)); } InitializeComponent(); //Initialize background worker this.bw = new BackgroundWorker(); this.bw.WorkerSupportsCancellation = true; this.bw.WorkerReportsProgress = true; this.bw.DoWork += this.bw_DoWork; this.bw.ProgressChanged += this.bw_ProgressChanged; this.bw.RunWorkerCompleted += this.bw_Complete; //Create menu strip gradient fill this.menuStrip_Main.Renderer = new TStripRenderer(new ProColorsTable() { MStripGradientBegin = Color.LightSkyBlue, MStripGradientEnd = Color.DarkSlateBlue }) { RoundedEdges = false }; //Set objectlistview header style and hot item style var hfs = new BrightIdeasSoftware.HeaderFormatStyle(); hfs.SetFont(Font = new Font("Arial", 11F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(0)))); hfs.Normal = new BrightIdeasSoftware.HeaderStateStyle() { BackColor = Color.FromArgb(76, 74, 132), ForeColor = Color.WhiteSmoke, FrameColor = Color.Black, FrameWidth = 1F }; hfs.Hot = new BrightIdeasSoftware.HeaderStateStyle() { BackColor = Color.FromArgb(76, 74, 132), ForeColor = Color.WhiteSmoke, FrameColor = Color.Yellow, FrameWidth = 2F }; this.objectListView_Results.HeaderFormatStyle = hfs; var rbd = new BrightIdeasSoftware.RowBorderDecoration(); rbd.BorderPen = new Pen(Color.FromArgb(128, Color.LightSeaGreen), 2); rbd.BoundsPadding = new Size(1, 1); rbd.CornerRounding = 4.0f; this.objectListView_Results.HotItemStyle.Decoration = rbd; }
private void performOLVLayout() { mainForm.writeVerbose("Performing OLV layout..."); var hfs = new BrightIdeasSoftware.HeaderFormatStyle(); hfs.SetFont(Font = new Font("Arial", 11F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(0)))); hfs.Normal = new BrightIdeasSoftware.HeaderStateStyle() { BackColor = Color.FromArgb(76, 74, 132), ForeColor = Color.WhiteSmoke, FrameColor = Color.Black, FrameWidth = 1F }; hfs.Hot = new BrightIdeasSoftware.HeaderStateStyle() { BackColor = Color.FromArgb(76, 74, 132), ForeColor = Color.WhiteSmoke, FrameColor = Color.Yellow, FrameWidth = 2F }; try { this.objectListView_Results.HeaderFormatStyle = hfs; } catch (Exception ex) { mainForm.writeError(string.Format("Failed to set header format style on OLV. {0}", ex.Message), 18022, System.Diagnostics.TraceEventType.Error, false); } var rbd = new BrightIdeasSoftware.RowBorderDecoration(); rbd.BorderPen = new Pen(Color.FromArgb(128, Color.LightSeaGreen), 2); rbd.BoundsPadding = new Size(1, 1); rbd.CornerRounding = 4.0f; try { this.objectListView_Results.HotItemStyle = new BrightIdeasSoftware.HotItemStyle(); this.objectListView_Results.HotItemStyle.Decoration = rbd; } catch (Exception ex) { mainForm.writeError(string.Format("Failed to set hot item decoration style on OLV. {0}", ex.Message), 18022, System.Diagnostics.TraceEventType.Error, false); } }
private void initializeUI() { try { this.Width = Properties.Settings.Default.DEFAULT_STYLECHOOSER_WIDTH; this.Height = Properties.Settings.Default.DEFAULT_STYLECHOOSER_HEIGHT; this.Location = new Point(Convert.ToInt32((SystemInformation.PrimaryMonitorSize.Width - this.Width) / 2), Convert.ToInt32((SystemInformation.PrimaryMonitorSize.Height - this.Height) / 2)); splitter.SplitterDistance = Convert.ToInt32(0.4 * splitter.Width); BrightIdeasSoftware.TextOverlay textOverlay = this.listCitations.EmptyListMsgOverlay as BrightIdeasSoftware.TextOverlay; textOverlay.TextColor = Color.FromArgb(255, 96, 96, 96); textOverlay.BackColor = System.Drawing.Color.White; textOverlay.BorderWidth = 0; textOverlay.InsetY = 0; textOverlay.Font = new System.Drawing.Font("Serif", 9); rbd = new BrightIdeasSoftware.RowBorderDecoration(); rbd.BorderPen = new Pen(Color.FromArgb(170, Color.DarkGray), 1); rbd.FillBrush = new SolidBrush(Color.FromArgb(30, Color.Black)); rbd.BoundsPadding = new Size(-2, -2); rbd.CornerRounding = 6.0f; this.listCitations.SelectedRowDecoration = rbd; alternateRBD = new BrightIdeasSoftware.RowBorderDecoration(); alternateRBD.BorderPen = new Pen(Color.LightGray, 1); alternateRBD.FillBrush = null; alternateRBD.BoundsPadding = new Size(2, 0); alternateRBD.CornerRounding = 0; buildGroupListIcons(); checkDPISetting(); } catch(Exception ex) { this.log.WriteLine(LogType.Error, "CitationStyleForm::initializeUI", ex.ToString()); } }
/// <summary> /// Initializes the UI. /// </summary> private void initializeUI() { try { this.Width = Globals.ThisAddIn.iTempWidth; this.Height = Globals.ThisAddIn.iTempHeight; BrightIdeasSoftware.TextOverlay textOverlay = this.listCitations.EmptyListMsgOverlay as BrightIdeasSoftware.TextOverlay; textOverlay.TextColor = Color.FromArgb(255, 96, 96, 96); textOverlay.BackColor = System.Drawing.Color.White; textOverlay.BorderWidth = 0; textOverlay.InsetY = 0; textOverlay.Font = new System.Drawing.Font("Segoe UI", 9); rbd = new BrightIdeasSoftware.RowBorderDecoration(); rbd.BorderPen = new Pen(Color.FromArgb(170, Color.DarkGray), 1); rbd.FillBrush = new SolidBrush(Color.FromArgb(30, Color.Black)); rbd.BoundsPadding = new Size(-2, -2); rbd.CornerRounding = 6.0f; this.listCitations.SelectedRowDecoration = rbd; alternateRBD = new BrightIdeasSoftware.RowBorderDecoration(); alternateRBD.BorderPen = new Pen(Color.LightGray, 1); alternateRBD.FillBrush = null; alternateRBD.BoundsPadding = new Size(2, 0); alternateRBD.CornerRounding = 0; if (Globals.ThisAddIn.user.AccType == WizFolioUtils.EnumList.AccountType.Free) btnShowAllStyles.Visible = false; splitter.SplitterDistance = Convert.ToInt32(0.5 * splitter.Height); ThisAddIn_DockPositionChanged(null, null); buildGroupListIcons(); } catch(Exception ex) { this.log.WriteLine(LogType.Error, "CitationStyleControl::initializeUI", ex.ToString()); } }