EndSkippedMachineWideProcessProgress() приватный Метод

private EndSkippedMachineWideProcessProgress ( SkippedReasons reason ) : void
reason SkippedReasons
Результат void
Пример #1
0
        public virtual void PrepareUnregisteringPrig(PrigViewModel vm)
        {
            vm.BeginMachineWideProcessProgress(MachineWideProcesses.Uninstalling);

            var machinePreq = new MachinePrerequisite(Resources.NuGetRootPackageVersion);

            machinePreq.ProfilerStatusChecking += profLoc => vm.ReportProfilerStatusCheckingProgress(50u, profLoc);

            if (!MachineWideInstaller.HasBeenInstalled(machinePreq))
            {
                vm.ShowSkippedMachineWideProcessMessage(SkippedReasons.AlreadyRegistered);
                vm.EndSkippedMachineWideProcessProgress(SkippedReasons.AlreadyRegistered);
                return;
            }


            if (!WindowsIdentity.GetCurrent().IsElevated())
            {
                vm.ShowVisualStudioHasNotBeenElevatedYetMessage();
                if (ProcessMixin.RestartCurrentProcessWith(_ => { _.Verb = "runas"; }))
                {
                    return;
                }

                vm.EndSkippedMachineWideProcessProgress(SkippedReasons.CanceledByUser);
            }
            else
            {
                UnregisterPrig(vm);
            }
        }
Пример #2
0
        protected virtual void OnCompletedUnregisterPrig(PrigViewModel vm, MachineWideProcessResults result)
        {
            switch (result)
            {
            case MachineWideProcessResults.Skipped:
                vm.ShowSkippedMachineWideProcessMessage(SkippedReasons.AlreadyRegistered);
                vm.EndSkippedMachineWideProcessProgress(SkippedReasons.AlreadyRegistered);
                break;

            case MachineWideProcessResults.Completed:
                var restarts = vm.ConfirmRestartingVisualStudioToTakeEffect();
                vm.EndCompletedMachineWideProcessProgress();
                if (!restarts)
                {
                    return;
                }

                ProcessMixin.RestartCurrentProcess();
                break;
            }
        }
Пример #3
0
        protected virtual void OnCompletedUnregisterPrig(PrigViewModel vm, MachineWideProcessResults result)
        {
            switch (result)
            {
                case MachineWideProcessResults.Skipped:
                    vm.ShowSkippedMachineWideProcessMessage(SkippedReasons.AlreadyRegistered);
                    vm.EndSkippedMachineWideProcessProgress(SkippedReasons.AlreadyRegistered);
                    break;
                case MachineWideProcessResults.Completed:
                    var restarts = vm.ConfirmRestartingVisualStudioToTakeEffect();
                    vm.EndCompletedMachineWideProcessProgress();
                    if (!restarts)
                        return;

                    ProcessMixin.RestartCurrentProcess();
                    break;
            }
        }
Пример #4
0
        public virtual void PrepareUnregisteringPrig(PrigViewModel vm)
        {
            vm.BeginMachineWideProcessProgress(MachineWideProcesses.Uninstalling);

            var machinePreq = new MachinePrerequisite(Resources.NuGetRootPackageVersion);
            machinePreq.ProfilerStatusChecking += profLoc => vm.ReportProfilerStatusCheckingProgress(50u, profLoc);

            if (!MachineWideInstaller.HasBeenInstalled(machinePreq))
            {
                vm.ShowSkippedMachineWideProcessMessage(SkippedReasons.AlreadyRegistered);
                vm.EndSkippedMachineWideProcessProgress(SkippedReasons.AlreadyRegistered);
                return;
            }

            if (!WindowsIdentity.GetCurrent().IsElevated())
            {
                vm.ShowVisualStudioHasNotBeenElevatedYetMessage();
                if (ProcessMixin.RestartCurrentProcessWith(_ => { _.Verb = "runas"; }))
                    return;

                vm.EndSkippedMachineWideProcessProgress(SkippedReasons.CanceledByUser);
            }
            else
            {
                UnregisterPrig(vm);
            }
        }