예제 #1
0
        public static DialogViewModel CreateDialog(this Win32Exception ex)
        {
            var headerVm = new DialogHeaderViewModel("Microsoft Windows",
                                                     $"{ex.Message.Trim('.')}.", "exclamation-triangle", Accents.Warn);

            return(new DialogViewModel(headerVm));
        }
예제 #2
0
        public static DialogViewModel CreateDialog(this Exception ex)
        {
            var headerVm = new DialogHeaderViewModel("Oops! This is embarrassing.",
                                                     $"{ex.GetType().Name}: {ex.Message.TrimEnd('.')}.", "sad-cry", Accents.Error);

            return(new DialogViewModel(headerVm));
        }
        protected override void OnActivate()
        {
            var manifest    = AppSession.CurrentManifest;
            var nameVersion = $"{manifest.Name} {manifest.Version}";

            HeaderViewModel = new DialogHeaderViewModel(nameVersion, "Installed Successfully", "check", Accents.Success);
            base.OnActivate();
        }
예제 #4
0
        protected override void OnActivate()
        {
            var installOptions = (InstallOptions)AppSession.Options;


            HeaderViewModel = new DialogHeaderViewModel($"Install {installOptions.Package}", $"Are you sure you want to install {installOptions.Package}?", "question-circle", Accents.Info);
            base.OnActivate();
        }
예제 #5
0
        public static DialogViewModel CreateDialog(this InstallerException ex)
        {
            var exitCode = $"ExitCode:{ex.ExitCode}";

            switch (ex.ExitReason?.Category)
            {
            case ExitCodeTypes.CorruptInstaller:
            {
                var headerVm = new DialogHeaderViewModel($"Installer for {ex.PackageManifest.Name} is corrupted.",
                                                         exitCode,
                                                         "exclamation-triangle ",
                                                         Accents.Warn);
                return(new DialogViewModel(headerVm));
            }

            case ExitCodeTypes.RequirementUnmet:
            {
                var headerVm = new DialogHeaderViewModel(@"Installer has reported that your system doesn't meet one of it's requirements.",
                                                         exitCode,
                                                         "exclamation-triangle",
                                                         Accents.Warn);
                return(new DialogViewModel(headerVm));
            }

            case ExitCodeTypes.RestartRequired:
            {
                var headerVm = new DialogHeaderViewModel($"{ex.PackageManifest.Name} has requested a system restart to finish installation.",
                                                         "",
                                                         "undo",
                                                         Accents.Warn);
                return(new DialogViewModel(headerVm));
            }

            case ExitCodeTypes.UserCanceled:
            {
                var headerVm = new DialogHeaderViewModel("User has canceled the installation",
                                                         "But you probably knew that :)",
                                                         "user-times",
                                                         Accents.Info);
                return(new DialogViewModel(headerVm));
            }
            }

            return(new DialogViewModel(new DialogHeaderViewModel($"Installer for {ex.PackageManifest.Name} exited with a non-success status code",
                                                                 exitCode, "exclamation-triangle", Accents.Error)));
        }
예제 #6
0
		public DialogViewModel()
		{
			Header = new DialogHeaderViewModel(this);
			CloseOnEscape = true;
			AllowMaximize = false;
		}
예제 #7
0
        public static DialogViewModel CreateDialog(this PackageNotFoundException ex)
        {
            var headerVm = new DialogHeaderViewModel("Sorry, We couldn't find the package you were looking for.", $"Package ID: \"{ex.PackageId}\"", "crow", Accents.Warn);

            return(new DialogViewModel(headerVm));
        }