ShowSkippedMachineWideProcessMessage() private method

private ShowSkippedMachineWideProcessMessage ( SkippedReasons reason ) : void
reason SkippedReasons
return void
Esempio n. 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);
            }
        }
Esempio n. 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;
            }
        }
Esempio n. 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;
            }
        }
Esempio n. 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);
            }
        }