Beispiel #1
0
		public NotifyIconService([NotNull] IServiceProvider serviceProvider)
		{
			if (serviceProvider == null)
				throw new ArgumentNullException(nameof(serviceProvider));

			_serviceManager = new ServiceContainer(serviceProvider);
			_defaultCommandService = new DefaultCommandService("Janus.Application.ShowMainForm");
			_serviceManager.Publish(_defaultCommandService);

			_uiAsyncOperation = _serviceManager
				.GetRequiredService<IUIShell>()
				.CreateUIAsyncOperation();

			_uiAsyncOperation.Send(
				() =>
				{
					_notifyIcon = new NotifyIcon();
					_notifyIcon.DoubleClick += NotifyIconDefaultAction;
					_notifyIcon.BalloonTipClicked += NotifyIconDefaultAction;
					Ticker.Instance.DoubleClick += NotifyIconDefaultAction;
				});
		}