Esempio n. 1
0
		public static void HideAlert ()
		{
			if (updateIcon != null) {
				updateIcon.Dispose ();
				updateIcon = null;
			}
		}
		public override void Dispose()
		{
			base.Dispose ();
			Application.Invoke (delegate {
				if (icon != null) {
					icon.Dispose ();
					icon = null;
				}
			});
		}
Esempio n. 3
0
 internal void HideStatusIcon()
 {
     Gtk.Application.Invoke(delegate {
         workspacesLoading--;
         if (workspacesLoading == 0 && statusIcon != null)
         {
             statusIcon.Dispose();
             statusIcon = null;
             OnLoadingFinished(EventArgs.Empty);
         }
     });
 }
 internal static void HideTypeInformationGatheringIcon(Action callback = null)
 {
     Gtk.Application.Invoke((o, args) => {
         workspacesLoading--;
         if (workspacesLoading == 0 && statusIcon != null)
         {
             statusIcon.Dispose();
             statusIcon = null;
             callback?.Invoke();
         }
     });
 }
		public BackgroundProgressMonitor (string title, IconId iconName)
		{
			this.title = title;
			if (!iconName.IsNull) {
				Application.Invoke (delegate {
					Gdk.Pixbuf img = ImageService.GetPixbuf (iconName, IconSize.Menu);
					icon = IdeApp.Workbench.StatusBar.ShowStatusIcon (img);
					if (icon == null)
						LoggingService.LogError ("Icon '" + iconName + "' not found.");
				});
			}
		}
Esempio n. 6
0
 public override void Dispose()
 {
     base.Dispose();
     Application.Invoke(delegate
     {
         if (icon != null)
         {
             icon.Dispose();
             icon = null;
         }
     });
 }
Esempio n. 7
0
        bool CreatePopoverForIcon(StatusBarIcon icon)
        {
            string tooltip = icon.ToolTip;

            if (tooltip == null)
            {
                return(false);
            }

            CreatePopoverCommon(230, tooltip);
            return(true);
        }
Esempio n. 8
0
 static void NotifyError(LogMessage message)
 {
     if (!errorNotificationEnabled)
     {
         return;
     }
     ClearErrorIcon();
     Gdk.Pixbuf pix = ImageService.GetPixbuf(Gtk.Stock.DialogError, Gtk.IconSize.Menu);
     errorIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon(pix);
     errorIcon.EventBox.ButtonPressEvent += new Gtk.ButtonPressEventHandler(OnShowLogPad);
     errorIcon.SetAlertMode(5);
     errorIcon.ToolTip = message.Message;
 }
Esempio n. 9
0
		static void NotifyError (LogMessage message)
		{
			if (!errorNotificationEnabled)
				return;
			ClearErrorIcon ();
			var pix = ImageService.GetIcon (Gtk.Stock.DialogError, Gtk.IconSize.Menu);
			errorIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (pix);
			errorIcon.Clicked += delegate {
				ClearErrorIcon ();
				MessageService.ShowError (message.Message);
			};
			errorIcon.SetAlertMode (5);
			errorIcon.ToolTip = message.Message;
		}
		static void NotifyError (LogMessage message)
		{
			if (!errorNotificationEnabled)
				return;
			ClearErrorIcon ();
			Gdk.Pixbuf pix = ImageService.GetPixbuf (Gtk.Stock.DialogError, Gtk.IconSize.Menu);
			errorIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (pix);
			errorIcon.EventBox.ButtonPressEvent += delegate {
				ClearErrorIcon ();
				MessageService.ShowError (message.Message);
			};
			errorIcon.SetAlertMode (5);
			errorIcon.ToolTip = message.Message;
		}
