Esempio n. 1
0
		private VerticalProductName prodName = VerticalProductName.None; //ACAD ???

		#region IWizard Members
		/// <summary>
		/// Runs custom wizard logic at the beginning of a template wizard run. Set the replace parameters
		/// based on the user input.
		/// </summary>
		/// <param name="automationObject">The automation object being used by the template wizard.</param>
		/// <param name="replacementsDictionary">The list of standard parameters to be replaced.</param>
		/// <param name="runKind">A WizardRunKind indicating the type of wizard run.</param>
		/// <param name="customParams">The custom parameters with which to perform parameter replacement in the project.</param>
		void IWizard.RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
		{
			System.Reflection.Assembly ass = System.Reflection.Assembly.GetExecutingAssembly(); // GetEntryAssembly()
			AddInCompany =((AssemblyCompanyAttribute)Attribute.GetCustomAttribute (ass, typeof(AssemblyCompanyAttribute), false)).Company ;
			AssemblyTitleAttribute titleAttr = ass.GetCustomAttributes(typeof(System.Reflection.AssemblyTitleAttribute), false)[0] as AssemblyTitleAttribute;
			AddInProductName = titleAttr.Title;
			AddInVersion =ass.GetName ().Version.ToString () ;

			//- Display the wizard UI to gather user input. 
			//- If the user cancels the UI, return to the new project dialog.
			ObjectARXLocatorForm optForm = new ObjectARXLocatorForm();
			if (optForm.ShowDialog() != DialogResult.OK)
				throw new WizardBackoutException();

			this.sdkpath = optForm.sdkpath.Text;
			this.acadpath = optForm.acadpath.Text;

			this.prodName = optForm.CurrentVerticalProductName;

			#region Get AutoCAD References UI check status
			//AutoCAD  
			this.acdbmgd = optForm.acdbmgd.Checked;
			this.acmgd = optForm.acmgd.Checked;
			this.accoremgd = optForm.accoremgd.Checked;
			this.adwindows = optForm.adwindows.Checked;
			this.acwindows = optForm.acwindows.Checked;
			this.actcmgd = optForm.actcmgd.Checked;
			this.acdx = optForm.acdx.Checked;
			this.interop0 = optForm.interop0.Checked;
			this.interop1 = optForm.interop1.Checked;
			this.acdbmgdbrep = optForm.acdbmgdbrep.Checked;
			this.accui = optForm.accui.Checked;
			#endregion
			#region Get Map 3D References UI check status
			//Map 3D
			if (prodName == VerticalProductName.Map3D)
			{
				this.fdopath = this.acadpath + "\\bin\\fdo";
				//map 3d
				this.mapPlatform = optForm.mapPlatform.Checked;
				this.mapPlatformCore = optForm.mapPlatformCore.Checked;
				this.osgeoMgFoundation = optForm.OsgeoMgFoundation.Checked;
				this.osgeoMgGeom = optForm.OsgeoMgGeom.Checked;
				this.osgeoMgPlatformBase = optForm.OsgeoMgPlatformBase.Checked;
				this.osgeoFdoCommon = optForm.OsgeoFdoCommon.Checked;
				this.osgeoFdoGeom = optForm.OsgeoFdoGeom.Checked;
				this.osgeoFdo = optForm.OsgeoFdo.Checked;
				this.acMPloygonMgd = optForm.AcMPloygonMgd.Checked;
				this.mgdMapApi = optForm.MgdMapApi.Checked;
			}
			#endregion
			#region Get Civil 3D References UI check status            
			//Civil 3D
			if (prodName == VerticalProductName.Civil3D)
			{
				this.fdopath = this.acadpath + "\\bin\\fdo";
				//map3d
				this.mapPlatform = optForm.mapPlatform.Checked;
				this.mapPlatformCore = optForm.mapPlatformCore.Checked;
				this.osgeoMgFoundation = optForm.OsgeoMgFoundation.Checked;
				this.osgeoMgGeom = optForm.OsgeoMgGeom.Checked;
				this.osgeoMgPlatformBase = optForm.OsgeoMgPlatformBase.Checked;
				this.osgeoFdoCommon = optForm.OsgeoFdoCommon.Checked;
				this.osgeoFdoGeom = optForm.OsgeoFdoGeom.Checked;
				this.osgeoFdo = optForm.OsgeoFdo.Checked;
				this.acMPloygonMgd = optForm.AcMPloygonMgd.Checked;
				this.mgdMapApi = optForm.MgdMapApi.Checked;
				//civil 3d
				this.aecBaseMgd = optForm.aecBaseMgd.Checked;
				this.aeccDbMgd = optForm.aeccDbMgd.Checked;
				this.comAeccLand = optForm.aeccLand.Checked;
				this.comAeccPipe = optForm.aeccPipe.Checked;
				this.comAeccSurvey = optForm.aeccSurvey.Checked;
				this.comAeccRoadway = optForm.aeccRoadway.Checked;
				this.civilComCommon = comAeccLand || comAeccPipe
								|| comAeccSurvey || comAeccRoadway;
			}
			#endregion
			#region Get ACA References UI check status 
			//ACA
			if (prodName == VerticalProductName.ACA)
			{
				this.aecArchMgd = optForm.acaAecArchMgd.Checked;
				this.aecArchDACHMgd = optForm.acaArchDACHMgd.Checked;
				this.aecBaseMgd = optForm.acaAecBaseMgd.Checked;
				this.aecBaseUtilsMgd = optForm.acaAecBaseUtilsMgd.Checked;
				this.aecProjectBaseMgd = optForm.acaAecProjectBaseMgd.Checked;
				this.aecPropDataMgd = optForm.acaAecPropDataMgd.Checked;
				this.aecRcpMgd = optForm.acaAecRcpMgd.Checked;
				this.aecStructureMgd = optForm.acaAecStructureMgd.Checked;
				this.aecUIBaseMgd = optForm.acaAecUIBaseMgd.Checked;
				this.aecUtilityMgd = optForm.acaAecUtilityMgd.Checked;
			}
			#endregion
			#region Get AME References UI check status
			//AME
			if (prodName == VerticalProductName.AME)
			{
				this.aecArchMgd = optForm.ameAecArchMgd.Checked;
				this.aecArchDACHMgd = optForm.ameAecArchDACHMgd.Checked;
				this.aecBaseMgd = optForm.ameAecBaseMgd.Checked;
				this.aecBaseUtilsMgd = optForm.ameAecBaseUtilsMgd.Checked;
				this.aecProjectBaseMgd = optForm.ameAecProjectBaseMgd.Checked;
				this.aecPropDataMgd = optForm.ameAecPropDataMgd.Checked;
				this.aecRcpMgd = optForm.ameAecRcpMgd.Checked;
				this.aecStructureMgd = optForm.ameAecStructureMgd.Checked;
				this.aecUIBaseMgd = optForm.ameAecUIBaseMgd.Checked;
				this.aecUtilityMgd = optForm.ameAecUtilityMgd.Checked;

				this.aecbBldSrvMgd = optForm.ameAecbBldSrvMgd.Checked;
				this.aecbElecBaseMgd = optForm.ameAecbElecBaseMgd.Checked;
				this.aecbHvacBaseMgd = optForm.ameAecbHvacBaseMgd.Checked;
				this.aecbPlumbingBaseMgd = optForm.ameAecbPlumbingBaseMgd.Checked;
				this.aecbPipeBaseMgd = optForm.ameAecbPipeBaseMgd.Checked;
				this.aecbPartBaseMgd = optForm.ameAecbPartBaseMgd.Checked;
			}
			#endregion

			//- This approach works for both Express Editions and full VS
			this.AddReferencesOnExpress(replacementsDictionary);

			// Replace parameters can be added dynamically in IWizard.RunStarted, 
			// as demonstrated in the code below.
			//replacementsDictionary.Add("$AboutBoxCodeProjectItem$", "");

			// CustomParameters in .vstemplate file contains default replace parameters.
			// If the user chooses not to use them, reset these replace parameters to 
			// empty string so that they don't appear in the generated code.
			//replacementsDictionary["$EditMenuItemsCreation$"] = "";
		}
