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);
}