Esempio n. 1
0
        private void SendTelemetry(WizardTypeEnum wizardType, UserSelection userSelection)
        {
            if (userSelection is null)
            {
                SendTelemetryWizardCanceled(wizardType);
                return;
            }

            WizardActionEnum wizardAction;

            switch (userSelection.ItemGenerationType)
            {
            case ItemGenerationType.Generate:
                wizardAction = WizardActionEnum.GenerateItem;
                break;

            case ItemGenerationType.GenerateAndMerge:
                wizardAction = WizardActionEnum.GenerateAndMergeItem;
                break;

            default:
                wizardAction = WizardActionEnum.GenerateProject;
                break;
            }

            SendTelemetryWizardComplete(wizardType, wizardAction);
        }
Esempio n. 2
0
 private void SendTelemetryWizardCanceled(WizardTypeEnum wizardType)
 {
     AppHealth.Current.Telemetry.TrackWizardCancelledAsync(
         wizardType,
         GenContext.ToolBox.Shell.GetVsVersion(),
         GenContext.ToolBox.Repo.SyncInProgress)
     .FireAndForget();
 }
Esempio n. 3
0
 private void SendTelemetryWizardComplete(WizardTypeEnum wizardType, WizardActionEnum wizardAction)
 {
     AppHealth.Current.Telemetry.TrackWizardCompletedAsync(
         wizardType,
         wizardAction,
         GenContext.ToolBox.Shell.GetVsVersion())
     .FireAndForget();
 }
Esempio n. 4
0
        public async Task TrackWizardCancelledAsync(WizardTypeEnum wizardType)
        {
            var properties = new Dictionary <string, string>()
            {
                { TelemetryProperties.WizardStatus, WizardStatusEnum.Cancelled.ToString() },
                { TelemetryProperties.WizardType, wizardType.ToString() },
                { TelemetryProperties.EventName, TelemetryEvents.Wizard }
            };

            await TelemetryService.Current.TrackEventAsync(TelemetryEvents.Wizard, properties).ConfigureAwait(false);
        }
Esempio n. 5
0
        public async Task TrackWizardCompletedAsync(WizardTypeEnum wizardType, WizardActionEnum wizardAction, string vsProductVersion)
        {
            var properties = new Dictionary <string, string>()
            {
                { TelemetryProperties.WizardStatus, WizardStatusEnum.Completed.ToString() },
                { TelemetryProperties.WizardType, wizardType.ToString() },
                { TelemetryProperties.WizardAction, wizardAction.ToString() },
                { TelemetryProperties.EventName, TelemetryEvents.Wizard },
            };

            TelemetryService.Current.SetContentVsProductVersionToContext(vsProductVersion);
            await TelemetryService.Current.TrackEventAsync(TelemetryEvents.Wizard, properties).ConfigureAwait(false);
        }
Esempio n. 6
0
        public async Task TrackWizardCancelledAsync(WizardTypeEnum wizardType, string vsProductVersion, bool syncInProgress)
        {
            var properties = new Dictionary <string, string>()
            {
                { TelemetryProperties.WizardStatus, WizardStatusEnum.Cancelled.ToString() },
                { TelemetryProperties.WizardType, wizardType.ToString() },
                { TelemetryProperties.EventName, TelemetryEvents.Wizard },
                { TelemetryProperties.SyncInProgress, syncInProgress.ToString() },
            };

            TelemetryService.Current.SetContentVsProductVersionToContext(vsProductVersion);

            GenContext.ToolBox.Shell.SafeTrackWizardCancelledVsTelemetry(properties);

            await TelemetryService.Current.TrackEventAsync(TelemetryEvents.Wizard, properties).ConfigureAwait(false);
        }
        private static void TrackWizardCompletedTelemery(WizardTypeEnum wizardType, ItemGenerationType generationType)
        {
            switch (generationType)
            {
            case ItemGenerationType.Generate:
                AppHealth.Current.Telemetry.TrackWizardCompletedAsync(wizardType, WizardActionEnum.GenerateItem, GenContext.ToolBox.Shell.GetVsVersion()).FireAndForget();

                break;

            case ItemGenerationType.GenerateAndMerge:
                AppHealth.Current.Telemetry.TrackWizardCompletedAsync(wizardType, WizardActionEnum.GenerateAndMergeItem, GenContext.ToolBox.Shell.GetVsVersion()).FireAndForget();
                break;

            default:
                break;
            }
        }
Esempio n. 8
0
        private UserSelection StartWizard(IWizardShell wizardShell, WizardTypeEnum wizardType)
        {
            try
            {
                CleanStatusBar();
                var userSelection = LaunchWizardShell(wizardShell);
                SendTelemetry(wizardType, userSelection);

                if (userSelection != null)
                {
                    return(userSelection);
                }
            }
            catch (Exception ex) when(!(ex is WizardBackoutException))
            {
                (wizardShell as IWindow).SafeClose();
                _dialogService.ShowError(ex);
            }

            CancelWizard();
            return(null);
        }
Esempio n. 9
0
        public UserSelection StartAddTemplate(string language, BaseStyleValuesProvider provider, TemplateType templateType, WizardTypeEnum wizardTypeEnum)
        {
            var addTemplateView = new Views.NewItem.WizardShell(templateType, language, provider);

            return(StartWizard(addTemplateView, wizardTypeEnum));
        }