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); }
private void CloseAnnouncement() { Validated = true; if (DontShowAgain) { LauncherViewModel.SaveTaskAsDone(TaskName); } }
internal VsixVersionViewModel(LauncherViewModel launcher, NugetStore store) : base(launcher, store, null) { ExecuteActionCommand = new AnonymousCommand(ServiceProvider, ExecuteAction) { IsEnabled = false }; }
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(); }
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(); } }; }
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); }
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(); }
/// <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(); }