Esempio n. 11
0
 void ShowStatusIcon()
 {
     Runtime.RunInMainThread(() => {
         if (statusBarIcon == null)
         {
             var icon               = ImageService.GetIcon("md-text-file-icon", Gtk.IconSize.Menu);
             statusBarIcon          = IdeApp.Workbench.StatusBar.ShowStatusIcon(icon);
             statusBarIcon.Clicked += StatusBarIconClicked;
         }
         statusBarIcon.Title   = GettextCatalog.GetString("IDE log errors");
         statusBarIcon.ToolTip = GettextCatalog.GetPluralString("{0} IDE log error", "{0} IDE log errors", errorsCount, errorsCount);
         statusBarIcon.SetAlertMode(1);
     }).Ignore();
 }
Esempio n. 12
0
 internal static void ShowTypeInformationGatheringIcon()
 {
     Gtk.Application.Invoke((o, args) => {
         workspacesLoading++;
         if (statusIcon != null)
         {
             return;
         }
         statusIcon = IdeApp.Workbench?.StatusBar.ShowStatusIcon(ImageService.GetIcon("md-parser"));
         if (statusIcon != null)
         {
             statusIcon.ToolTip = GettextCatalog.GetString("Gathering class information");
         }
     });
 }
 public BackgroundProgressMonitor(string title, IconId iconName)
 {
     this.title = title;
     if (!iconName.IsNull)
     {
         Application.Invoke(delegate {
             Gdk.Pixbuf img = ImageService.GetPixbuf(iconName, Gtk.IconSize.Menu);
             icon           = IdeApp.Workbench.StatusBar.ShowStatusIcon(img);
             if (icon == null)
             {
                 LoggingService.LogError("Icon '" + iconName + "' not found.");
             }
         });
     }
 }
Esempio n. 14
0
		void WarnAvailableUpdates ()
		{
			if (!UpdateService.NotifyAddinUpdates)
				return;
			
			updateIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (ImageService.GetPixbuf ("md-software-update", IconSize.Menu));
			string s = GettextCatalog.GetString ("New add-in updates are available:");
			for (int n=0; n<updates.Length && n < 10; n++)
				s += "\n" + updates [n].Addin.Name;
			
			if (updates.Length > 10)
				s += "\n...";

			updateIcon.ToolTip = s;
			updateIcon.SetAlertMode (20);
			updateIcon.EventBox.ButtonPressEvent += new ButtonPressEventHandler (OnUpdateClicked);
		}
Esempio n. 15
0
 public void Attach(StatusBar delegatedStatusBar)
 {
     wrapped          = delegatedStatusBar.ShowStatusIcon(pixbuf);
     wrapped.Clicked += Wrapped_Clicked;
     if (title != null)
     {
         wrapped.Title = title;
     }
     if (tooltip != null)
     {
         wrapped.ToolTip = tooltip;
     }
     if (help != null)
     {
         wrapped.Help = help;
     }
 }
Esempio n. 16
0
		void WarnAvailableUpdates ()
		{
			if (!UpdateService.NotifyAddinUpdates)
				return;

			updateIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (ImageService.GetIcon ("md-updates", IconSize.Menu));
			string s = GettextCatalog.GetString ("New add-in updates are available:");
			for (int n=0; n<updates.Length && n < 10; n++)
				s += "\n" + updates [n].Addin.Name;

			if (updates.Length > 10)
				s += "\n...";

			updateIcon.ToolTip = s;
			updateIcon.SetAlertMode (20);
			updateIcon.Clicked += OnUpdateClicked;
		}
 public BackgroundProgressMonitor(string title, IconId iconName)
 {
     this.title = title;
     if (!iconName.IsNull)
     {
         Application.Invoke((o, args) => {
             var img    = ImageService.GetIcon(iconName, IconSize.Menu);
             icon       = IdeApp.Workbench.StatusBar.ShowStatusIcon(img);
             icon.Title = GettextCatalog.GetString("Background Progress");
             icon.Help  = GettextCatalog.GetString("An operation is occuring in the background");
             if (icon == null)
             {
                 LoggingService.LogError("Icon '" + iconName + "' not found.");
             }
         });
     }
 }
