Defines the event args for the active configuration change event.
상속: System.EventArgs
예제 #1
0
파일: ProjectNode.cs 프로젝트: rsdn/nemerle
        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);
        }
예제 #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);
        }
예제 #3
0
        protected override void OnHandleConfigurationRelatedGlobalProperties(object sender, ActiveConfigurationChangedEventArgs eventArgs)
        {
            base.OnHandleConfigurationRelatedGlobalProperties(sender, eventArgs);

            _projectInfo.Engine.RequestOnReloadProject();
        }