Exemplo n.º 1
0
 public UpdateService(IUpdateChecker checker, ISettingsStore settings,
                      IEventAggregator eventAggregator, IJarvisLog log)
 {
     _checker         = checker;
     _settings        = settings;
     _eventAggregator = eventAggregator;
     _log             = new LogDecorator("UpdateService", log);
 }
Exemplo n.º 2
0
        /// <inheritdoc />
        public virtual void ShowAboutBox(IUpdateChecker updateChecker = null)
        {
            AboutBox aboutBox = new AboutBox();

            aboutBox.UpdateChecker = updateChecker;
            aboutBox.AccentColor   = AccentColor;
            aboutBox.Owner         = System.Windows.Application.Current.Windows
                                     .OfType <Window>().SingleOrDefault(x => x.IsActive);
            aboutBox.ShowDialog();
        }
Exemplo n.º 3
0
        public UpdateCheckerViewModel(IUpdateChecker UpdateChecker)
        {
            _updateChecker = UpdateChecker;
            BuildName      = UpdateChecker.BuildName;

            Check();

            CheckCommand = new DelegateCommand(Check);

            GoToDownload = new DelegateCommand(UpdateChecker.GoToDownloadsPage);
        }
Exemplo n.º 4
0
        public override void ShowAboutBox(IUpdateChecker updateChecker = null)
        {
            Uri      iconUri  = new Uri("pack://application:,,,/vividl.ico");
            AboutBox aboutBox = new AboutBox(new BitmapImage(iconUri));

            aboutBox.UpdateChecker = updateChecker;
            aboutBox.AccentColor   = AccentColor;
            aboutBox.Owner         = Application.Current.Windows
                                     .OfType <Window>().SingleOrDefault(x => x.IsActive);
            aboutBox.ShowDialog();
        }
        public UpdateCheckerViewModel(IUpdateChecker UpdateChecker)
        {
            _updateChecker = UpdateChecker;
            BuildName      = UpdateChecker.BuildName;

            Check();

            CheckCommand = new ReactiveCommand()
                           .WithSubscribe(Check);

            GoToDownload = new ReactiveCommand()
                           .WithSubscribe(UpdateChecker.GoToDownloadsPage);
        }
Exemplo n.º 6
0
        public HelpViewModel(IUpdateChecker updateChecker, IMsixHeroApplication application)
        {
            this.CloseCommand     = new DelegateCommand(((IDialogAware)this).OnDialogClosed, ((IDialogAware)this).CanCloseDialog);
            this.ShowReleaseNotes = new DelegateCommand(this.OnShowReleaseNotes);

            this.updateChecker = updateChecker;
            this.application   = application;
            this.Check         = new DelegateCommand(this.CheckExecute, this.CheckCanExecute);
            this.UpdateCheck   = new AsyncProperty <UpdateCheckResult>();

            var assemblyLocation = (Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly()).Location;

            this.Version = FileVersionInfo.GetVersionInfo(assemblyLocation).ProductVersion;
        }
Exemplo n.º 7
0
 public SettingsViewModel(IFileService fileService, IDialogService dialogService,
                          IThemeResolver themeResolver, IDownloadOptionProvider optionProvider,
                          IUpdateChecker updateChecker, YtdlUpdateService ytdlUpdateService)
 {
     this.FileService            = fileService;
     this.dialogService          = dialogService;
     this.themeResolver          = themeResolver;
     this.updateChecker          = updateChecker;
     this.YoutubeDLUpdateService = ytdlUpdateService;
     DefaultFormats         = new ObservableCollection <IDownloadOption>(optionProvider.CreateDownloadOptions());
     SwitchAppThemeCommand  = new RelayCommand(() => SwitchAppTheme());
     UpdateVividlCommand    = new RelayCommand(() => UpdateVividl());
     UpdateYoutubeDLCommand = new RelayCommand(async() => await UpdateYoutubeDL());
 }
Exemplo n.º 8
0
        public SettingsViewModel(IFileService fileService, IDialogService dialogService,
                                 IThemeResolver themeResolver, IDownloadOptionProvider optionProvider)
        {
            this.FileService      = fileService;
            this.dialogService    = dialogService;
            this.themeResolver    = themeResolver;
            this.updateChecker    = SimpleIoc.Default.GetInstance <IUpdateChecker>();
            DefaultFormats        = new ObservableCollection <IDownloadOption>(optionProvider.CreateDownloadOptions());
            SwitchAppThemeCommand = new RelayCommand(() => SwitchAppTheme());
            var ydl = SimpleIoc.Default.GetInstance <YoutubeDLSharp.YoutubeDL>();

            YoutubeDLUpdateService = new YtdlUpdateService(ydl);
            UpdateVividlCommand    = new RelayCommand(() => UpdateVividl());
            UpdateYoutubeDLCommand = new RelayCommand(async() => await UpdateYoutubeDL());
        }