Esempio n. 2
0
        private VerticalProductName prodName = VerticalProductName.None;         //ACAD ???

        #region IWizard Members
        /// <summary>
        /// Runs custom wizard logic at the beginning of a template wizard run. Set the replace parameters
        /// based on the user input.
        /// </summary>
        /// <param name="automationObject">The automation object being used by the template wizard.</param>
        /// <param name="replacementsDictionary">The list of standard parameters to be replaced.</param>
        /// <param name="runKind">A WizardRunKind indicating the type of wizard run.</param>
        /// <param name="customParams">The custom parameters with which to perform parameter replacement in the project.</param>
        void IWizard.RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            System.Reflection.Assembly ass = System.Reflection.Assembly.GetExecutingAssembly();             // GetEntryAssembly()
            AddInCompany = ((AssemblyCompanyAttribute)Attribute.GetCustomAttribute(ass, typeof(AssemblyCompanyAttribute), false)).Company;
            AssemblyTitleAttribute titleAttr = ass.GetCustomAttributes(typeof(System.Reflection.AssemblyTitleAttribute), false)[0] as AssemblyTitleAttribute;

            AddInProductName = titleAttr.Title;
            AddInVersion     = ass.GetName().Version.ToString();

            //- Display the wizard UI to gather user input.
            //- If the user cancels the UI, return to the new project dialog.
            ObjectARXLocatorForm optForm = new ObjectARXLocatorForm();

            if (optForm.ShowDialog() != DialogResult.OK)
            {
                throw new WizardBackoutException();
            }

            this.sdkpath  = optForm.sdkpath.Text;
            this.acadpath = optForm.acadpath.Text;

            this.prodName = optForm.CurrentVerticalProductName;

            #region Get AutoCAD References UI check status
            //AutoCAD
            this.acdbmgd     = optForm.acdbmgd.Checked;
            this.acmgd       = optForm.acmgd.Checked;
            this.accoremgd   = optForm.accoremgd.Checked;
            this.adwindows   = optForm.adwindows.Checked;
            this.acwindows   = optForm.acwindows.Checked;
            this.actcmgd     = optForm.actcmgd.Checked;
            this.acdx        = optForm.acdx.Checked;
            this.interop0    = optForm.interop0.Checked;
            this.interop1    = optForm.interop1.Checked;
            this.acdbmgdbrep = optForm.acdbmgdbrep.Checked;
            this.accui       = optForm.accui.Checked;
            #endregion
            #region Get Map 3D References UI check status
            //Map 3D
            if (prodName == VerticalProductName.Map3D)
            {
                this.fdopath = this.acadpath + "\\bin\\fdo";
                //map 3d
                this.mapPlatform         = optForm.mapPlatform.Checked;
                this.mapPlatformCore     = optForm.mapPlatformCore.Checked;
                this.osgeoMgFoundation   = optForm.OsgeoMgFoundation.Checked;
                this.osgeoMgGeom         = optForm.OsgeoMgGeom.Checked;
                this.osgeoMgPlatformBase = optForm.OsgeoMgPlatformBase.Checked;
                this.osgeoFdoCommon      = optForm.OsgeoFdoCommon.Checked;
                this.osgeoFdoGeom        = optForm.OsgeoFdoGeom.Checked;
                this.osgeoFdo            = optForm.OsgeoFdo.Checked;
                this.acMPloygonMgd       = optForm.AcMPloygonMgd.Checked;
                this.mgdMapApi           = optForm.MgdMapApi.Checked;
            }
            #endregion
            #region Get Civil 3D References UI check status
            //Civil 3D
            if (prodName == VerticalProductName.Civil3D)
            {
                this.fdopath = this.acadpath + "\\bin\\fdo";
                //map3d
                this.mapPlatform         = optForm.mapPlatform.Checked;
                this.mapPlatformCore     = optForm.mapPlatformCore.Checked;
                this.osgeoMgFoundation   = optForm.OsgeoMgFoundation.Checked;
                this.osgeoMgGeom         = optForm.OsgeoMgGeom.Checked;
                this.osgeoMgPlatformBase = optForm.OsgeoMgPlatformBase.Checked;
                this.osgeoFdoCommon      = optForm.OsgeoFdoCommon.Checked;
                this.osgeoFdoGeom        = optForm.OsgeoFdoGeom.Checked;
                this.osgeoFdo            = optForm.OsgeoFdo.Checked;
                this.acMPloygonMgd       = optForm.AcMPloygonMgd.Checked;
                this.mgdMapApi           = optForm.MgdMapApi.Checked;
                //civil 3d
                this.aecBaseMgd     = optForm.aecBaseMgd.Checked;
                this.aeccDbMgd      = optForm.aeccDbMgd.Checked;
                this.comAeccLand    = optForm.aeccLand.Checked;
                this.comAeccPipe    = optForm.aeccPipe.Checked;
                this.comAeccSurvey  = optForm.aeccSurvey.Checked;
                this.comAeccRoadway = optForm.aeccRoadway.Checked;
                this.civilComCommon = comAeccLand || comAeccPipe ||
                                      comAeccSurvey || comAeccRoadway;
            }
            #endregion
            #region Get ACA References UI check status
            //ACA
            if (prodName == VerticalProductName.ACA)
            {
                this.aecArchMgd        = optForm.acaAecArchMgd.Checked;
                this.aecArchDACHMgd    = optForm.acaArchDACHMgd.Checked;
                this.aecBaseMgd        = optForm.acaAecBaseMgd.Checked;
                this.aecBaseUtilsMgd   = optForm.acaAecBaseUtilsMgd.Checked;
                this.aecProjectBaseMgd = optForm.acaAecProjectBaseMgd.Checked;
                this.aecPropDataMgd    = optForm.acaAecPropDataMgd.Checked;
                this.aecRcpMgd         = optForm.acaAecRcpMgd.Checked;
                this.aecStructureMgd   = optForm.acaAecStructureMgd.Checked;
                this.aecUIBaseMgd      = optForm.acaAecUIBaseMgd.Checked;
                this.aecUtilityMgd     = optForm.acaAecUtilityMgd.Checked;
            }
            #endregion
            #region Get AME References UI check status
            //AME
            if (prodName == VerticalProductName.AME)
            {
                this.aecArchMgd        = optForm.ameAecArchMgd.Checked;
                this.aecArchDACHMgd    = optForm.ameAecArchDACHMgd.Checked;
                this.aecBaseMgd        = optForm.ameAecBaseMgd.Checked;
                this.aecBaseUtilsMgd   = optForm.ameAecBaseUtilsMgd.Checked;
                this.aecProjectBaseMgd = optForm.ameAecProjectBaseMgd.Checked;
                this.aecPropDataMgd    = optForm.ameAecPropDataMgd.Checked;
                this.aecRcpMgd         = optForm.ameAecRcpMgd.Checked;
                this.aecStructureMgd   = optForm.ameAecStructureMgd.Checked;
                this.aecUIBaseMgd      = optForm.ameAecUIBaseMgd.Checked;
                this.aecUtilityMgd     = optForm.ameAecUtilityMgd.Checked;

                this.aecbBldSrvMgd       = optForm.ameAecbBldSrvMgd.Checked;
                this.aecbElecBaseMgd     = optForm.ameAecbElecBaseMgd.Checked;
                this.aecbHvacBaseMgd     = optForm.ameAecbHvacBaseMgd.Checked;
                this.aecbPlumbingBaseMgd = optForm.ameAecbPlumbingBaseMgd.Checked;
                this.aecbPipeBaseMgd     = optForm.ameAecbPipeBaseMgd.Checked;
                this.aecbPartBaseMgd     = optForm.ameAecbPartBaseMgd.Checked;
            }
            #endregion

            //- This approach works for both Express Editions and full VS
            this.AddReferencesOnExpress(replacementsDictionary);

            // Replace parameters can be added dynamically in IWizard.RunStarted,
            // as demonstrated in the code below.
            //replacementsDictionary.Add("$AboutBoxCodeProjectItem$", "");

            // CustomParameters in .vstemplate file contains default replace parameters.
            // If the user chooses not to use them, reset these replace parameters to
            // empty string so that they don't appear in the generated code.
            //replacementsDictionary["$EditMenuItemsCreation$"] = "";
        }