/// <summary> /// Application Context used for NotifyIcon. /// </summary> /// <param name="hosts"></param> public HostedApplicationContext(IEnumerable <IHost> hosts) { _host = new CompositeHost(hosts); _notifyIcon = NotifyIcon.Builder.Build(); _notifyIcon.Exit += NotifyIcon_Exit; Run(); }
public PresentationController(IEntryPresenter entryPresenter, IReportPresenter reportPresenter, INotifyIcon notifiyIcon) { _entryPresenter = entryPresenter; _reportPresenter = reportPresenter; _notifyIcon = notifiyIcon; _notifyIcon.ShowReport += OnShowReport; }
protected virtual void OnLoaded(object sender, RoutedEventArgs e) { this.NotifyIcon = ComponentRegistry.Instance.GetComponent <INotifyIcon>(); if (this.IsEnabled) { this.Show(); } else { this.Hide(); } }
public ApplicationModel(INotifyIcon notifyIcon, IMainViewFactory mainViewFactory, ISettingsViewFactory settingsViewFactory) { _notifyItemSelectedActions = new Dictionary<string, Action>() { { NotifyIconActions.ShowMainUI.GetDescription(), () => mainViewFactory.Build().Show() }, { NotifyIconActions.ShowSettingsUI.GetDescription(), () => settingsViewFactory.Build().Show() }, { NotifyIconActions.ExitApplication.GetDescription(), () => Exit() } }; _notifyIcon = notifyIcon; _notifyIcon.ItemSelected += HandleNotifyIconItemSelected; }
public TrayApplication([NotNull] IContextMenu contextMenu, [NotNull] IApplication application, [NotNull] IProvideNotifyIcon notifyIconProvider, [NotNull] IProvideIcon trayIconProvider, [CanBeNull] IRunTheBackgroundTrayApp background = null, [CanBeNull] EventHandler doubleClickAction = null) { m_contextMenu = contextMenu ?? throw new ArgumentNullException(nameof(contextMenu)); m_application = application ?? throw new ArgumentNullException(nameof(application)); m_notifyIconProvider = notifyIconProvider ?? throw new ArgumentNullException(nameof(notifyIconProvider)); m_trayIconProvider = trayIconProvider ?? throw new ArgumentNullException(nameof(trayIconProvider)); m_background = background; m_notifyIcon = m_notifyIconProvider.Provide(); m_application.Exit += ApplicationOnExit; m_notifyIcon.Visible = true; m_notifyIcon.ContextMenu = m_contextMenu; if (doubleClickAction != null) { m_notifyIcon.DoubleClick += doubleClickAction; } }
public void SetUp() { _notifyIcon = MockRepository.GenerateMock<INotifyIcon>(); }
public NotifyIconPresenter(INotifyIcon notifyIcon) { _notifyIcon = notifyIcon; }
public PresentationController(INotifyIcon notifyIcon) { _notifyIcon = notifyIcon; }