コード例 #1
0
 public ShellViewModel(IShellView view, IShellService shellService,
                       ISyncService syncStartService,
                       IGuiInteractionService guiInteractionService,
                       Settings settings,
                       SyncSummary syncSummary,
                       IMessageService messageService,
                       ApplicationLogger applicationLogger, IApplicationUpdateService applicationUpdateService,
                       SystemTrayNotifierViewModel systemTrayNotifierViewModel, ChildContentViewFactory childContentViewFactory)
     : base(view)
 {
     _statusBuilder              = new StringBuilder();
     MessageService              = messageService;
     ApplicationLogger           = applicationLogger;
     Logger                      = applicationLogger.GetLogger(GetType());
     ApplicationUpdateService    = applicationUpdateService;
     ShellService                = shellService;
     SyncStartService            = syncStartService;
     GuiInteractionService       = guiInteractionService;
     Settings                    = settings;
     SyncSummary                 = syncSummary;
     SystemTrayNotifierViewModel = systemTrayNotifierViewModel;
     ChildContentViewFactory     = childContentViewFactory;
     view.Closing               += ViewClosing;
     view.Closed                += ViewClosed;
 }
コード例 #2
0
 private void UpdateNotification(string popupText)
 {
     if (!Settings.AppSettings.HideSystemTrayTooltip)
     {
         try
         {
             SystemTrayNotifierViewModel.UpdateBalloonText(popupText);
         }
         catch (Exception exception)
         {
             Logger.Error("Updating status in balloon", exception);
         }
     }
 }
コード例 #3
0
 private void ShowNotification(bool showHide, string popupText = "Syncing...")
 {
     if (!Settings.AppSettings.HideSystemTrayTooltip)
     {
         try
         {
             if (showHide)
             {
                 SystemTrayNotifierViewModel.ShowBalloon(popupText);
             }
             else
             {
                 SystemTrayNotifierViewModel.HideBalloon();
             }
         }
         catch (Exception exception)
         {
             Logger.Error(exception);
         }
     }
 }
コード例 #4
0
 private void UpdateContinuationAction(Task <string> task)
 {
     BeginInvokeOnCurrentDispatcher(() =>
     {
         if (task.Result == null)
         {
             if (ApplicationUpdateService.IsNewVersionAvailable())
             {
                 var version = ApplicationUpdateService.GetNewAvailableVersion();
                 if (string.IsNullOrEmpty(LatestVersion) || !version.Equals(LatestVersion))
                 {
                     IsLatestVersionAvailable = true;
                     LatestVersion            = version;
                     SystemTrayNotifierViewModel.ShowBalloon(
                         $"New Update {version} Available!", 5000);
                 }
             }
             _lastCheckDateTime = DateTime.Now;
         }
     });
 }