Beispiel #1
0
        public UpdateService(IConfigurationService configurationService, IFileService fileService,
                             IUpdateExecutableLocationService updateExecutableLocationService)
        {
            Argument.IsNotNull(() => configurationService);
            Argument.IsNotNull(() => fileService);
            Argument.IsNotNull(() => updateExecutableLocationService);

            _configurationService            = configurationService;
            _fileService                     = fileService;
            _updateExecutableLocationService = updateExecutableLocationService;

            AvailableChannels = new UpdateChannel[] { };
        }
        public MainViewModel(IUIVisualizerService uiVisualizerService, IDispatcherService dispatcherService,
                             IUpdateService updateService, IUpdateExecutableLocationService updateExecutableLocationService)
        {
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => updateService);

            _uiVisualizerService             = uiVisualizerService;
            _dispatcherService               = dispatcherService;
            _updateService                   = updateService;
            _updateExecutableLocationService = updateExecutableLocationService;
            CheckForUpdates                  = new TaskCommand(OnCheckForUpdatesExecuteAsync, OnCheckForUpdatesCanExecute);
            Update = new TaskCommand(OnUpdateExecuteAsync, OnUpdateCanExecute);
            ShowInstalledDialog = new Command(OnShowInstalledDialogExecute);

            Title = "Orc.Squirrel example";

#if DEBUG
            UpdateUrl          = "https://downloads.wildgums.com/flexgrid/alpha";
            ExecutableFileName = Environment.ExpandEnvironmentVariables("%localappdata%\\WildGums\\Flex Grid_alpha\\FlexGrid.exe");
#endif
        }