Esempio n. 18
0
        static void NotifyError(LogMessage message)
        {
            if (!errorNotificationEnabled)
            {
                return;
            }
            ClearErrorIcon();
            var pix = ImageService.GetIcon(Gtk.Stock.DialogError, Gtk.IconSize.Menu);

            errorIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon(pix);
            errorIcon.EventBox.ButtonPressEvent += delegate {
                ClearErrorIcon();
                MessageService.ShowError(message.Message);
            };
            errorIcon.SetAlertMode(5);
            errorIcon.ToolTip = message.Message;
        }
    void WarnAvailableUpdates ()
    {
        if (!UpdateService.NotifyAddinUpdates)
            return;

        updateIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (ImageService.GetPixbuf ("md-software-update", IconSize.Menu));
        string s = GettextCatalog.GetString ("New add-in updates are available:");
        for (int n=0; n<updates.Length && n < 10; n++)
            s += "\n" + updates [n].Addin.Name;

        if (updates.Length > 10)
            s += "\n...";

        updateIcon.ToolTip = s;
        updateIcon.SetAlertMode (20);
        updateIcon.EventBox.ButtonPressEvent += new ButtonPressEventHandler (OnUpdateClicked);
    }
Esempio n. 20
0
 static void UpdateInstrumentationIcon()
 {
     if (IdeApp.Preferences.EnableInstrumentation)
     {
         if (instrumentationStatusIcon == null)
         {
             instrumentationStatusIcon          = IdeApp.Workbench.StatusBar.ShowStatusIcon(ImageService.GetIcon(MonoDevelop.Ide.Gui.Stock.Information));
             instrumentationStatusIcon.ToolTip  = "Instrumentation service enabled";
             instrumentationStatusIcon.Clicked += delegate {
                 InstrumentationService.StartMonitor();
             };
         }
     }
     else if (instrumentationStatusIcon != null)
     {
         instrumentationStatusIcon.Dispose();
     }
 }
Esempio n. 21
0
 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();
     }
 }
Esempio n. 22
0
        void WarnAvailableUpdates()
        {
            if (!UpdateService.NotifyAddinUpdates)
            {
                return;
            }

            updateIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon(ImageService.GetIcon("md-updates", IconSize.Menu));
            string s = GettextCatalog.GetString("New add-in updates are available:");

            for (int n = 0; n < updates.Length && n < 10; n++)
            {
                s += "\n" + updates [n].Addin.Name;
            }

            if (updates.Length > 10)
            {
                s += "\n...";
            }

            updateIcon.ToolTip = s;
            updateIcon.SetAlertMode(20);
            updateIcon.Clicked += OnUpdateClicked;
        }
		static void Cleanup ()
		{
			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.ExceptionHandler = 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;

			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 ();
			}
		}
Esempio n. 24
0
		static void UpdateInstrumentationIcon ()
		{
			if (IdeApp.Preferences.EnableInstrumentation) {
				if (instrumentationStatusIcon == null) {
					instrumentationStatusIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.Information));
					instrumentationStatusIcon.ToolTip = "Instrumentation service enabled";
					instrumentationStatusIcon.Clicked += delegate {
						InstrumentationService.StartMonitor ();
					};
				}
			} else if (instrumentationStatusIcon != null) {
				instrumentationStatusIcon.Dispose ();
			}
		}
Esempio n. 25
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 ();
			}
		}
