Beispiel #1
0
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            try
            {
                _logMsgTimer?.Dispose();
                _logMsgTimer = null;

                _taskbarProgressTimer?.Dispose();
                _taskbarProgressTimer = null;


                if (_configuration.Layout.LogListViewColumnsWidths == null ||
                    _configuration.Layout.LogListViewColumnsWidths.Length != logListView.Columns.Count)
                {
                    _configuration.Layout.LogListViewColumnsWidths = new int[logListView.Columns.Count];
                }

                for (var i = 0; i < logListView.Columns.Count; i++)
                {
                    _configuration.Layout.LogListViewColumnsWidths[i] = logListView.Columns[i].Width;
                }

                _configuration.Layout.Set(_windowRestorer.WindowPosition, _windowRestorer.WindowState, logDetailPanel,
                                          loggerPanel);

                _configuration.Save();
                _configuration.Close();
            }
            catch
            {
                // ignored
            }
        }