Esempio n. 1
0
        /// <summary>
        /// Applies the current theme to the <see cref="Control"/>.
        /// </summary>
        /// <param name="theme">The <see cref="BaseTheme"/> instance to apply.</param>
        public void ApplyTheme(BaseTheme theme)
        {
            ThemeManager.ApplyTo(cmColumns);
            ThemeManager.ApplyTo(cmLogMessage);

            cmdcopytoclipboard.Image = theme.Resources.Images["FrmScriptTbCopy"];
            cmsToggleBookmark.Image  = theme.Resources.Images["FrmMainTbBookmark"];
            cmsSynchronizeTree.Image = theme.Resources.Images["FrmMainTbSync"];

            dtgLogMessages.EnableHeadersVisualStyles             = theme.Metrics.PreferSystemRendering;
            dtgLogMessages.ColumnHeadersDefaultCellStyle.Padding = theme.Metrics.DataGridViewHeaderColumnPadding;

            dtgLogMessages.BackgroundColor          = theme.ColorPalette.ContentBackground;
            dtgLogMessages.ForeColor                = theme.ColorPalette.ContentForeground;
            dtgLogMessages.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
            dtgLogMessages.GridColor                = theme.ColorPalette.DividerColor;

            dtgLogMessages.ColumnHeadersDefaultCellStyle.BackColor          = theme.ColorPalette.ContentBackground;
            dtgLogMessages.ColumnHeadersDefaultCellStyle.ForeColor          = theme.ColorPalette.ContentForeground;
            dtgLogMessages.ColumnHeadersDefaultCellStyle.SelectionBackColor = theme.ColorPalette.SelectionBackgroundFocused;
            dtgLogMessages.ColumnHeadersDefaultCellStyle.SelectionForeColor = theme.ColorPalette.SelectionForegroundFocused;

            dtgLogMessages.CellBorderStyle            = DataGridViewCellBorderStyle.Single;
            dtgLogMessages.DefaultCellStyle.BackColor = theme.ColorPalette.ContentBackground;
            dtgLogMessages.DefaultCellStyle.ForeColor = theme.ColorPalette.ContentForeground;
        }
Esempio n. 2
0
        public FrmWelcome(MainForm mainForm)
        {
            InitializeComponent();

            ThemeManager.ApplyTo(this);

            mMainForm = mainForm;

            lstLogger.Items.Add(new Log4NetUdpReceiver());
            lstLogger.Items.Add(new Log4NetFileReceiver());
            lstLogger.Items.Add(new Log4NetDirReceiver());
            lstLogger.AddSeperator();
            lstLogger.Items.Add(new NlogTcpReceiver());
            lstLogger.Items.Add(new NLogUdpReceiver());
            lstLogger.Items.Add(new NLogFileReceiver());
            lstLogger.Items.Add(new NLogDirReceiver());
            lstLogger.AddSeperator();
            lstLogger.Items.Add(new SyslogUdpReceiver());
            lstLogger.Items.Add(new SyslogFileReceiver());
            lstLogger.AddSeperator();
            lstLogger.Items.Add(new EventlogReceiver());
            lstLogger.Items.Add(new WinDebugReceiver());
            lstLogger.AddSeperator();
            lstLogger.Items.Add(new CustomUdpReceiver());
            lstLogger.Items.Add(new CustomTcpReceiver());
            lstLogger.Items.Add(new CustomHttpReceiver());
            lstLogger.Items.Add(new CustomFileReceiver());
            lstLogger.Items.Add(new CustomDirReceiver());
        }
