本文整理汇总了C#中StatusBarIcon类的典型用法代码示例。如果您正苦于以下问题:C# StatusBarIcon类的具体用法?C# StatusBarIcon怎么用?C# StatusBarIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StatusBarIcon类属于命名空间,在下文中一共展示了StatusBarIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatePopoverForIcon
bool CreatePopoverForIcon (StatusBarIcon icon)
{
string tooltip = icon.ToolTip;
if (tooltip == null)
return false;
CreatePopoverCommon (230, tooltip);
return true;
}
示例2: GetImageForStatusBarIcon
/// <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;
}
}
示例3: PostStatus
/// <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();
}
示例4: Cleanup
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 ();
}
示例5: Cleanup
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 ();
}
示例6: HideAlert
public static void HideAlert ()
{
if (updateIcon != null) {
updateIcon.Dispose ();
updateIcon = null;
}
}
示例7: Dispose
public override void Dispose()
{
base.Dispose ();
Application.Invoke (delegate {
if (icon != null) {
icon.Dispose ();
icon = null;
}
});
}
示例8: BackgroundProgressMonitor
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.");
});
}
}
示例9: NotifyError
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;
}
示例10: NotifyError
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;
}
示例11: WarnAvailableUpdates
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);
}
示例12: WarnAvailableUpdates
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;
}
示例13: UpdateInstrumentationIcon
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 ();
}
}
示例14: Cleanup
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 ();
}
}
示例15: UpdateInstrumentationIcon
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 ();
}
}