Example #1
0
        /// <summary>
        /// Adds a new TypedOperation to the collection
        /// </summary>
        /// <param name="op"></param>
        public void Add(TypedOperation op)
        {
            if (null == op)
            {
                throw new ArgumentNullException("op");
            }

            if (this.Contains(op) == false)
            {
                _ops.Add(op.GetHashCode(), op);
            }
        }
Example #2
0
        /// <summary>
        ///  Returns true if this collection contains a TypedOperation that matches the parameter
        /// </summary>
        /// <param name="op"></param>
        /// <returns></returns>
        public bool Contains(TypedOperation op)
        {
            TypedOperation value;
            int            hash = op.GetHashCode();

            if (_ops.TryGetValue(hash, out value))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #3
0
        /// <summary>
        /// Returns true if this collection contains a TypedOperation that matches the parameters
        /// </summary>
        /// <param name="type"></param>
        /// <param name="operation"></param>
        /// <returns></returns>
        public bool Contains(DBSchemaTypes type, DBSchemaOperation operation)
        {
            TypedOperation value;
            int            hash = TypedOperation.GetHashCode(type, operation);

            if (_ops.TryGetValue(hash, out value))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #4
0
        /// <summary>
        /// Removes any TypedOperation from this collection that has a matching type and operation to the provided op.
        /// </summary>
        /// <param name="op"></param>
        public void Remove(TypedOperation op)
        {
            int hash = op.GetHashCode();

            this._ops.Remove(hash);
        }