public override BuildKeyedList <BuildConfiguration> Clone() { BuildConfigurationList clonedList = new BuildConfigurationList(this); int itemCount = this.Count; for (int i = 0; i < itemCount; i++) { clonedList.Add(this[i].Clone()); } return(clonedList); }
/// <overloads> /// Initializes a new instance of the <see cref="BuildEngineSettings"/> class. /// </overloads> /// <summary> /// Initializes a new instance of the <see cref="BuildEngineSettings"/> class /// with the default parameters. /// </summary> /// <param name="name"> /// The name uniquely identifying this engine settings. /// </param> /// <param name="engineType"> /// The engine type implementing this settings. /// </param> protected BuildEngineSettings(string name, BuildEngineType engineType) { BuildExceptions.NotNullNotEmpty(name, "name"); _engineName = name; _engineType = engineType; _properties = new BuildProperties(); _sharedContent = new SharedContent(_engineType.ToString()); _includeContent = new IncludeContent(_engineType.ToString()); _configurations = new BuildConfigurationList(_engineType); _pluginConfigurations = new BuildConfigurationList(_engineType); _componentConfigurations = new BuildComponentConfigurationList(_engineType); _pluginComponentConfigurations = new BuildComponentConfigurationList(_engineType); }
/// <summary> /// Initializes a new instance of the <see cref="BuildEngineSettings"/> class /// with parameters copied from the specified instance of the /// <see cref="BuildEngineSettings"/> class, a copy constructor. /// </summary> /// <param name="source"> /// An instance of the <see cref="BuildEngineSettings"/> class from which the /// initialization parameters or values will be copied. /// </param> /// <exception cref="ArgumentNullException"> /// If the parameter <paramref name="source"/> is <see langword="null"/>. /// </exception> protected BuildEngineSettings(BuildEngineSettings source) : base(source) { _engineName = source._engineName; _engineType = source._engineType; _properties = source._properties; _sharedContent = source._sharedContent; _includeContent = source._includeContent; _configurations = source._configurations; _pluginConfigurations = source._pluginConfigurations; _componentConfigurations = source._componentConfigurations; _pluginComponentConfigurations = source._pluginComponentConfigurations; }
/// <summary> /// Initializes a new instance of the <see cref="BuildConfigurationList"/> class /// with parameters copied from the specified instance of the /// <see cref="BuildConfigurationList"/> class, a copy constructor. /// </summary> /// <param name="source"> /// An instance of the <see cref="BuildConfigurationList"/> class from which the /// initialization parameters or values will be copied. /// </param> /// <exception cref="ArgumentNullException"> /// If the parameter <paramref name="source"/> is <see langword="null"/>. /// </exception> public BuildConfigurationList(BuildConfigurationList source) : base(source) { _engineType = source._engineType; }
private void ReadXmlConfiguration(XmlReader reader) { string startElement = reader.Name; Debug.Assert(String.Equals(startElement, "configurations")); if (reader.IsEmptyElement) { return; } // Determine whether we are dealing with plugin or system configuration bool isPlugin = String.Equals(reader.GetAttribute("type"), "Plugin", StringComparison.OrdinalIgnoreCase); if (_configurations == null) { _configurations = new BuildConfigurationList(); } if (_pluginConfigurations == null) { _pluginConfigurations = new BuildConfigurationList(); } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { if (String.Equals(reader.Name, BuildConfiguration.TagName, StringComparison.OrdinalIgnoreCase)) { BuildConfiguration configuration = null; string tempText = reader.GetAttribute("name"); if (!String.IsNullOrEmpty(tempText)) { if (isPlugin) { configuration = _pluginConfigurations[tempText]; } else { configuration = _configurations[tempText]; } // If the configuration is not found, lets create it... if (configuration == null) { configuration = this.OnCreateConfiguration( tempText, isPlugin); if (configuration != null) { if (isPlugin) { _pluginConfigurations.Add(configuration); } else { _configurations.Add(configuration); } } } } if (configuration == null) { if (isPlugin) { throw new BuildException(String.Format( "The plugin configuration '{0}' cannot be found.", tempText)); } else { throw new BuildException(String.Format( "The system configuration '{0}' cannot be found.", tempText)); } } configuration.ReadXml(reader); } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, startElement, StringComparison.OrdinalIgnoreCase)) { break; } } } }