Esempio n. 3
0
        /// <summary>
        /// Creates a new instance of the <see cref="FrmLogWindow"/> window.
        /// </summary>
        /// <param name="logProvider">The <see cref="ILogProvider"/> that sends messages to this window.</param>
        /// <param name="logContainer">The <see cref="ILogContainer"/> that contains the source for <see cref="LogMessage"/>s.</param>
        public FrmLogWindow(ILogProvider logProvider, ILogContainer logContainer)
        {
            InitializeComponent();

            mLogcontainer = logContainer;
            mBookmarks    = new List <LogMessage>();
            InitializeColumns(logProvider);

            if (!logProvider.HasLoggerTree)
            {
                // Remove the synchronize tree menu item if no tree is available.
                cmLogMessage.Items.Remove(cmsSynchronizeTree);
                cmLogMessage.Items.Remove(cmsSeperator);
            }

            ThemeManager.ApplyTo(this);

            if (!string.IsNullOrEmpty(Settings.Default.LogMessagesFontName))
            {
                try
                {
                    dtgLogMessages.DefaultCellStyle.Font = FontCache.GetFontFromIdentifier(
                        Settings.Default.LogMessagesFontName
                        , Settings.Default.LogMessagesFontSize
                        , FontStyle.Regular);
                }
                catch
                {
                    // Reset the font on error.
                    dtgLogMessages.Font = FontCache.GetFontFromIdentifier(
                        DEFAULT_FONT_NAME
                        , DEFAULT_FONT_SIZE
                        , FontStyle.Regular);

                    mRowHeight = dtgLogMessages.RowTemplate.Height;

                    // Save the changed settings as new default.
                    Settings.Default.LogMessagesFontName = DEFAULT_FONT_NAME;
                    Settings.Default.LogMessagesFontSize = DEFAULT_FONT_SIZE;

                    Settings.Default.SaveSettings();
                }
            }

            if (Settings.Default.EnableColorMap)
            {
                tableLayoutPanel1.SetColumnSpan(dtgLogMessages, 1);
                colorMap1.Visible = true;
            }
            else
            {
                colorMap1.Visible = false;
                tableLayoutPanel1.SetColumnSpan(dtgLogMessages, 2);
            }

            // Listening for settings changes.
            Settings.Default.SettingChanging += DefaultSettingChanging;
        }
Esempio n. 4
0
        /// <summary>
        /// Creates a new instance of the <see cref="FrmLogStatistic"/> window.
        /// </summary>
        /// <param name="logProvider">The <see cref="ILogProvider"/> that sends messages to this window.</param>
        public FrmLogStatistic(ILogProvider logProvider)
        {
            InitializeComponent();

            // Initial the overview chart.
            InitPieChart(logProvider);

            // Apply the current application theme to the control.
            ThemeManager.ApplyTo(this);
        }
        /// <summary>
        /// Creates a new instance of the <see cref="FrmLogBookmarks"/> window.
        /// </summary>
        /// <param name="bookmarkProvider">The <see cref="IBookmarkProvider"/> instance that provides bookmarked <see cref="LogMessage"/>s.</param>
        public FrmLogBookmarks(IBookmarkProvider bookmarkProvider)
        {
            mBookmarkProvider = bookmarkProvider;

            // Register this instance as observer.
            mBookmarkProvider?.RegisterBookmarkObserver(this);

            InitializeComponent();

            // Apply the current application theme to the control.
            ThemeManager.ApplyTo(this);
        }
Esempio n. 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FrmLogFilter"/>.
        /// </summary>
        /// <param name="logProvider">The <see cref=ILogProvider"/> instance to filter for.</param>
        /// <param name="filterHandler">The <see cref="ILogFilterHandler"/> that handles changed filter settings.</param>
        public FrmLogFilter(ILogProvider logProvider, ILogFilterHandler filterHandler)
        {
            InitializeComponent();

            // Apply the current application theme to the control.
            ThemeManager.ApplyTo(this);

            mLogProvider      = logProvider;
            mLogFilterHandler = filterHandler;
            Font = SystemFonts.MessageBoxFont;

            if (mLogFilterHandler != null)
            {
                mLogFilterHandler.RegisterFilterProvider(this);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ColorMap"/> control.
        /// </summary>
        public ColorMap(ILogPresenter logPresenter)
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.UserPaint, true);

            InitializeComponent();

            ThemeManager.ApplyTo(this);

            mLogPresenter    = logPresenter;
            mViewRectPadding = new Padding(
                0
                , SystemInformation.VerticalScrollBarArrowHeight
                , 0
                , SystemInformation.HorizontalScrollBarHeight + SystemInformation.VerticalScrollBarArrowHeight);
        }
Esempio n. 8
0
        /// <summary>
        /// Creates a new instance of the <see cref="FrmLogTree"/> window.
        /// </summary>
        /// <param name="filterHandler">The <see cref="ILogFilterHandler"/> that handles changed filter settings.</param>
        /// <param name="loggerPathSeperator">The path seperator for <see cref="LogMessage"/>s to build the tree from.</param>
        public FrmLogTree(ILogFilterHandler filterHandler, string loggerPathSeperator)
        {
            InitializeComponent();

            // Apply the current application theme to the control.
            ThemeManager.ApplyTo(this);

            mLogFilterHandler = filterHandler;
            Font = SystemFonts.MessageBoxFont;

            if (mLogFilterHandler != null)
            {
                // Register the tree as log provider.
                filterHandler.RegisterFilterProvider(this);
            }

            tvLoggerTree.PathSeparator = loggerPathSeperator;
        }
