Ejemplo n.º 1
0
 public FractalStore(params IFractal[] fractals)
 {
     foreach (var fractal in fractals)
     {
         Inner.Add(fractal);
     }
 }
Ejemplo n.º 2
0
 public ColorizationStore(params IFractalColorizer[] colorizers)
 {
     foreach (var colorizer in colorizers)
     {
         Inner.Add(colorizer);
     }
 }
Ejemplo n.º 3
0
        public void Add(string id, AppClient client)
        {
            Guard.NotNullOrEmpty(id, nameof(id));
            Guard.NotNull(client, nameof(client));

            Inner.Add(id, client);
        }
Ejemplo n.º 4
0
        public AppClients Add(string id, AppClient client)
        {
            Guard.NotNullOrEmpty(id, nameof(id));
            Guard.NotNull(client, nameof(client));

            return(new AppClients(Inner.Add(id, client)));
        }
Ejemplo n.º 5
0
        public static void Main()
        {
            MultiHashDictionary <int, String, Inner> mdict = new MultiHashDictionary <int, String, Inner>();

            mdict.Add(2, "to");
            mdict.Add(2, "deux");
            mdict.Add(2, "two");
            mdict.Add(20, "tyve");
            mdict.Add(20, "tyve");
            mdict.Add(20, "twenty");
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            Console.WriteLine("mdict.Count (keys) is {0}",
                              ((IDictionary <int, Inner>)mdict).Count);
            Console.WriteLine("mdict[2].Count is {0}", mdict[2].Count);
            mdict.Remove(20, "tyve");
            mdict.Remove(20, "twenty");
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            Inner zwei = new Inner();

            zwei.Add("zwei");
            mdict[2]  = zwei;
            mdict[-2] = zwei;
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            zwei.Add("kaksi");
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            Inner empty = new Inner();

            mdict[0] = empty;
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            Console.WriteLine("mdict contains key 0: {0}", mdict.Contains(0));
            mdict.Remove(-2);
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            zwei.Remove("kaksi");
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            zwei.Clear();
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
        }
 /// <summary>Adds an element with the provided key and value to the list.</summary>
 /// <param name="key">The object to use as the key of the element to add.</param>
 /// <param name="value">The object to use as the value of the element to add.</param>
 public void Add(string key, T value)
 {
     EnsureName(key, value);
     if (value != null)
     {
         Lookup.Add(key, value);
     }
     Inner.Add(value);
 }
Ejemplo n.º 7
0
        /// <inheritdoc cref="SortedSet{T}.Add"/>
        public Boolean Add([CanBeNull] T item)
        {
            if (!Set.Add(item !))
            {
                return(false);
            }

            Inner.Add(item);
            return(true);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Adds an element with the provided key and value loader to the <see cref="T:System.Collections.Generic.IDictionary`2"/>.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="valueLoader">The value loader.</param>
 /// <remarks></remarks>
 public virtual void Add(TKey key, Lazy <TValue> valueLoader)
 {
     if (Inner.ContainsKey(key))
     {
         throw new ArgumentException("An element with the same key already exists");
     }
     else
     {
         Inner.Add(key, valueLoader);
     }
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Adds an item or updates it if an item with that key already exists in the collection.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="value">The value.</param>
 /// <param name="updator">The updator.</param>
 /// <remarks></remarks>
 public virtual void AddOrUpdate(TKey key, Lazy <TValue> value, Func <TKey, Lazy <TValue>, Lazy <TValue> > updator)
 {
     if (Inner.ContainsKey(key))
     {
         Inner[key] = updator(key, Inner[key]);
     }
     else
     {
         Inner.Add(key, value);
     }
 }
 public void Add(T item)
 {
     Lock.EnterWriteLock();
     try
     {
         Inner.Add(item);
     }
     finally
     {
         Lock.ExitWriteLock();
     }
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Adds an item to the <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </summary>
 /// <param name="item">The object to add to the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param><exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.</exception>
 public virtual void Add(KeyValuePair <TKey, TValue> item)
 {
     EnsureLazyLoaderCalled();
     if (Inner.ContainsKey(item.Key))
     {
         throw new ArgumentException("An element with the same key already exists");
     }
     else
     {
         Inner.Add(item.Key, new Lazy <TValue>(() => item.Value));
     }
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Adds an item or updates it if an item with that key already exists in the collection.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="value">The value.</param>
 /// <param name="updator">The updator.</param>
 /// <remarks></remarks>
 public virtual void AddOrUpdate(TKey key, TValue value, Func <TKey, TValue, TValue> updator)
 {
     if (Inner.ContainsKey(key))
     {
         Inner[key] = updator(key, Inner[key]);
         OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, value));
     }
     else
     {
         Inner.Add(key, value);
         OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, value));
     }
 }