Esempio n. 26
0
		static void Cleanup ()
		{
			DebuggerSession currentSession;
			StatusBarIcon currentIcon;
			IConsole currentConsole;

			lock (cleanup_lock) {
				if (!IsDebugging)
					return;

				currentIcon = busyStatusIcon;
				currentSession = session;
				currentConsole = console;

				currentBacktrace = null;
				busyStatusIcon = null;
				session = null;
				console = null;
			}

			if (oldLayout != null) {
				string layout = oldLayout;
				oldLayout = null;

				// Dispatch synchronously to avoid start/stop races
				DispatchService.GuiSyncDispatch (delegate {
					IdeApp.Workbench.HideCommandBar ("Debug");
					if (IdeApp.Workbench.CurrentLayout == "Debug")
						IdeApp.Workbench.CurrentLayout = layout;
				});
			}

			currentSession.BusyStateChanged -= OnBusyStateChanged;
			currentSession.TargetEvent -= OnTargetEvent;
			currentSession.TargetStarted -= OnStarted;

			currentSession.BreakpointTraceHandler = null;
			currentSession.GetExpressionEvaluator = null;
			currentSession.TypeResolverHandler = null;
			currentSession.OutputWriter = null;
			currentSession.LogWriter = null;
			
			if (currentConsole != null) {
				currentConsole.CancelRequested -= OnCancelRequested;
				currentConsole.Dispose ();
			}
			
			DispatchService.GuiDispatch (delegate {
				HideExceptionCaughtDialog ();

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

				if (StoppedEvent != null)
					StoppedEvent (null, new EventArgs ());

				NotifyCallStackChanged ();
				NotifyCurrentFrameChanged ();
				NotifyLocationChanged ();
			});

			currentSession.Dispose ();
		}
Esempio n. 27
0
		internal void HideStatusIcon ()
		{
			Gtk.Application.Invoke (delegate {
				workspacesLoading--;
				if (workspacesLoading == 0 && statusIcon != null) {
					statusIcon.Dispose ();
					statusIcon = null;
					OnLoadingFinished (EventArgs.Empty);
					WorkspaceLoaded?.Invoke (this, EventArgs.Empty);
				}
			});
		}
Esempio n. 28
0
		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 ();
			}
		}
		internal void ShowStatusIcon ()
		{
			Gtk.Application.Invoke (delegate {
				workspacesLoading++;
				if (statusIcon != null)
					return;
				statusIcon = IdeApp.Workbench?.StatusBar.ShowStatusIcon (ImageService.GetIcon ("md-parser"));
			});
		}
Esempio n. 30
0
        static void Cleanup()
        {
            DebuggerSession  currentSession;
            StatusBarIcon    currentIcon;
            OperationConsole currentConsole;

            lock (cleanup_lock) {
                if (!IsDebugging)
                {
                    return;
                }

                currentIcon    = busyStatusIcon;
                currentSession = session;
                currentConsole = console;

                nextStatementLocations.Clear();
                currentBacktrace = null;
                busyStatusIcon   = null;
                session          = null;
                console          = null;
                pinnedWatches.InvalidateAll();
            }

            UnsetDebugLayout();

            currentSession.BusyStateChanged -= OnBusyStateChanged;
            currentSession.TargetEvent      -= OnTargetEvent;
            currentSession.TargetStarted    -= OnStarted;

            currentSession.BreakpointTraceHandler = null;
            currentSession.GetExpressionEvaluator = null;
            currentSession.TypeResolverHandler    = null;
            currentSession.OutputWriter           = null;
            currentSession.LogWriter = null;
            currentDebugOperation.Cleanup();

            if (currentConsole != null)
            {
                cancelRegistration.Dispose();
                currentConsole.Dispose();
            }

            Runtime.RunInMainThread(delegate {
                HideExceptionCaughtDialog();

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

                if (StoppedEvent != null)
                {
                    StoppedEvent(null, new EventArgs());
                }

                NotifyCallStackChanged();
                NotifyCurrentFrameChanged();
                NotifyLocationChanged();
            });

            currentSession.Dispose();
        }
Esempio n. 31
0
 /// <summary>
 /// Set the application's status bar information. This is the prefered way
 /// to change these informations.
 /// </summary>
 public static void SetStatusBar(StatusBarIcon i, String text)
 {
     if (!IsUiStateOK()) return;
     UiBroker.SetStatusbar(i, text);
 }
