Beispiel #1
0
        public bool Start()
        {
            switch (Utils.OS)
            {
            case OperatingSystemID.Windows:
                updater = new SparkleWin();
                break;

            case OperatingSystemID.OSX:
#if OSTYPE_OS_X
                updater = new SparkleOSX();
                break;
#else
                Log.Error("Sparkle backend for OS X not enabled in this build, define OSTYPE_OS_X");
                return(false);
#endif
            case OperatingSystemID.Linux:
                updater = new SimplifiedAppUpdater();
                break;
            }
            try {
                updater?.Start(companyName, App.Current.SoftwareName, App.Current.Version.ToString(),
                               feedURL, App.Current.baseDirectory);
                App.Current.DependencyRegistry.Register <IAppUpdater> (updater);
            } catch (Exception ex) {
                Log.Exception(ex);
                return(false);
            }
            return(true);
        }
 public InfoPopupViewModel(IAppUpdater appUpdater, bool includePreReleases)
 {
     _appUpdater            = appUpdater;
     _includePreReleases    = includePreReleases;
     OpenUrlCommand         = new DelegateCommand <string>(OpenAboutUrl);
     CheckForUpdatesCommand = AsyncCommand.Create(CheckForUpdatesAsync);
     UpdateCommand          = AsyncCommand.Create(UpdateAppAsync);
 }
Beispiel #3
0
 public TabsPageVM(INavigationService navigationService,
                   IDialogService dialogService,
                   IGithubService githubService,
                   IBusStopRepository busStopRepository,
                   IAppUpdater appUpdater) : base(navigationService, dialogService)
 {
     _githubService     = githubService;
     _busStopRepository = busStopRepository;
     _locator           = CrossGeolocator.Current;
     _appUpdater        = appUpdater;
 }
        public void ShowInfoPopup(bool includePreReleases, IAppUpdater appUpdater)
        {
            var popup = new InfoPopupDialog
            {
                Owner       = Application.Current.MainWindow,
                DataContext = new InfoPopupViewModel(appUpdater, includePreReleases)
            };

            _blur.Blur();
            popup.ShowDialog();
            _blur.UnBlur();
        }
