Defines the event args for the active configuration change event.
Inheritance: System.EventArgs
Ejemplo n.º 1
0
        protected virtual void OnHandleConfigurationRelatedGlobalProperties(object sender, ActiveConfigurationChangedEventArgs eventArgs)
        {
            Debug.Assert(eventArgs != null, "Wrong hierarchy passed as event arg for the configuration change listener.");

            // If (eventArgs.Hierarchy == NULL) then we received this event because the solution configuration
            // was changed.
            // If it is not null we got the event because a project in teh configuration manager has changed its active configuration.
            // We care only about our project in the default implementation.
            if (eventArgs == null || eventArgs.Hierarchy == null || !Utilities.IsSameComObject(eventArgs.Hierarchy, this))
                return;

            string name, platform;
            if (!Utilities.TryGetActiveConfigurationAndPlatform(this.Site, this, out name, out platform))
                throw new InvalidOperationException();

            this.buildProject.SetGlobalProperty(GlobalProperty.Configuration.ToString(), name);

            platform = ProjectConfig.ToMSBuildPlatform(platform);

            this.buildProject.SetGlobalProperty(GlobalProperty.Platform.ToString(), platform);
        }
Ejemplo n.º 2
0
        protected virtual void OnHandleConfigurationRelatedGlobalProperties(object sender, ActiveConfigurationChangedEventArgs eventArgs)
        {
            Debug.Assert(eventArgs != null, "Wrong hierarchy passed as event arg for the configuration change listener.");

            // If (eventArgs.Hierarchy == NULL) then we received this event because the solution configuration
            // was changed.
            // If it is not null we got the event because a project in teh configuration manager has changed its active configuration.
            // We care only about our project in the default implementation.
            if (eventArgs == null || eventArgs.Hierarchy == null || !Utilities.IsSameComObject(eventArgs.Hierarchy, this))
            {
                return;
            }

            string name, platform;
            if (!Utilities.TryGetActiveConfigurationAndPlatform(this.Site, this, out name, out platform))
            {
                throw new InvalidOperationException();
            }

            this.buildProject.SetGlobalProperty(GlobalProperty.Configuration.ToString(), name);

            // If the platform is "Any CPU" then it should be set to AnyCPU, since that is the property value in MsBuild terms.
            if (String.Compare(platform, ConfigProvider.AnyCPUPlatform, StringComparison.Ordinal) == 0)
            {
                platform = ProjectFileValues.AnyCPU;
            }

            this.buildProject.SetGlobalProperty(GlobalProperty.Platform.ToString(), platform);
        }
Ejemplo n.º 3
0
        protected override void OnHandleConfigurationRelatedGlobalProperties(object sender, ActiveConfigurationChangedEventArgs eventArgs)
        {
            base.OnHandleConfigurationRelatedGlobalProperties(sender, eventArgs);

            _projectInfo.Engine.RequestOnReloadProject();
        }