Ejemplo n.º 1
0
        public static IDisposable BindNotifications(
            this MainWindow mainWindow,
            IPlatform platform,
            INotificationController controller)
        {
            var trigger = (controller as NotificationController)?.Trigger;

            if (trigger != null)
            {
                return(trigger
                       .SubscribeOn(RxApp.TaskpoolScheduler)
                       .ObserveOn(RxApp.MainThreadScheduler)
                       .Accept(model =>
                {
                    var screen = mainWindow.Screens.Primary;
                    var window = new NotificationWindow();
                    window.Show();

                    window.DataContext = model;
                    window.Position = new PixelPoint(
                        GetXForNotification(platform, screen.Bounds, window.Bounds),
                        GetYForNotification(platform, screen.Bounds, window.Bounds));
                }));
            }

            return(Disposable.Empty);
        }
Ejemplo n.º 2
0
        internal NotificationButton(INotificationController controller, INotificationInfo info)
        {
            this.controller = controller;

            InitializeComponent();
            InitializeNotificationIcon(info);
        }
Ejemplo n.º 3
0
 public ShellOperation(
     IActionCenter actionCenter,
     IAudio audio,
     INotificationInfo aboutInfo,
     INotificationController aboutController,
     ClientContext context,
     IKeyboard keyboard,
     ILogger logger,
     INotificationInfo logInfo,
     INotificationController logController,
     IPowerSupply powerSupply,
     ISystemInfo systemInfo,
     ITaskbar taskbar,
     ITaskview taskview,
     IText text,
     IUserInterfaceFactory uiFactory,
     IWirelessAdapter wirelessAdapter) : base(context)
 {
     this.aboutInfo       = aboutInfo;
     this.aboutController = aboutController;
     this.actionCenter    = actionCenter;
     this.audio           = audio;
     this.keyboard        = keyboard;
     this.logger          = logger;
     this.logInfo         = logInfo;
     this.logController   = logController;
     this.powerSupply     = powerSupply;
     this.systemInfo      = systemInfo;
     this.text            = text;
     this.taskbar         = taskbar;
     this.taskview        = taskview;
     this.uiFactory       = uiFactory;
     this.wirelessAdapter = wirelessAdapter;
 }
Ejemplo n.º 4
0
        public static IDisposable BindNotifications(
            this MessengerModel model,
            INotificationSource notificationSource,
            INotificationController notificationController)
        {
            var chats    = notificationSource.ChatNotifications();
            var messages = notificationSource.MessagesNotifications();

            return(chats.Merge(messages)
                   .Buffer(TimeSpan.FromSeconds(2))
                   .SubscribeOn(RxApp.TaskpoolScheduler)
                   .ObserveOn(RxApp.MainThreadScheduler)
                   .Accept(notifications =>
            {
                switch (notifications.Count)
                {
                case 0:
                    break;

                case 1:
                    notificationController.Show(
                        NotificationModel.FromNotification(notifications[0]));
                    break;

                default:
                    notificationController.Show(
                        NotificationModel.FromNotificationList(notifications));
                    break;
                }
            }));
        }
Ejemplo n.º 5
0
        public AppViewModel(INavigationService navigateService, GithubApiService ghservice, INotificationController notController, ICacheManager cache)
        {
            NavigationService = navigateService;
            GHService = ghservice;
            NotificationController = notController;

            //Autologin can be implemented here
            NavigationService.Navigate(AppPages.LoginPage);
        }
Ejemplo n.º 6
0
        public AppViewModel(INavigationService navigateService, GithubApiService ghservice, INotificationController notController, ICacheManager cache)
        {
            NavigationService      = navigateService;
            GHService              = ghservice;
            NotificationController = notController;


            //Autologin can be implemented here
            NavigationService.Navigate(AppPages.LoginPage);
        }
 public INotificationControl CreateNotificationControl(INotificationController controller, INotificationInfo info, Location location)
 {
     if (location == Location.ActionCenter)
     {
         return(new ActionCenterNotificationButton(controller, info));
     }
     else
     {
         return(new TaskbarNotificationButton(controller, info));
     }
 }
Ejemplo n.º 8
0
        public LoginViewModel(INavigationService navigateService, GithubApiService ghservice, INotificationController notController, ICacheManager cache)
        {
            IsLogin                = false;
            NavigationService      = navigateService;
            GHService              = ghservice;
            NotificationController = notController;
            _cache = cache;

            _loginCommand = new DelegateCommand(() =>
            {
                NotificationController.SplashScreen.IsVisible = true;
                cache.Add("username", User);
                cache.Add("password", Password);
                GHService.UseCredentials(User, Password);
                NavigationService.Navigate(AppPages.MainPage);
            });
        }
Ejemplo n.º 9
0
        public LoginViewModel(INavigationService navigateService, GithubApiService ghservice, INotificationController notController, ICacheManager cache)
        {
            IsLogin = false;
            NavigationService = navigateService;
            GHService = ghservice;
            NotificationController = notController;
            _cache = cache;

            _loginCommand = new DelegateCommand(() =>
            {

                NotificationController.SplashScreen.IsVisible = true;
                cache.Add("username", User);
                cache.Add("password", Password);
                GHService.UseCredentials(User, Password);
                NavigationService.Navigate(AppPages.MainPage);
            });
        }