Esempio n. 9
0
        /// <summary>
        /// Creates anew instance of the <see cref="WinDebugDetailsControl"/> <see cref="Control"/>.
        /// </summary>
        public WinDebugDetailsControl()
        {
            InitializeComponent();

            // Apply the current application theme to the control.
            ThemeManager.ApplyTo(this);

            mBoldCaptionFont = FontCache.GetFontFromIdentifier(
                Font.Name
                , Font.Size
                , FontStyle.Bold);

            lblCaptionNumber.Font    = mBoldCaptionFont;
            lblCaptionLevel.Font     = mBoldCaptionFont;
            lblCaptionTime.Font      = mBoldCaptionFont;
            lblCaptionProcessId.Font = mBoldCaptionFont;
            lblCaptionMessage.Font   = mBoldCaptionFont;
        }
Esempio n. 10
0
        /// <summary>
        /// Creates anew instance of the <see cref="CustomDetailsControl"/> <see cref="Control"/>.
        /// </summary>
        public CustomDetailsControl(Columnizer columnizer)
        {
            InitializeComponent();

            mColumnizer      = columnizer;
            mBoldCaptionFont = FontCache.GetFontFromIdentifier(
                Font.Name
                , Font.Size
                , FontStyle.Bold);

            lblCaptionNumber.Font = mBoldCaptionFont;

            foreach (LogColumn column in columnizer.Columns)
            {
                AddLogMsgRowItem(column);
            }

            // Apply the current application theme to the control.
            ThemeManager.ApplyTo(this);
        }
Esempio n. 11
0
        /// <summary>
        /// Creates anew instance of the <see cref="Log4NetDetailsControl"/> <see cref="Control"/>.
        /// </summary>
        public Log4NetDetailsControl()
        {
            InitializeComponent();

            // Apply the current application theme to the control.
            ThemeManager.ApplyTo(this);

            mBoldCaptionFont = FontCache.GetFontFromIdentifier(
                Font.Name
                , Font.Size
                , FontStyle.Bold);

            lblCaptionLogger.Font     = mBoldCaptionFont;
            lblCaptionLevel.Font      = mBoldCaptionFont;
            lblCaptionThread.Font     = mBoldCaptionFont;
            lblCaptionDateTime.Font   = mBoldCaptionFont;
            lblCaptionMessage.Font    = mBoldCaptionFont;
            lblCaptionLocation.Font   = mBoldCaptionFont;
            lblCaptionProperties.Font = mBoldCaptionFont;
        }
Esempio n. 12
0
        /// <summary>
        /// Creates anew instance of the <see cref="SyslogDetailsControl"/> <see cref="Control"/>.
        /// </summary>
        public SyslogDetailsControl()
        {
            InitializeComponent();

            // Apply the current application theme to the control.
            ThemeManager.ApplyTo(this);

            mBoldCaptionFont = FontCache.GetFontFromIdentifier(
                Font.Name
                , Font.Size
                , FontStyle.Bold);

            lblCaptionNumber.Font           = mBoldCaptionFont;
            lblCaptionSeverity.Font         = mBoldCaptionFont;
            lblCaptionTime.Font             = mBoldCaptionFont;
            lblCaptionLocalMachineTime.Font = mBoldCaptionFont;
            lblCaptionFacility.Font         = mBoldCaptionFont;
            lblCaptionSender.Font           = mBoldCaptionFont;
            lblCaptionMessage.Font          = mBoldCaptionFont;
        }
        /// <summary>
        /// Creates anew instance of the <see cref="Log4NetDetailsControl"/> <see cref="Control"/>.
        /// </summary>
        public Socks5DetailsControl()
        {
            InitializeComponent();

            // Apply the current application theme to the control.
            ThemeManager.ApplyTo(this);

            mBoldCaptionFont = FontCache.GetFontFromIdentifier(
                Font.Name
                , Font.Size
                , FontStyle.Bold);

            lblCaptionLogger.Font   = mBoldCaptionFont;
            lblCaptionLevel.Font    = mBoldCaptionFont;
            lblCaptionThread.Font   = mBoldCaptionFont;
            lblCaptionDateTime.Font = mBoldCaptionFont;
            lblCaptionMessage.Font  = mBoldCaptionFont;

            _resetHexBoxEmpty();
        }