Beispiel #5
0
        public PBApp(IResolver moduleLoader, string[] args)
        {
            this.args = args == null ? new string[0] : args;
            clipboardTimer.Elapsed += clipboardTimer_Elapsed;
            this.moduleLoader       = moduleLoader;
            pbData = moduleLoader.GetInstanceOf <IPBData>();
            // pbData.OnProfileUnlock += pbData_OnProfileUnlock;
            pbData.OnUserLoggedIn += pbData_OnUserLoggedIn;
            pbData.OnCloseProfile += pbData_OnCloseProfile;
            currentLanguage        = pbData.GetConfigurationValueByAccountAndKey(DefaultProperties.Configuration_DefaultAccount, "last_selected_lang");
            if (string.IsNullOrWhiteSpace(currentLanguage))
            {
                currentLanguage = "en";
            }
            sync = moduleLoader.GetInstanceOf <IPBSync>();
            sync.OnGetMergePassword(GetMergePassword);
            webAPI         = moduleLoader.GetInstanceOf <IPBWebAPI>();
            BrowserMonitor = moduleLoader.GetInstanceOf <IBrowserMonitor>();
            updater        = moduleLoader.GetInstanceOf <IAppUpdater>();
            updater.UpdatedVersionDetected += UpdatedVersionDetected;
            categories    = new Dictionary <string, string>();
            resourcePaths = new Dictionary <string, Uri>();
            resourcePaths.Add("Fonts", new Uri("/font;component/FontProperty.xaml", UriKind.RelativeOrAbsolute));
            resourcePaths.Add("Themes", new Uri("/theme;component/Theme.xaml", UriKind.RelativeOrAbsolute));
            resourcePaths.Add("Images", new Uri("/image;component/ImageResource.xaml", UriKind.RelativeOrAbsolute));
            resourcePaths.Add("LocalStyles1", new Uri("pack://application:,,,/PBAppUI;component/resources/dictionary/styles/passwordbossresource.xaml", UriKind.RelativeOrAbsolute));
            resourcePaths.Add("LocalStyles2", new Uri("pack://application:,,,/PBAppUI;component/resources/dictionary/styles/primarydashboardresource.xaml", UriKind.RelativeOrAbsolute));
            resourcePaths.Add("LocalStyles3", new Uri("pack://application:,,,/PBAppUI;component/resources/dictionary/styles/AddControlStyles.xaml", UriKind.RelativeOrAbsolute));
            foreach (var uri in resourcePaths.Values)
            {
                LoadAndMerge(uri);
            }
            SetLanguage(currentLanguage);
            SystemTray.SetResolver(moduleLoader);
            sysTray = new SystemTray();
            sysTray.InitializeTrayProperties();
            SystemTray.OnBeforeShutDownHandler += SystemTray_OnBeforeShutDownHandler;
            LoginWindow loginWindow = new LoginWindow(moduleLoader);

            Navigator.NavigationService = loginWindow.MainFrame.NavigationService;
            if (!pbData.ControllerIsUpToDate())
            {
                pbData_OnInvalidVersion(DBFileType.Controller);
            }
            else
            {
                pbData.OnInvalidVersion += pbData_OnInvalidVersion;
            }

            Application.Current.Dispatcher.UnhandledException += onDispatcherUnhandledException;
            systemIdlePoller = new SystemIdlePoller();
        }
        public MainClientWindowVM(BarcodeScanningTabVM barcodeScanningTabVM,
                                  ProductsListTabVM productsListTabVM,
                                  CountConsolidationTabVM countConsolidationTabVM,
                                  IAppUpdater appUpdater,
                                  IFileSystemAccesor fs) : base(fs)
        {
            AddAsTab(barcodeScanningTabVM);
            AddAsTab(countConsolidationTabVM);
            AddAsTab(productsListTabVM);

            Updater = appUpdater;
            //Updater.StartCheckingForUpdates();
        }
Beispiel #7
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            // Allow the application to take advantage of all the pixels.
            ApplicationViewScaling.TrySetDisableLayoutScaling(true);

            _appUpdater = new AppUpdater();

            this.InitializeComponent();
            this.Suspending += OnSuspending;

            // Xbox One best practices.
            // <see cref="https://docs.microsoft.com/en-us/windows/uwp/xbox-apps/tailoring-for-xbox"/>
            this.RequiresPointerMode = ApplicationRequiresPointerMode.WhenRequested;
        }
 public MainViewModel(IAppReduxDispatcher appReduxDispatcher, IUpdater updater, IAppUpdater appUpdater, Func <Server, ServerViewModel> serverViewModelFactory)
 {
     logger.Info($"Welcome to AutoMasshTik v{typeof(MainViewModel).Assembly.GetName().Version}");
     this.appReduxDispatcher     = appReduxDispatcher;
     this.updater                = updater;
     this.appUpdater             = appUpdater;
     this.serverViewModelFactory = serverViewModelFactory;
     state                                 = appReduxDispatcher.InitialState;
     ServerModels                          = state.Servers;
     Servers                               = new ObservableCollection <ServerViewModel>();
     StartUpdateCommand                    = new RelayCommand <UpdateMode>(StartUpdate, m => !IsUpdating);
     StopUpdateCommand                     = new RelayCommand(StopUpdate, () => IsUpdating);
     ToggleShowPasswordCommand             = new RelayCommand(ToggleShowPassword);
     this.appReduxDispatcher.StateChanged += AppReduxDispatcher_StateChanged;
 }
 public ShellViewModel(IServiceProvider serviceProvider, IAppUpdater appUpdater, ILogger <ShellViewModel> logger)
 {
     this.serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     this.appUpdater      = appUpdater ?? throw new ArgumentNullException(nameof(appUpdater));
     this.logger          = logger ?? throw new ArgumentNullException(nameof(logger));
 }