Ejemplo n.º 1
0
        public Manager(NotifyIconViewModel notifyIconViewModel)
        {
            this.UserId = RegistryService.GetUserId();
            this.Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major.ToString();

            //RegistryService.WriteShell();

            this.notifyIconViewModel = notifyIconViewModel;

            // Disabled for R15
            //ShortcutService2.RegisterShortcut(ShortcutKeys.Control, Keys.PrintScreen);
            //ShortcutService2.HotKeyPressed += Capture;
            ShortcutService.OnKeyPress += Capture;

            UpdatesService.Initialize(this.UserId, this.Version);
            if (UpdatesService.FirstRun)
                this.ShowPopupFirstRun();

            if (CommandService.IsShellMode)
            {
                var file = CommandService.GetFileName;
                if (!string.IsNullOrEmpty(file))
                    this.Captured(new Bitmap(Image.FromFile(file)), new ScreenshotData(this.UserId) { StartDate = DateTime.Now, Mode = 3 }, true);
            }
        }
Ejemplo n.º 2
0
 public ServerModule(NotifyIconViewModel commandViewModel)
 {
    this.CommandViewModel = commandViewModel;
    Post ("/Message", (args) =>
    {
      this.CommandViewModel.ShowWindowCommand.Execute();
    }
 }
 public ServerModule(NotifyIconViewModel commandViewModel)
 {
   this.CommandViewModel = commandViewModel;
   Post ("/Message", (args) =>
   {
     Application.Current.Dispatcher.Invoke(delegate
     {
        CommandViewModel.ShowWindowCommand.Execute (null);
     });
   }
 }
Ejemplo n.º 4
0
        /// <summary>
        ///     Setups the notify icon.
        /// </summary>
        private void SetupNotifyIcon()
        {
            var icon =
                new Icon(
                    Application.GetResourceStream(
                        new Uri("Resources/record_icon.ico", UriKind.Relative)).Stream);

            this.notifyIcon = new NotifyIconViewModel(icon);
            this.notifyIcon.ShowBalloonTip(
                7000,
                "ScreenGun",
                "When recording, click this icon to stop.",
                ToolTipIcon.Info);
            this.notifyIcon.LeftClicked += (sender, args) => this.StopRecording();
        }
Ejemplo n.º 5
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            ShutdownMode = ShutdownMode.OnExplicitShutdown;

            Resources.MergedDictionaries.Add(new ResourceDictionary {
                Source = new Uri("XamlResources.xaml", UriKind.Relative)
            });
            Resources.MergedDictionaries.Add(new ResourceDictionary {
                Source = new Uri("Views/NotifyIconView.xaml", UriKind.Relative)
            });
            connectivityMonitor              = new ConnectivityMonitor();
            connectivityMonitor.Heartbeat    = () => soundPlayeronhb.Play();
            connectivityMonitor.StatusChange = () => SoundPlayertransition_on.Play();
            taskbarIcon = (TaskbarIcon)FindResource("NotifyIcon");
            var intervals = GetMenu();

            notifyIconViewModel     = new NotifyIconViewModel(connectivityMonitor, intervals);
            taskbarIcon.DataContext = notifyIconViewModel;
            notifyIconViewModel.ShowWindowCommand.Execute(null);
            ProcessArgs(e.Args, true);
        }
Ejemplo n.º 6
0
 public void GivenIHaveAViewModel()
 {
     ViewModel = new NotifyIconViewModel();
 }
Ejemplo n.º 7
0
 public void WhenTheVieWModelIsCreated()
 {
     ViewModel = new NotifyIconViewModel();
 }
Ejemplo n.º 8
0
        private void ShowNotification()
        {
            var builds        = this.buildCache.BuildsStatus.SelectMany(a => a.AllBuildItems.Select(b => b.Build)).ToList();
            var changedBuilds = GetChangedBuilds(builds);

            foreach (var build in changedBuilds)
            {
                this.notificationProvider?.ShowBuild(build,
                                                     b => IconProvider.GetCachedIconPathForBuildStatus(b.Status),
                                                     b => { Application.Current.Dispatcher.Invoke(() => { NotifyIconViewModel.OpenWindow(this.buildsExportFactory); }); });
            }
        }