Esempio n. 14
0
        /// <summary>
        /// Creates anew instance of the <see cref="SyslogDetailsControl"/> <see cref="Control"/>.
        /// </summary>
        public EventLogDetailsControl()
        {
            InitializeComponent();

            // Apply the current application theme to the control.
            ThemeManager.ApplyTo(this);

            mBoldCaptionFont = FontCache.GetFontFromIdentifier(
                Font.Name
                , Font.Size
                , FontStyle.Bold);

            lblCaptionNumber.Font      = mBoldCaptionFont;
            lblCaptionLevel.Font       = mBoldCaptionFont;
            lblCaptionLogger.Font      = mBoldCaptionFont;
            lblCaptionDateAndTime.Font = mBoldCaptionFont;
            lblCaptionCategory.Font    = mBoldCaptionFont;
            lblCaptionUsername.Font    = mBoldCaptionFont;
            lblCaptionInstanceId.Font  = mBoldCaptionFont;
            lblCaptionMessage.Font     = mBoldCaptionFont;
        }
Esempio n. 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ThemedListBoxEx"/> control.
 /// </summary>
 public ThemedListBoxEx()
 {
     ThemeManager.ApplyTo(this);
 }
Esempio n. 16
0
        /// <summary>
        /// Creates a new instance of the <see cref="FrmLogDocument"/> window.
        /// </summary>
        /// <param name="logProvider">The <see cref="ILogProvider"/> that sends messages to this window.</param>
        public FrmLogDocument(ILogProvider logProvider)
        {
            InitializeComponent();

            // Apply the current application theme to the control.
            ThemeManager.ApplyTo(this);
            Font = SystemFonts.MessageBoxFont;

            tblInnerLayout.BackColor   = ThemeManager.CurrentApplicationTheme.DockingTheme.ColorPalette.MainWindowActive.Background;
            errorPanelBack.BorderColor = ThemeManager.CurrentApplicationTheme.ColorPalette.DividerColor;

            mLogProvider = logProvider;

            ToolTipText = logProvider != null
          ? logProvider.Tooltip
          : string.Empty;

            mLogWindow = new FrmLogWindow(
                mLogProvider
                , this);

            if (mLogProvider != null)
            {
                TabText = mLogProvider.Description;

                if (mLogProvider.HasMessageDetails)
                {
                    mMessageDetails = new FrmMessageDetails(mLogProvider);
                    mMessageDetails.VisibleChanged += (sender, e) =>
                    {
                        tsbShowMessageDetails.Checked = !mMessageDetails.IsHidden;
                    };
                }

                if (mLogProvider.HasLoggerTree)
                {
                    mLoggerTree = new FrmLogTree((ILogFilterHandler)mLogWindow, logProvider.LoggerTreePathSeperator);
                    mLoggerTree.VisibleChanged += (sender, e) =>
                    {
                        tsbShowLoggerTree.Checked = !mLoggerTree.IsHidden;
                    };
                }

                tsbShowMessageDetails.Visible = mLogProvider.HasMessageDetails;
                tsbShowLoggerTree.Visible     = mLogProvider.HasLoggerTree;
                tsbShowStatistic.Visible      = mLogProvider.HasStatisticView;
            }
            else
            {
                tsbShowMessageDetails.Visible = false;
                tsbShowLoggerTree.Visible     = false;
                tsSeperatorWindows.Visible    = false;
                tsbShowStatistic.Visible      = false;
            }

            mLogScript = new FrmLogScript((IBookmarkProvider)mLogWindow, this);
            mBookmarks = new FrmLogBookmarks((IBookmarkProvider)mLogWindow);

            if (mLogProvider.HasStatisticView)
            {
                mLogStatistic = new FrmLogStatistic(mLogProvider);

                mLogStatistic.VisibleChanged += (sender, e) =>
                {
                    tsbShowStatistic.Checked = !mLogStatistic.IsHidden;
                };

                mBookmarks.VisibleChanged += (sender, e) =>
                {
                    tsbShowBookmarks.Checked = !mBookmarks.IsHidden;
                };
            }

            mFilter = new FrmLogFilter(
                logProvider
                , (ILogFilterHandler)mLogWindow);

            mFilter.VisibleChanged += (sender, e) =>
            {
                tsbShowFilter.Checked = !mFilter.IsHidden;
            };

            ((FrmLogWindow)mLogWindow).OnLogMessageSelected += OnLogMessageSelected;

            LogDockPanel.Theme = ThemeManager.CurrentApplicationTheme.DockingTheme;

            SetTimeshiftValue();
        }