示例#1
0
文件: Ide.cs 项目: thild/monodevelop
 static void UpdateInstrumentationIcon()
 {
     if (IdeApp.Preferences.EnableInstrumentation)
     {
         if (instrumentationStatusIcon == null)
         {
             instrumentationStatusIcon         = IdeApp.Workbench.StatusBar.ShowStatusIcon(ImageService.GetPixbuf(Gtk.Stock.DialogInfo));
             instrumentationStatusIcon.ToolTip = "Instrumentation service enabled";
             instrumentationStatusIcon.EventBox.ButtonPressEvent += delegate {
                 InstrumentationService.StartMonitor();
             };
         }
     }
     else if (instrumentationStatusIcon != null)
     {
         instrumentationStatusIcon.Dispose();
     }
 }
示例#2
0
 static void UpdateInstrumentationIcon()
 {
     if (IdeApp.Preferences.EnableInstrumentation)
     {
         if (instrumentationStatusIcon == null)
         {
             instrumentationStatusIcon          = IdeApp.Workbench.StatusBar.ShowStatusIcon(ImageService.GetIcon(MonoDevelop.Ide.Gui.Stock.StatusInstrumentation));
             instrumentationStatusIcon.ToolTip  = "Instrumentation service enabled";
             instrumentationStatusIcon.Clicked += delegate {
                 InstrumentationService.StartMonitor();
             };
         }
     }
     else if (instrumentationStatusIcon != null)
     {
         instrumentationStatusIcon.Dispose();
     }
 }
示例#3
0
 static void UpdateInstrumentationIcon()
 {
     if (IdeApp.Preferences.EnableInstrumentation)
     {
         if (instrumentationStatusIcon == null)
         {
             instrumentationStatusIcon          = IdeApp.Workbench.StatusBar.ShowStatusIcon(ImageService.GetIcon(MonoDevelop.Ide.Gui.Stock.StatusInstrumentation));
             instrumentationStatusIcon.Title    = GettextCatalog.GetString("Instrumentation");
             instrumentationStatusIcon.ToolTip  = GettextCatalog.GetString("Instrumentation service enabled");
             instrumentationStatusIcon.Help     = GettextCatalog.GetString("Information about the Instrumentation Service");
             instrumentationStatusIcon.Clicked += delegate {
                 InstrumentationService.StartMonitor();
             };
         }
     }
     else if (instrumentationStatusIcon != null)
     {
         instrumentationStatusIcon.Dispose();
     }
 }
示例#4
0
        static void Cleanup()
        {
            if (oldLayout != null)
            {
                string layout = oldLayout;
                oldLayout = null;
                // Dispatch asynchronously to avoid start/stop races
                DispatchService.GuiSyncDispatch(delegate {
                    if (IdeApp.Workbench.CurrentLayout == "Debug")
                    {
                        IdeApp.Workbench.CurrentLayout = layout;
                    }
                });
            }

            currentBacktrace = null;

            if (!IsDebugging)
            {
                return;
            }

            if (busyStatusIcon != null)
            {
                busyStatusIcon.Dispose();
                busyStatusIcon = null;
            }

            session.TargetEvent           -= OnTargetEvent;
            session.TargetStarted         -= OnStarted;
            session.OutputWriter           = null;
            session.LogWriter              = null;
            session.BusyStateChanged      -= OnBusyStateChanged;
            session.TypeResolverHandler    = null;
            session.BreakpointTraceHandler = null;
            session.GetExpressionEvaluator = null;
            console.CancelRequested       -= OnCancelRequested;

            // Dispose the session at the end, since it may take a while.
            DebuggerSession oldSession = session;

            session = null;

            DispatchService.GuiDispatch(delegate {
                if (StoppedEvent != null)
                {
                    StoppedEvent(null, new EventArgs());
                }
            });

            if (console != null)
            {
                console.Dispose();
                console = null;
            }

            DispatchService.GuiDispatch(delegate {
                NotifyCallStackChanged();
                NotifyCurrentFrameChanged();
                NotifyLocationChanged();
            });

            if (oldSession != null)
            {
                oldSession.BusyStateChanged -= OnBusyStateChanged;
                oldSession.Dispose();
            }
        }