예제 #1
0
파일: MainWizard.cs 프로젝트: oeoen/SharpDX
        public void RunStarted(object automationObject, Dictionary <string, string> props, WizardRunKind runKind, object[] customParams)
        {
            this.dte = automationObject as EnvDTE._DTE;

            // Check that SharpDX is correctly installed
            if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SharpDXSdkDir")))
            {
                MessageBox.Show("Unable to find SharpDX installation directory. Expecting [SharpDXSdkDir] environment variable", "SharpDX Toolkit Wizard Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                throw new WizardCancelledException("Expecting [SharpDXSdkDir] environment variable");
            }
            props.Add("$safeclassname$", props["$safeprojectname$"].Replace(".", string.Empty));

            props["$currentVsCulture$"] = System.Threading.Thread.CurrentThread.CurrentUICulture.Name;

            //Call win form created in the project to accept user input
            wizardForm = new WizardForm(props);
            var result = wizardForm.ShowDialog();

            if (result == DialogResult.Cancel)
            {
                throw new WizardCancelledException();
            }

            // Hack on WinRT / WinRT XAML to run the certificate wizards as well as our own wizard
            if (GetKey(props, "$sharpdx_platform_winrt$") || GetKey(props, "$sharpdx_platform_winrt_xaml$"))
            {
                try
                {
                    var assembly = Assembly.Load("Microsoft.VisualStudio.WinRT.TemplateWizards, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
                    var type     = assembly.GetType("Microsoft.VisualStudio.WinRT.TemplateWizards.CreateProjectCertificate.Wizard");
                    winRTCertificateWizard = (IWizard)Activator.CreateInstance(type);
                }
                catch (Exception ex)
                {
                }
            }
            if (winRTCertificateWizard != null)
            {
                winRTCertificateWizard.RunStarted(automationObject, props, runKind, customParams);
            }

            // Set spritebatch feature if spritetexture or spritefont is true
            if (GetKey(props, "$sharpdx_feature_spritetexture$") || GetKey(props, "$sharpdx_feature_spritefont$"))
            {
                props["$sharpdx_feature_spritebatch$"] = "true";
            }

            if (GetKey(props, "$sharpdx_feature_model3d$") || GetKey(props, "$sharpdx_feature_primitive3d$"))
            {
                props["$sharpdx_feature_3d$"] = "true";
            }

            if (GetKey(props, "$sharpdx_platform_winrt_xaml$"))
            {
                props["$sharpdx_platform_winrt$"] = "true";
            }

            isPlatformWP8 = props.ContainsKey("$sharpdx_platform_wp8$");
        }
예제 #2
0
        public void RunStarted(object automationObject, Dictionary <string, string> props, WizardRunKind runKind, object[] customParams)
        {
            this.dte = automationObject as EnvDTE._DTE;

            props.Add("$safeclassname$", props["$safeprojectname$"].Replace(".", string.Empty));
            props["$currentVsCulture$"] = System.Threading.Thread.CurrentThread.CurrentUICulture.Name;

            //Call win form created in the project to accept user input
            wizardForm = new WizardForm(props);
            var result = wizardForm.ShowDialog();

            if (result == DialogResult.Cancel)
            {
                throw new WizardCancelledException();
            }

            // Hack on WinRT / WinRT XAML to run the certificate wizards as well as our own wizard
            if (GetKey(props, "$sharpdx_platform_winrt$") || GetKey(props, "$sharpdx_platform_winrt_xaml$"))
            {
                try
                {
                    var assembly = Assembly.Load("Microsoft.VisualStudio.WinRT.TemplateWizards, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
                    var type     = assembly.GetType("Microsoft.VisualStudio.WinRT.TemplateWizards.CreateProjectCertificate.Wizard");
                    winRTCertificateWizard = (IWizard)Activator.CreateInstance(type);
                }
                catch (Exception ex)
                {
                }
            }
            if (winRTCertificateWizard != null)
            {
                winRTCertificateWizard.RunStarted(automationObject, props, runKind, customParams);
            }

            // Set spritebatch feature if spritetexture or spritefont is true
            if (GetKey(props, "$sharpdx_feature_spritetexture$") || GetKey(props, "$sharpdx_feature_spritefont$"))
            {
                props["$sharpdx_feature_spritebatch$"] = "true";
            }

            if (GetKey(props, "$sharpdx_feature_model3d$") || GetKey(props, "$sharpdx_feature_primitive3d$"))
            {
                props["$sharpdx_feature_3d$"] = "true";
            }

            if (GetKey(props, "$sharpdx_platform_winrt_xaml$"))
            {
                props["$sharpdx_platform_winrt$"] = "true";
            }
        }
예제 #3
0
        public void RunStarted(object automationObject, Dictionary<string, string> props, WizardRunKind runKind, object[] customParams)
        {
            this.dte = automationObject as EnvDTE._DTE;

            // Check that SharpDX is correctly installed
            if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SharpDXSdkDir")))
            {
                MessageBox.Show("Unable to find SharpDX installation directory. Expecting [SharpDXSdkDir] environment variable", "SharpDX Toolkit Wizard Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                throw new WizardCancelledException("Expecting [SharpDXSdkDir] environment variable");
            }
            props.Add("$safeclassname$", props["$safeprojectname$"].Replace(".", string.Empty));

            props["$currentVsCulture$"] = System.Threading.Thread.CurrentThread.CurrentUICulture.Name;

            //Call win form created in the project to accept user input
            wizardForm = new WizardForm(props);
            var result = wizardForm.ShowDialog();
            if (result == DialogResult.Cancel)
            {
                throw new WizardCancelledException();
            }

            // Hack on WinRT / WinRT XAML to run the certificate wizards as well as our own wizard
            if (GetKey(props, "$sharpdx_platform_winrt$") || GetKey(props, "$sharpdx_platform_winrt_xaml$"))
            {
                try
                {
                    var assembly = Assembly.Load("Microsoft.VisualStudio.WinRT.TemplateWizards, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
                    var type = assembly.GetType("Microsoft.VisualStudio.WinRT.TemplateWizards.CreateProjectCertificate.Wizard");
                    winRTCertificateWizard = (IWizard)Activator.CreateInstance(type);
                }
                catch (Exception ex)
                {
                }
            }
            if (winRTCertificateWizard != null) winRTCertificateWizard.RunStarted(automationObject, props, runKind, customParams);

            // Set spritebatch feature if spritetexture or spritefont is true
            if (GetKey(props, "$sharpdx_feature_spritetexture$") || GetKey(props, "$sharpdx_feature_spritefont$"))
            {
                props["$sharpdx_feature_spritebatch$"] = "true";
            }

            if (GetKey(props, "$sharpdx_feature_model3d$") || GetKey(props, "$sharpdx_feature_primitive3d$"))
            {
                props["$sharpdx_feature_3d$"] = "true";
            }

            if (GetKey(props, "$sharpdx_platform_winrt_xaml$"))
            {
                props["$sharpdx_platform_winrt$"] = "true";
            }

            isPlatformWP8 = props.ContainsKey("$sharpdx_platform_wp8$");
        }
예제 #4
0
        public void RunStarted(object automationObject, Dictionary<string, string> props, WizardRunKind runKind, object[] customParams)
        {
            this.dte = automationObject as EnvDTE._DTE;

            props.Add("$safeclassname$", props["$safeprojectname$"].Replace(".", string.Empty));
            props["$currentVsCulture$"] = System.Threading.Thread.CurrentThread.CurrentUICulture.Name;

            //Call win form created in the project to accept user input
            wizardForm = new WizardForm(props);
            var result = wizardForm.ShowDialog();
            if (result == DialogResult.Cancel)
            {
                throw new WizardCancelledException();
            }

            // Hack on WinRT / WinRT XAML to run the certificate wizards as well as our own wizard
            if (GetKey(props, "$sharpdx_platform_winrt$") || GetKey(props, "$sharpdx_platform_winrt_xaml$"))
            {
                try
                {
                    var assembly = Assembly.Load("Microsoft.VisualStudio.WinRT.TemplateWizards, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
                    var type = assembly.GetType("Microsoft.VisualStudio.WinRT.TemplateWizards.CreateProjectCertificate.Wizard");
                    winRTCertificateWizard = (IWizard)Activator.CreateInstance(type);
                }
                catch (Exception ex)
                {
                }
            }
            if (winRTCertificateWizard != null) winRTCertificateWizard.RunStarted(automationObject, props, runKind, customParams);

            // Set spritebatch feature if spritetexture or spritefont is true
            if (GetKey(props, "$sharpdx_feature_spritetexture$") || GetKey(props, "$sharpdx_feature_spritefont$"))
            {
                props["$sharpdx_feature_spritebatch$"] = "true";
            }

            if (GetKey(props, "$sharpdx_feature_model3d$") || GetKey(props, "$sharpdx_feature_primitive3d$"))
            {
                props["$sharpdx_feature_3d$"] = "true";
            }

            if (GetKey(props, "$sharpdx_platform_winrt_xaml$"))
            {
                props["$sharpdx_platform_winrt$"] = "true";
            }
        }