/// <summary> /// Initializes a new instance of the <see cref="BuildKeyedList{T}"/> class /// with parameters copied from the specified instance of the /// <see cref="BuildKeyedList{T}"/> class, a copy constructor. /// </summary> /// <param name="source"> /// An instance of the <see cref="BuildKeyedList{T}"/> 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 BuildKeyedList(BuildKeyedList <T> source) { BuildExceptions.NotNull(source, "source"); _version = source._version; _dicItems = source._dicItems; }
/// <summary> /// Initializes a new instance of the <see cref="BuildCredentialProvider"/> class /// with properties from the specified source, a copy constructor. /// </summary> /// <param name="source"> /// An instance of the <see cref="BuildCredentialProvider"/> 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 BuildCredentialProvider(BuildCredentialProvider source) : base(source) { _isLoaded = source._isLoaded; _isModified = source._isModified; _credentials = source._credentials; }
public void Clear() { if (_listTopics != null) { _listTopics = new BuildKeyedList <BuildTopicTocInfo>(); } }
public BuildTopicTocInfo(BuildTopicTocInfo source) : base(source) { _source = source._source; _container = source._container; _parent = source._parent; _listTopics = source._listTopics; }
/// <overloads> /// Initializes a new instance of the <see cref="BuildDocumenter"/> class. /// </overloads> /// <summary> /// Initializes a new instance of the <see cref="BuildDocumenter"/> class /// to the default properties or values. /// </summary> public BuildDocumenter() { _documentId = Guid.NewGuid().ToString(); _version = new Version(1, 0, 0, 0); _settings = new BuildSettings(); _listGroups = new BuildKeyedList <BuildGroup>(); _listSources = new BuildKeyedList <BuildGroupSource>(); }
public BuildTocContext() { _properties = new BuildProperties(); _listItems = new BuildKeyedList <BuildGroupTocInfo>(); _relatedTopics = new BuildKeyedList <BuildTopicTocInfo>(); _dicItems = _listItems.Dictionary; }
public void AddGroup(BuildGroup group) { BuildExceptions.NotNull(group, "group"); if (_listGroups == null) { _listGroups = new BuildKeyedList <BuildGroup>(); } _listGroups.Add(group); }
public void AddSource(BuildGroupSource source) { BuildExceptions.NotNull(source, "source"); if (_listSources == null) { _listSources = new BuildKeyedList <BuildGroupSource>(); } _listSources.Add(source); }
public void AddRange(IList <BuildTopicTocInfo> items) { if (items == null || items.Count == 0) { return; } if (_listTopics == null) { _listTopics = new BuildKeyedList <BuildTopicTocInfo>(); } _listTopics.Add(items); }
public void InsertRange(int index, BuildGroupTocInfo groupTocInfo) { if (groupTocInfo == null || groupTocInfo.Count == 0) { return; } if (_listTopics == null) { _listTopics = new BuildKeyedList <BuildTopicTocInfo>(); } _listTopics.Insert(index, groupTocInfo.Items); }
public void InsertRange(int index, IList <BuildTopicTocInfo> items) { if (items == null || items.Count == 0) { return; } if (_listTopics == null) { _listTopics = new BuildKeyedList <BuildTopicTocInfo>(); } _listTopics.Insert(index, items); }
public void AddRange(BuildGroupTocInfo groupTocInfo) { if (groupTocInfo == null || groupTocInfo.Count == 0) { return; } if (_listTopics == null) { _listTopics = new BuildKeyedList <BuildTopicTocInfo>(); } _listTopics.Add(groupTocInfo.Items); }
public virtual BuildKeyedList <T> Clone() { BuildKeyedList <T> clonedList = new BuildKeyedList <T>(this); int itemCount = this.Count; for (int i = 0; i < itemCount; i++) { clonedList.Add((T)this[i].Clone()); } return(clonedList); }
public void Add(BuildTopicTocInfo item) { if (item == null) { return; } if (_listTopics == null) { _listTopics = new BuildKeyedList <BuildTopicTocInfo>(); } _listTopics.Add(item); }
public void Insert(int index, BuildTopicTocInfo item) { if (item == null) { return; } if (_listTopics == null) { _listTopics = new BuildKeyedList <BuildTopicTocInfo>(); } _listTopics.Insert(index, item); }
/// <overloads> /// Initializes a new instance of the <see cref="BuildCredentialProvider"/> class. /// </overloads> /// <summary> /// Initializes a new instance of the <see cref="BuildCredentialProvider"/> class /// to the default values. /// </summary> protected BuildCredentialProvider() { _credentials = new BuildKeyedList <BuildCredential>(); }
/// <summary> /// This reads and sets its state or attributes stored in a <c>XML</c> format /// with the given reader. /// </summary> /// <param name="reader"> /// The reader with which the <c>XML</c> attributes of this object are accessed. /// </param> /// <exception cref="ArgumentNullException"> /// If the <paramref name="reader"/> is <see langword="null"/>. /// </exception> public override void ReadXml(XmlReader reader) { BuildExceptions.NotNull(reader, "reader"); Debug.Assert(reader.NodeType == XmlNodeType.Element); if (reader.NodeType != XmlNodeType.Element) { return; } if (!String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { Debug.Assert(false, String.Format( "The element name '{0}' does not match the expected '{1}'.", reader.Name, TagName)); return; } // Read the version information of the file group... string tempText = reader.GetAttribute("version"); if (!String.IsNullOrEmpty(tempText)) { _version = new Version(tempText); } if (reader.IsEmptyElement) { return; } if (_listGroups == null || _listGroups.Count != 0) { _listGroups = new BuildKeyedList <BuildGroup>(); } if (_listSources == null || _listSources.Count != 0) { _listSources = new BuildKeyedList <BuildGroupSource>(); } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { if (String.Equals(reader.Name, BuildSettings.TagName, StringComparison.OrdinalIgnoreCase)) { if (_settings == null) { _settings = new BuildSettings(); } _settings.ReadXml(reader); } else if (String.Equals(reader.Name, BuildGroup.TagName, StringComparison.OrdinalIgnoreCase)) { BuildGroup group = null; tempText = reader.GetAttribute("type"); if (String.Equals(tempText, "Conceptual", StringComparison.OrdinalIgnoreCase)) { group = new ConceptualGroup(); } else if (String.Equals(tempText, "Reference", StringComparison.OrdinalIgnoreCase)) { group = new ReferenceGroup(); } else { throw new NotImplementedException(tempText); } if (reader.IsEmptyElement) { string sourceFile = reader.GetAttribute("source"); if (!String.IsNullOrEmpty(sourceFile)) { group.ContentFile = new BuildFilePath(sourceFile); group.Load(); } } else { group.ReadXml(reader); } _listGroups.Add(group); } else if (String.Equals(reader.Name, BuildGroupSource.TagName, StringComparison.OrdinalIgnoreCase)) { BuildGroupSource source = BuildGroupSource.CreateSource( reader.GetAttribute("name")); if (source == null) { throw new BuildException(String.Format( "The creation of the group source '{0}' failed.", reader.GetAttribute("name"))); } source.ReadXml(reader); _listSources.Add(source); } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { break; } } } }