Beispiel #1
0
        public static void RunWizardSettingsEntry(XrmPackageSettings packageSettings, VsixApplicationController applicationController, string solutionName)
        {
            //ensure the package settings resolves when the app settings dialog runs
            var resolvePackageSettings = applicationController.ResolveType(typeof(XrmPackageSettings));

            if (resolvePackageSettings == null)
            {
                applicationController.RegisterInstance(typeof(XrmPackageSettings), new XrmPackageSettings());
            }

            if (solutionName != null && string.IsNullOrWhiteSpace(packageSettings.SolutionObjectPrefix))
            {
                packageSettings.SolutionObjectPrefix = solutionName.Split('.').First();
            }

            var serviceFactory = applicationController.ResolveType <IOrganizationConnectionFactory>();
            var recordService  = new XrmRecordService(new XrmRecordConfiguration(), serviceFactory, formService: new XrmFormService());
            var settingsDialog = new XrmPackageSettingsDialog(new DialogController(applicationController), packageSettings, null, recordService, saveButtonLabel: "Next");

            settingsDialog.SaveSettings = false;
            var uriQuery = new UriQuery();

            uriQuery.Add("Modal", true.ToString());
            applicationController.NavigateTo(settingsDialog, uriQuery, showCompletionScreen: false, isModal: true);
        }
        public static void RunWizardSettingsEntry(XrmPackageSettings packageSettings, VsixApplicationController applicationController)
        {
            //ensure the package settings resolves when the app settings dialog runs
            var resolvePackageSettings = applicationController.ResolveType(typeof(XrmPackageSettings));

            if (resolvePackageSettings == null)
            {
                applicationController.RegisterInstance(typeof(XrmPackageSettings), new XrmPackageSettings());
            }

            var settingsDialog = new XrmPackageSettingsDialog(new DialogController(applicationController), packageSettings, null, new XrmRecordService(new XrmRecordConfiguration(), formService: new XrmFormService()));

            settingsDialog.SaveSettings = false;
            var uriQuery = new UriQuery();

            uriQuery.Add("Modal", true.ToString());
            applicationController.RequestNavigate("Main", settingsDialog, uriQuery, showCompletionScreen: false, isModal: true);
        }