Esempio n. 32
0
		static void Cleanup ()
		{
			DebuggerSession currentSession;
			StatusBarIcon currentIcon;
			IConsole currentConsole;

			lock (cleanup_lock) {
				if (!IsDebugging)
					return;

				currentIcon = busyStatusIcon;
				currentSession = session;
				currentConsole = console;

				nextStatementLocations.Clear ();
				currentBacktrace = null;
				busyStatusIcon = null;
				session = null;
				console = null;
				pinnedWatches.InvalidateAll ();
			}

			if (oldLayout != null) {
				string layout = oldLayout;
				oldLayout = null;

				UnsetDebugLayout (layout);
			}

			currentSession.BusyStateChanged -= OnBusyStateChanged;
			currentSession.TargetEvent -= OnTargetEvent;
			currentSession.TargetStarted -= OnStarted;

			currentSession.BreakpointTraceHandler = null;
			currentSession.GetExpressionEvaluator = null;
			currentSession.TypeResolverHandler = null;
			currentSession.OutputWriter = null;
			currentSession.LogWriter = null;
			
			if (currentConsole != null) {
				currentConsole.CancelRequested -= OnCancelRequested;
				currentConsole.Dispose ();
			}
			
			DispatchService.GuiDispatch (delegate {
				HideExceptionCaughtDialog ();

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

				if (StoppedEvent != null)
					StoppedEvent (null, new EventArgs ());

				NotifyCallStackChanged ();
				NotifyCurrentFrameChanged ();
				NotifyLocationChanged ();
			});

			currentSession.Dispose ();
		}
Esempio n. 33
0
        /// <summary>
        /// Set an icon and a message in the status bar.
        /// </summary>
        public void PostStatus(StatusBarIcon icon, String message)
        {
            if (m_stopFlag) return;

            Logging.Log("Stopping the Status timer.");
            m_timer.Stop();

            // Set the icon and the message directly in the status bar.
            m_mainForm.StatusBarImage = GetImageForStatusBarIcon(icon);
            m_mainForm.StatusBarText = message;
            Logging.Log("Starting the Status timer.");
            m_timer.Start();
        }
Esempio n. 34
0
        static void Cleanup()
        {
            DebuggerSession currentSession;
            StatusBarIcon   currentIcon;
            IConsole        currentConsole;

            lock (cleanup_lock) {
                if (!IsDebugging)
                {
                    return;
                }

                currentIcon    = busyStatusIcon;
                currentSession = session;
                currentConsole = console;

                currentBacktrace = null;
                busyStatusIcon   = null;
                session          = null;
                console          = null;
            }

            if (oldLayout != null)
            {
                string layout = oldLayout;
                oldLayout = null;

                // Dispatch synchronously to avoid start/stop races
                DispatchService.GuiSyncDispatch(delegate {
                    IdeApp.Workbench.HideCommandBar("Debug");
                    if (IdeApp.Workbench.CurrentLayout == "Debug")
                    {
                        IdeApp.Workbench.CurrentLayout = layout;
                    }
                });
            }

            currentSession.BusyStateChanged -= OnBusyStateChanged;
            currentSession.TargetEvent      -= OnTargetEvent;
            currentSession.TargetStarted    -= OnStarted;

            currentSession.BreakpointTraceHandler = null;
            currentSession.GetExpressionEvaluator = null;
            currentSession.TypeResolverHandler    = null;
            currentSession.OutputWriter           = null;
            currentSession.LogWriter = null;

            if (currentConsole != null)
            {
                currentConsole.CancelRequested -= OnCancelRequested;
                currentConsole.Dispose();
            }

            DispatchService.GuiDispatch(delegate {
                HideExceptionCaughtDialog();

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

                if (StoppedEvent != null)
                {
                    StoppedEvent(null, new EventArgs());
                }

                NotifyCallStackChanged();
                NotifyCurrentFrameChanged();
                NotifyLocationChanged();
            });

            currentSession.Dispose();
        }
