示例#1
0
文件: Ticker.cs 项目: rsdn/janus
		private Ticker([NotNull] IServiceProvider provider)
		{
			if (provider == null)
				throw new ArgumentNullException(nameof(provider));

			_serviceProvider = provider;
			_forumsAggregatesService = _serviceProvider.GetRequiredService<IForumsAggregatesService>();
			_aggregatesChangedSubscription =
				_forumsAggregatesService.AggregatesChanged.Subscribe(arg => UpdateUnread());

			BorderColor = Color.White;
			//			_janusApplication = ApplicationManager.Instance;
			FormBorderStyle = FormBorderStyle.FixedToolWindow;
			Size = new Size(160, 32);
			TopMost = true;
			ShowInTaskbar = false;

			StartPosition = FormStartPosition.Manual;

			SetStyle(ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true);
			_backImage = new Bitmap(
				Assembly
					.GetAssembly(GetType())
					.GetRequiredResourceStream("Rsdn.Janus.Core.Ticker.tickerbg.png"));

			BackColor = Color.FromArgb(255, 0, 255);
			TransparencyKey = BackColor;

			CustomInitializeComponents();
		}
示例#2
0
        private Ticker([NotNull] IServiceProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            _serviceProvider               = provider;
            _forumsAggregatesService       = _serviceProvider.GetRequiredService <IForumsAggregatesService>();
            _aggregatesChangedSubscription =
                _forumsAggregatesService.AggregatesChanged.Subscribe(arg => UpdateUnread());

            BorderColor = Color.White;
            //			_janusApplication = ApplicationManager.Instance;
            FormBorderStyle = FormBorderStyle.FixedToolWindow;
            Size            = new Size(160, 32);
            TopMost         = true;
            ShowInTaskbar   = false;

            StartPosition = FormStartPosition.Manual;

            SetStyle(ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true);
            _backImage = new Bitmap(
                Assembly
                .GetAssembly(GetType())
                .GetRequiredResourceStream("Rsdn.Janus.Core.Ticker.tickerbg.png"));

            BackColor       = Color.FromArgb(255, 0, 255);
            TransparencyKey = BackColor;

            CustomInitializeComponents();
        }
示例#3
0
		public NotifyIconActivePart([NotNull] IServiceProvider serviceProvider)
			: base(serviceProvider)
		{
			_notifyIconService = ServiceProvider.GetService<INotifyIconService>();
			_forumsAggregatesService = ServiceProvider.GetService<IForumsAggregatesService>();
		}
示例#4
0
 public NotifyIconActivePart([NotNull] IServiceProvider serviceProvider)
     : base(serviceProvider)
 {
     _notifyIconService       = ServiceProvider.GetService <INotifyIconService>();
     _forumsAggregatesService = ServiceProvider.GetService <IForumsAggregatesService>();
 }