Example #1
0
        private void loggerClockRemoved_event(object sender, ClockHandlerEventArgs e)
        {
            TreeIter removedIter;

            if (!_comboNameIters.TryGetValue(e.LoggingHandler, out removedIter))
            {
                Console.Error.WriteLine("Failed to get clock treeiter name \"" + e.LoggingHandler.Name + "\".");
                return;
            }

            _handlerListStore.Remove(ref removedIter);

            if (_currentHandler == e.LoggingHandler)
            {
                ChangeHandler(null);

                // If there are any stopwatches left, change to the first one
                // Otherwise clear the stopwatch name entry
                TreeIter firstIter;
                if (_handlerListStore.GetIterFirst(out firstIter))
                {
                    watchNameCombo.Entry.Text = _handlerListStore.GetValue(firstIter, watchNameCombo.TextColumn) as String;
                }
                else
                {
                    watchNameCombo.Entry.Text = "";
                }

                RefreshControls();
            }
        }
Example #2
0
        void loggerClockAdded_event(object sender, ClockHandlerEventArgs e)
        {
            StopwatchWindow newWindow = new StopwatchWindow(this, e.LoggingHandler);

            newWindow.Compact = Settings.WatchCompactByDefault;
            newWindow.Docked  = Settings.WatchDockedByDefault;

            clockWindows.Add(e.LoggingHandler, newWindow);
        }
Example #3
0
        void loggerClockRemoved_event(object sender, ClockHandlerEventArgs e)
        {
            StopwatchWindow obsoleteWindow;

            if (!clockWindows.TryGetValue(e.LoggingHandler, out obsoleteWindow))
            {
                return;
            }

            obsoleteWindow.Destroy();
            clockWindows.Remove(e.LoggingHandler);
        }
Example #4
0
        private void loggerClockAdded_event(object sender, ClockHandlerEventArgs e)
        {
            bool first = _comboNameIters.Count == 0;

            TreeIter iter = _handlerListStore.AppendValues(e.LoggingHandler, e.LoggingHandler.Name);

            _comboNameIters.Add(e.LoggingHandler, iter);

            if (first)
            {
                ChangeHandler(e.LoggingHandler);
                watchNameCombo.Active = 0;
            }
        }
Example #5
0
        private void loggerClockRenamed_event(object sender, ClockHandlerEventArgs e)
        {
            TreeIter renamedIter;

            if (!_comboNameIters.TryGetValue(e.LoggingHandler, out renamedIter))
            {
                Console.Error.WriteLine("Failed to get clock treeiter name \"" + e.LoggingHandler.Name + "\".");
                return;
            }

            _handlerListStore.SetValue(renamedIter, 1, e.LoggingHandler.Name);

            _refreshing = true;

            if (_currentHandler == e.LoggingHandler)
            {
                watchNameCombo.Entry.Text = _currentHandler.Name;
            }

            _refreshing = false;
        }