Esempio n. 35
0
		bool CreatePopoverForIcon (StatusBarIcon icon)
		{
			string tooltip = icon.ToolTip;
			if (tooltip == null)
				return false;

			CreatePopoverCommon (230, tooltip);
			return true;
		}
Esempio n. 36
0
		internal void ShowStatusIcon ()
		{
			Gtk.Application.Invoke (delegate {
				workspacesLoading++;
				if (statusIcon != null)
					return;
				statusIcon = IdeApp.Workbench?.StatusBar.ShowStatusIcon (ImageService.GetIcon ("md-parser"));
				if (statusIcon != null)
					statusIcon.ToolTip = GettextCatalog.GetString ("Gathering class information");
			});
		}
Esempio n. 37
0
        static void Cleanup()
        {
            DebuggerSession currentSession;
            StatusBarIcon   currentIcon;
            IConsole        currentConsole;

            lock (cleanup_lock) {
                if (!IsDebugging)
                {
                    return;
                }

                currentIcon    = busyStatusIcon;
                currentSession = session;
                currentConsole = console;

                currentBacktrace = null;
                busyStatusIcon   = null;
                session          = null;
                console          = null;
                pinnedWatches.InvalidateAll();
            }

            if (oldLayout != null)
            {
                string layout = oldLayout;
                oldLayout = null;

                UnsetDebugLayout(layout);
            }

            currentSession.BusyStateChanged -= OnBusyStateChanged;
            currentSession.TargetEvent      -= OnTargetEvent;
            currentSession.TargetStarted    -= OnStarted;

            currentSession.BreakpointTraceHandler = null;
            currentSession.GetExpressionEvaluator = null;
            currentSession.TypeResolverHandler    = null;
            currentSession.OutputWriter           = null;
            currentSession.LogWriter = null;

            if (currentConsole != null)
            {
                currentConsole.CancelRequested -= OnCancelRequested;
                currentConsole.Dispose();
            }

            DispatchService.GuiDispatch(delegate {
                HideExceptionCaughtDialog();

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

                if (StoppedEvent != null)
                {
                    StoppedEvent(null, new EventArgs());
                }

                NotifyCallStackChanged();
                NotifyCurrentFrameChanged();
                NotifyLocationChanged();
            });

            currentSession.Dispose();
        }
Esempio n. 38
0
		public static void ClearErrorIcon ()
		{
			if (errorIcon != null) {
				errorIcon.Dispose ();
				errorIcon = null;
			}
		}
Esempio n. 39
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();
            }
        }
Esempio n. 40
0
		static void OnBusyStateChanged (object s, BusyStateEventArgs args)
		{
			isBusy = args.IsBusy;
			DispatchService.GuiDispatch (delegate {
				busyDialog.UpdateBusyState (args);
				if (args.IsBusy) {
					if (busyStatusIcon == null) {
						busyStatusIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (ImageService.GetPixbuf ("md-execute-debug", Gtk.IconSize.Menu));
						busyStatusIcon.SetAlertMode (100);
						busyStatusIcon.ToolTip = GettextCatalog.GetString ("The Debugger is waiting for an expression evaluation to finish.");
						busyStatusIcon.EventBox.ButtonPressEvent += delegate {
							busyDialog.Show ();
						};
					}
				} else {
					if (busyStatusIcon != null) {
						busyStatusIcon.Dispose ();
						busyStatusIcon = null;
					}
				}
			});
		}
Esempio n. 41
0
 /// <summary>
 /// Return the image associated to the given StatusBarIcon.
 /// </summary>
 private Image GetImageForStatusBarIcon(StatusBarIcon i)
 {
     switch (i)
     {
         case StatusBarIcon.OK:
             return Properties.Resources.GreenCheck2;
         default:
             return Properties.Resources.Red_x_48x48;
     }
 }