/// <summary> /// Raises Exit event /// </summary> /// <param name="e">event args</param> protected override void OnExit(ExitEventArgs e) { UPnPDevice.Instance.Stop(); SystrayIcon.Dispose(); SystrayIcon = null; base.OnExit(e); }
/// <summary> /// Raises Startup event /// </summary> /// <param name="e">event args</param> protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var systrayIcon = new SystrayIcon(); SystrayIcon = systrayIcon; var systrayIconPresenter = new SystrayIconPresenter(systrayIcon); systrayIconPresenter.ShowBalloonTip(FreeMi.Core.Application.AssemblyCopyright, ToolTipIcon.None, 2000); Trace.Listeners.Add(new SystrayTraceListener(SystrayIcon)); systrayIconPresenter.CheckNewVersionAvailable(); if (Core.Application.RunningMode == RunningMode.Service) { systrayIconPresenter.ShowMainWindow(); new WindowsServiceManager().StartService(); } else { UPnPDevice.Instance.Start(); } }
/// <summary> /// Displays a balloon tip in the taskbar for the specified time period /// </summary> /// <param name="text">text to show</param> /// <param name="toolTipIcon">toolTip icon</param> /// <param name="timeout">The time period, in milliseconds, the balloon tip should display</param> public void ShowBalloonTip(string text, ToolTipIcon toolTipIcon = ToolTipIcon.None, int timeout = 5000) { SystrayIcon.ShowBalloonTip(text, toolTipIcon, timeout); }
/// <summary> /// Initializes a new instance of SystrayTraceListener class /// </summary> /// <param name="systrayIcon">SystrayIcon</param> public SystrayTraceListener(SystrayIcon systrayIcon) { SystrayIcon = systrayIcon; }