예제 #1
0
        /// <inheritdoc />
        public bool Remove <T>()
            where T : TBase
        {
            ITypeSetContracts.Remove(this);

            return(this.values.Remove(typeof(T)));
        }
예제 #2
0
        /// <inheritdoc />
        public bool Add <T>(T value)
            where T : TBase
        {
            ITypeSetContracts.Add(this, value);

            return(this.Add(typeof(T), value));
        }
예제 #3
0
        /// <inheritdoc />
        public bool Add(Type key, TBase value)
        {
            ITypeSetContracts.Add(this, key, value);

            if (this.values.ContainsKey(key))
            {
                return(false);
            }
            else
            {
                this.values[key] = value;
                return(true);
            }
        }
예제 #4
0
        /// <inheritdoc />
        public TBase this[Type key]
        {
            get
            {
                ITypeSetContracts.IndexerGet(this, key);

                return(this.values[key]);
            }

            set
            {
                ITypeSetContracts.IndexerSet(this, key, value);

                this.values[key] = value;
            }
        }
예제 #5
0
        /// <inheritdoc />
        public bool Add(TBase value)
        {
            ITypeSetContracts.Add(this, value);

            return(this.Add(value.GetType(), value));
        }
예제 #6
0
        /// <inheritdoc />
        public bool Add(KeyValuePair <Type, TBase> item)
        {
            ITypeSetContracts.Add(this, item);

            return(this.Add(item.Key, item.Value));
        }