Exemplo n.º 1
0
        /// <summary>
        /// Use the data passed in to initialize the Properties.
        /// </summary>
        /// <param name="dataObject">
        /// This is normally only one our configuration object, which means that
        /// there will be only one elements in configs.
        /// If it is null, we should release it.
        /// </param>
        public void Initialize(object[] dataObjects)
        {
            // If we are editing multiple configuration at once, we may get multiple objects.
            foreach (object dataObject in dataObjects)
            {
                if (dataObject is IVsCfg)
                {
                    // This should be our configuration object, so retrive the specific
                    // class so we can access its properties.
                    CustomPropertyPageProjectFlavorCfg config = CustomPropertyPageProjectFlavorCfg
                                                                .GetCustomPropertyPageProjectFlavorCfgFromIVsCfg((IVsCfg)dataObject);

                    if (!configs.Contains(config))
                    {
                        configs.Add(config);
                    }
                }
            }
        }
        /// <summary>
        /// Allows the base project to ask the project subtype to create an
        /// IVsProjectFlavorCfg object corresponding to each one of its
        /// (project subtype's) configuration objects.
        /// </summary>
        /// <param name="pBaseProjectCfg">
        /// The IVsCfg object of the base project.
        /// </param>
        /// <param name="ppFlavorCfg">
        /// The IVsProjectFlavorCfg object of the project subtype.
        /// </param>
        /// <returns></returns>
        public int CreateProjectFlavorCfg(IVsCfg pBaseProjectCfg,
                                          out IVsProjectFlavorCfg ppFlavorCfg)
        {
            IVsProjectFlavorCfg cfg = null;

            if (innerVsProjectFlavorCfgProvider != null)
            {
                innerVsProjectFlavorCfgProvider.
                CreateProjectFlavorCfg(pBaseProjectCfg, out cfg);
            }

            CustomPropertyPageProjectFlavorCfg configuration =
                new CustomPropertyPageProjectFlavorCfg();

            configuration.Initialize(this, pBaseProjectCfg, cfg);
            ppFlavorCfg = (IVsProjectFlavorCfg)configuration;

            return(VSConstants.S_OK);
        }