/// <summary> /// Sets all given declaration for declarations with given name. /// </summary> /// <param name="key">The key.</param> /// <param name="values">The values.</param> public void SetAll(QualifiedName key, IEnumerable <T> values) { if (!copied) { this.declarations = new CopyDeclarationContainer <T>(declarations); copied = true; } this.declarations.SetAll(key, values); }
/// <summary> /// Adds new declaration into the structure. If there /// </summary> /// <param name="key">The key.</param> /// <param name="value">The value.</param> public void Add(QualifiedName key, T value) { if (!copied) { declarations = new CopyDeclarationContainer <T>(declarations); copied = true; } declarations.Add(key, value); }
/// <summary> /// Initializes a new instance of the <see cref="CopyDeclarationContainer{T}"/> class and copy data from the given one. /// </summary> /// <param name="container">The container.</param> public LazyCopyDeclarationContainer(LazyCopyDeclarationContainer <T> container) { declarations = container.declarations; copied = false; }
/// <summary> /// Initializes a new instance of the <see cref="CopyDeclarationContainer{T}"/> class. /// </summary> public LazyCopyDeclarationContainer() { declarations = new CopyDeclarationContainer <T>(); copied = true; }