Ejemplo n.º 10
0
 public ShellOperation(
     IActionCenter actionCenter,
     IEnumerable <IActionCenterActivator> activators,
     ActionCenterSettings actionCenterSettings,
     IAudio audio,
     INotificationInfo aboutInfo,
     INotificationController aboutController,
     IKeyboard keyboard,
     ILogger logger,
     INotificationInfo logInfo,
     INotificationController logController,
     IPowerSupply powerSupply,
     ISystemInfo systemInfo,
     ITaskbar taskbar,
     TaskbarSettings taskbarSettings,
     ITerminationActivator terminationActivator,
     IText text,
     IUserInterfaceFactory uiFactory,
     IWirelessAdapter wirelessAdapter)
 {
     this.aboutInfo            = aboutInfo;
     this.aboutController      = aboutController;
     this.actionCenter         = actionCenter;
     this.activators           = activators;
     this.actionCenterSettings = actionCenterSettings;
     this.audio                = audio;
     this.keyboard             = keyboard;
     this.logger               = logger;
     this.logInfo              = logInfo;
     this.logController        = logController;
     this.powerSupply          = powerSupply;
     this.systemInfo           = systemInfo;
     this.taskbarSettings      = taskbarSettings;
     this.terminationActivator = terminationActivator;
     this.text            = text;
     this.taskbar         = taskbar;
     this.uiFactory       = uiFactory;
     this.wirelessAdapter = wirelessAdapter;
 }
Ejemplo n.º 11
0
        public MainViewModel(INavigationService navigationService, GithubApiService ghSvc, INotificationController notController, OctocatsService octocatSvc, ICacheManager cache)
        {
            NotificationController = notController;
            GHService = ghSvc;
            OctocatService = octocatSvc;
            _settings = cache;

            this.NewsItems = new ObservableCollection<ItemViewModel>();

            /*            User.Subscribe(user =>
                {
                    user.Organizations.ForEach(org => GHService.GetReposForOrganization(org, RepositItems));
                });

            RepositItems = new ObservableCollection<ItemViewModel>();
            GHService.GetUserRepos(RepositItems);

            IssuesItems = new ObservableCollection<ItemViewModel>();
            GHService.GetIssues(IssuesItems);

            _navigationService = navigationService;*/
        }
Ejemplo n.º 12
0
 public ShellOperation(
     IActionCenter actionCenter,
     IEnumerable <IActionCenterActivator> activators,
     ActionCenterSettings actionCenterSettings,
     ILogger logger,
     INotificationInfo aboutInfo,
     INotificationController aboutController,
     INotificationInfo logInfo,
     INotificationController logController,
     ISystemComponent <ISystemKeyboardLayoutControl> keyboardLayout,
     ISystemComponent <ISystemPowerSupplyControl> powerSupply,
     ISystemComponent <ISystemWirelessNetworkControl> wirelessNetwork,
     ISystemInfo systemInfo,
     ITaskbar taskbar,
     TaskbarSettings taskbarSettings,
     ITerminationActivator terminationActivator,
     IText text,
     IUserInterfaceFactory uiFactory)
 {
     this.aboutInfo            = aboutInfo;
     this.aboutController      = aboutController;
     this.actionCenter         = actionCenter;
     this.activators           = activators;
     this.actionCenterSettings = actionCenterSettings;
     this.logger               = logger;
     this.logInfo              = logInfo;
     this.logController        = logController;
     this.keyboardLayout       = keyboardLayout;
     this.powerSupply          = powerSupply;
     this.systemInfo           = systemInfo;
     this.taskbarSettings      = taskbarSettings;
     this.terminationActivator = terminationActivator;
     this.text            = text;
     this.taskbar         = taskbar;
     this.uiFactory       = uiFactory;
     this.wirelessNetwork = wirelessNetwork;
 }
Ejemplo n.º 13
0
        public MainViewModel(INavigationService navigationService, GithubApiService ghSvc, INotificationController notController, OctocatsService octocatSvc, ICacheManager cache)
        {
            NotificationController = notController;
            GHService      = ghSvc;
            OctocatService = octocatSvc;
            _settings      = cache;

            this.NewsItems = new ObservableCollection <ItemViewModel>();



/*            User.Subscribe(user =>
 *              {
 *                  user.Organizations.ForEach(org => GHService.GetReposForOrganization(org, RepositItems));
 *              });
 *
 *          RepositItems = new ObservableCollection<ItemViewModel>();
 *          GHService.GetUserRepos(RepositItems);
 *
 *          IssuesItems = new ObservableCollection<ItemViewModel>();
 *          GHService.GetIssues(IssuesItems);
 *
 *          _navigationService = navigationService;*/
        }
 public void SetController(INotificationController controller)
 {
     _notificationController = controller;
 }
 public void SetController(INotificationController controller)
 {
     _notificationController = controller;
 }
Ejemplo n.º 16
0
 public INotificationController GetGuiController()
 {
     return this.guiController ?? (this.guiController = this.CreateGuiControllerInternal());
 }
Ejemplo n.º 17
0
 public INotificationController GetGuiController()
 {
     return(this.guiController ?? (this.guiController = this.CreateGuiControllerInternal()));
 }