Exemplo n.º 9
0
        public override void ShowAboutBox(IUpdateChecker updateChecker = null)
        {
            Uri      iconUri  = new Uri("pack://application:,,,/vividl.ico");
            AboutBox aboutBox = new AboutBox(new BitmapImage(iconUri));

            aboutBox.UpdateChecker    = updateChecker;
            aboutBox.AccentColor      = AccentColor;
            aboutBox.CultureChanging += (o, args) =>
            {
                LocalizeDictionary.Instance.Culture = args.NewCulture;
                args.Success = true;
            };
            aboutBox.Owner = Application.Current.Windows
                             .OfType <Window>().SingleOrDefault(x => x.IsActive);
            aboutBox.ShowDialog();
        }
Exemplo n.º 10
0
 public MainApplicationContext() : base(Resources.PinWinIconWhite)
 {
     ContextMenu.Opening += ContextMenu_Opening;
     if (!String.IsNullOrWhiteSpace(Settings.Default.HotKey))
     {
         var  keyConv = new KeysConverter();
         Keys keys    = (Keys)keyConv.ConvertFromInvariantString(Settings.Default.HotKey);
         SetHotKey((KeyCombination)keys);
     }
     Application.ApplicationExit += Application_ApplicationExit;
     updateChecker = new WinFormsUpdateChecker(Program.UPDATE_URL, identifier: Program.UPDATE_IDENTIFIER);
     if (Settings.Default.AlwaysCheckForUpdates)
     {
         updateChecker.CheckForUpdates();
     }
 }
Exemplo n.º 11
0
            public ErrorReportDialog(Context context, IUpdateChecker server, Exception exception)
            {
                _exception    = exception;
                _updateServer = server;

                var builder = new MaterialAlertDialogBuilder(context);

                builder.SetTitle(Resource.String.title_error);
#if DEBUG
                builder.SetMessage(exception.ToString());
#else
                builder.SetMessage(exception.Message);
#endif
                builder.SetPositiveButton(Resource.String.button_text_report, OnPositiveButtonClick);
                builder.SetNegativeButton(Android.Resource.String.Cancel, (sender, args) => { });
                _dialog = builder.Create();
            }
        public NuGetInstaller(IInstallerFactory factory, IEngineEnvironmentSettings settings, string installPath, IDownloader packageDownloader, IUpdateChecker updateChecker)
        {
            Factory = factory ?? throw new ArgumentNullException(nameof(factory));
            _environmentSettings = settings ?? throw new ArgumentNullException(nameof(settings));
            _packageDownloader   = packageDownloader ?? throw new ArgumentNullException(nameof(packageDownloader));
            _updateChecker       = updateChecker ?? throw new ArgumentNullException(nameof(updateChecker));

            if (string.IsNullOrWhiteSpace(installPath))
            {
                throw new ArgumentException($"{nameof(installPath)} should not be null or empty", nameof(installPath));
            }
            if (!_environmentSettings.Host.FileSystem.DirectoryExists(installPath))
            {
                _environmentSettings.Host.FileSystem.CreateDirectory(installPath);
            }
            _installPath = installPath;
        }
Exemplo n.º 13
0
 public MainForm()
 {
     Settings = new Settings();
     Position = new PositionData();
     initManager();
     updateChecker = new WinFormsUpdateChecker(Program.UpdateCheckUrl, this);
     InitializeComponent();
     initControls();
     this.KeyPreview  = true;
     this.KeyDown    += MainForm_KeyDown;
     this.DpiChanged += MainForm_DpiChanged;
     // Create and start the timer.
     timer = new Timer()
     {
         Interval = 50
     };
     timer.Tick += Timer_Tick;
     panDraw.Focus();
 }
 public UpdateConfigurationManager(IConfigurationService configurationService, IUpdateChecker updateChecker)
 {
     this.configurationService = configurationService;
     this.updateChecker        = updateChecker;
 }
Exemplo n.º 15
0
 public UpdateManager(IUpdateDownloader downloader, IUpdateChecker updateChecker, string arg)
 {
     _downloader    = downloader;
     _updateChecker = updateChecker;
     Arg            = arg;
 }
Exemplo n.º 16
0
 public UpdateService(IUpdateChecker checker, IJarvisLog log, IEventAggregator eventAggregator)
 {
     _checker         = checker;
     _eventAggregator = eventAggregator;
     _log             = new LogDecorator("UpdateService", log);
 }
Exemplo n.º 17
0
 /// <summary>
 /// Testing constructor
 /// </summary>
 /// <param name="updates">Task that will provide the result of an update check</param>
 internal VersionManager(IUpdateChecker updates)
 {
     _updates = updates;
 }
Exemplo n.º 18
0
 /// <summary>
 /// Simplify construct using lamuda expresion
 /// </summary>
 /// <param name="checker"></param>
 public UpdateWorker(IUpdateChecker checker)
 {
     this.updateChecker = checker;
     this.timer         = new UpdateTimer(this);
 }