예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 /// <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;
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CopyDeclarationContainer{T}"/> class.
 /// </summary>
 public LazyCopyDeclarationContainer()
 {
     declarations = new CopyDeclarationContainer <T>();
     copied       = true;
 }