示例#1
0
        internal ReleaseNotesViewModel([NotNull] LauncherViewModel launcher, [NotNull] string version)
            : base(launcher.SafeArgument(nameof(launcher)).ServiceProvider)
        {
            if (version == null)
            {
                throw new ArgumentNullException(nameof(version));
            }
            this.launcher = launcher;

            Version = version;
            baseUrl = $"{RootUrl}/{Version}/ReleaseNotes/";
#if DEBUG
            if (Environment.CommandLine.ToLowerInvariant().Contains("/previewreleasenotes"))
            {
                var launcherPath = AppDomain.CurrentDomain.BaseDirectory;
                var mdPath       = Path.Combine(launcherPath, @"..\..\..\..\..\doc\");
                if (File.Exists($"{mdPath}{ReleaseNotesFileName}"))
                {
                    baseUrl = $"file:///{mdPath.Replace("\\", "/")}";
                }
            }
#endif

            ToggleCommand = new AnonymousCommand(ServiceProvider, Toggle);
        }
示例#2
0
 private void CloseAnnouncement()
 {
     Validated = true;
     if (DontShowAgain)
     {
         LauncherViewModel.SaveTaskAsDone(TaskName);
     }
 }
示例#3
0
 internal VsixVersionViewModel(LauncherViewModel launcher, NugetStore store)
     : base(launcher, store, null)
 {
     ExecuteActionCommand = new AnonymousCommand(ServiceProvider, ExecuteAction)
     {
         IsEnabled = false
     };
 }
示例#4
0
 internal XenkoDevVersionViewModel(LauncherViewModel launcher, NugetStore store, [CanBeNull] NugetLocalPackage localPackage, UDirectory path, bool isDevRedirect)
     : base(launcher, store, localPackage, int.MaxValue, devMinorCounter--)
 {
     this.path                 = path;
     this.localPackage         = localPackage;
     this.isDevRedirect        = isDevRedirect;
     DownloadCommand.IsEnabled = false;
     // Update initial status (IsVisible will be set to true)
     UpdateStatus();
 }
示例#5
0
 internal XenkoVersionViewModel(LauncherViewModel launcher, NugetStore store, NugetLocalPackage localPackage, int major, int minor)
     : base(launcher, store, localPackage)
 {
     Major = major;
     Minor = minor;
     SetAsActiveCommand = new AnonymousCommand(ServiceProvider, () => launcher.ActiveVersion = this);
     // Update status if the user changes whether to display beta versions.
     launcher.PropertyChanged += (s, e) => { if (e.PropertyName == nameof(LauncherViewModel.ShowBetaVersions))
                                             {
                                                 UpdateStatus();
                                             }
     };
 }
示例#6
0
 public AnnouncementViewModel(LauncherViewModel launcher, string announcementName)
     : base(launcher.SafeArgument(nameof(launcher)).ServiceProvider)
 {
     this.launcher         = launcher;
     this.announcementName = announcementName;
     if (!LauncherViewModel.HasDoneTask(TaskName))
     {
         MarkdownAnnouncement = Initialize(announcementName);
     }
     // We want to explicitely trigger the property change notification for the view storyboard
     Dispatcher.InvokeAsync(() => Validated = false);
     CloseAnnouncementCommand = new AnonymousCommand(ServiceProvider, CloseAnnouncement);
 }
示例#7
0
 internal RecentProjectViewModel(LauncherViewModel launcher, UFile path)
     : base(launcher.SafeArgument(nameof(launcher)).ServiceProvider)
 {
     Name             = path.GetFileNameWithoutExtension();
     Launcher         = launcher;
     fullPath         = path;
     XenkoVersionName = Strings.ReportDiscovering;
     OpenCommand      = new AnonymousTaskCommand(ServiceProvider, () => OpenWith(null))
     {
         IsEnabled = false
     };
     OpenWithCommand    = new AnonymousTaskCommand <XenkoVersionViewModel>(ServiceProvider, OpenWith);
     ExploreCommand     = new AnonymousCommand(ServiceProvider, Explore);
     CompatibleVersions = new ObservableList <XenkoVersionViewModel>();
     DiscoverXenkoVersion();
 }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PackageVersionViewModel"/> class.
 /// </summary>
 /// <param name="launcher">The parent <see cref="LauncherViewModel"/> instance.</param>
 /// <param name="store">The related <see cref="NugetStore"/> instance.</param>
 /// <param name="localPackage">The local package of this version, if a local package exists.</param>
 internal PackageVersionViewModel(LauncherViewModel launcher, NugetStore store, NugetLocalPackage localPackage)
     : base(launcher.SafeArgument("launcher").ServiceProvider)
 {
     if (launcher == null)
     {
         throw new ArgumentNullException(nameof(launcher));
     }
     if (store == null)
     {
         throw new ArgumentNullException(nameof(store));
     }
     Launcher        = launcher;
     Store           = store;
     LocalPackage    = localPackage;
     DownloadCommand = new AnonymousCommand(ServiceProvider, () => Download(true));
     DeleteCommand   = new AnonymousTaskCommand(ServiceProvider, () => Delete(true, true))
     {
         IsEnabled = CanDelete
     };
     UpdateStatusInternal();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="XenkoStoreVersionViewModel"/>
 /// </summary>
 /// <param name="launcher"></param>
 /// <param name="store"></param>
 /// <param name="localPackage"></param>
 /// <param name="major"></param>
 /// <param name="minor"></param>
 internal XenkoStoreVersionViewModel(LauncherViewModel launcher, NugetStore store, NugetLocalPackage localPackage, int major, int minor)
     : base(launcher, store, localPackage, major, minor)
 {
     FetchReleaseNotes();
     FetchDocumentation();
 }