Ejemplo n.º 13
0
 /// <inheritdoc/>
 public override void Add(TRoot item)
 {
     try
     {
         Inner.Add(item);
     }
     catch (TException ex)
     {
         if (!Handler.Invoke(ex))
         {
             throw;
         }
     }
 }
Ejemplo n.º 14
0
 public T this[string name]
 {
     get { return(Inner.FirstOrDefault(i => string.Equals(i.Name, name, StringComparison.InvariantCultureIgnoreCase))); }
     set
     {
         var index = Inner.FindIndex(i => string.Equals(i.Name, name, StringComparison.InvariantCultureIgnoreCase));
         if (index >= 0)
         {
             Inner[index] = value;
         }
         else
         {
             Inner.Add(value);
         }
     }
 }
Ejemplo n.º 15
0
        public override void Add(ShellItem item)
        {
            /*
             * This is purely for the case where a user is only specifying Tabs at the highest level
             * <shell>
             * <tab></tab>
             * <tab></tab>
             * </shell>
             * */
            if (Routing.IsImplicit(item) &&
                item is TabBar
                )
            {
                int i = Count - 1;
                if (i >= 0 && this[i] is TabBar && Routing.IsImplicit(this[i]))
                {
                    (this[i] as ShellItem).Items.Add(item.Items[0]);
                    return;
                }
            }

            Inner.Add(item);
        }
Ejemplo n.º 16
0
 /// <summary>
 /// 把一个初始化好的产品插入到队列INNER中;
 /// </summary>
 /// <param name="p"></param>
 private void InserInner(ProductUnit p1)
 {
     AllThick += p1.thick;
     //如果内页总厚度超过规定厚度,需要重新计算封面的尺寸;
     if (AllThick > ConstantValue.Process.ThickLast)
     {
         ReSetCover(Convert.ToInt32(p1.thick));
     }
     if (IsHeban(Cover, p1))
     {
         Cover.PageNum += p1.Size.Num;
         Cover.ReCaculation();
     }
     else
     {
         if (Inner == null)
         {
             Inner = new List <ProductUnit>();
         }
         p1.GroupId  = Inner.Count + 1;
         p1.UnitName = "画册内页" + Inner.Count.ToString();
         Inner.Add(p1);
     }
 }
Ejemplo n.º 17
0
        public void Add(string id, string secret)
        {
            Guard.NotNullOrEmpty(id, nameof(id));

            Inner.Add(id, new AppClient(id, secret, AppClientPermission.Editor));
        }
Ejemplo n.º 18
0
 public void Add(T item)
 {
     Inner.Add(item);
 }
Ejemplo n.º 19
0
 /// <inheritdoc/>
 public override void Add(TRoot item)
 {
     Inner.Add(item);
     Tap.AddOrUpdate(item);
 }
Ejemplo n.º 20
0
 public int AddIt() => _c.Add(_a, _b);
Ejemplo n.º 21
0
 public virtual void Add(T item)
 {
     Inner.Add(item);
 }
Ejemplo n.º 22
0
        public AppPatterns Add(Guid id, string name, string pattern, string message)
        {
            var newPattern = new AppPattern(name, pattern, message);

            return(new AppPatterns(Inner.Add(id, newPattern)));
        }
Ejemplo n.º 23
0
 public void Add(KeyValuePair <string, StringValues> item)
 {
     Inner.Add(Convert(item));
 }
Ejemplo n.º 24
0
 public void Add(string key, StringValues value)
 {
     Inner.Add(key, Convert(value));
 }
Ejemplo n.º 25
0
 public void Add(T item)
 {
     inner = inner ?? new List <T>();
     Inner.Add(item);
 }
Ejemplo n.º 26
0
        public Roles Add(string name)
        {
            var newRole = new Role(name);

            return(new Roles(Inner.Add(name, newRole)));
        }
Ejemplo n.º 27
0
 public override int Add(object val)
 {
     m_owner.SetDirty();
     Tailor(val);
     return(Inner.Add(val));
 }
 /// <inheritdoc/>
 public Task AddAsync(TRoot item) => Task.Run(() => Inner.Add(item));
Ejemplo n.º 29
0
        /// <summary>Adds an element with the provided key and value to the list.</summary>
        /// <param name="key">The object to use as the key of the element to add.</param>
        /// <param name="value">The object to use as the value of the element to add.</param>
        public void Add(string key, T value)
        {
            EnsureName(key, value);

            Inner.Add(value);
        }
Ejemplo n.º 30
0
        public AppClients Add(string id, string secret)
        {
            Guard.NotNullOrEmpty(id, nameof(id));

            return(new AppClients(Inner.Add(id, new AppClient(id, secret, Role.Editor))));
        }