Example #1
0
        /// <summary>
        /// Determines whether the specified <see cref="T:System.Object"></see> is equal to the current <see cref="T:System.Object"></see>.
        /// </summary>
        /// <param name="obj">The <see cref="T:System.Object"></see> to compare with the current <see cref="T:System.Object"></see>.</param>
        /// <returns>
        /// true if the specified <see cref="T:System.Object"></see> is equal to the current <see cref="T:System.Object"></see>; otherwise, false.
        /// </returns>

        public override bool Equals(object obj)
        {
            if ((obj == null) || (obj.GetType() != GetType()))
            {
                return(false);
            }

            BaseMap <K, V> oMap = (BaseMap <K, V>)obj;

            return
                (Object.Equals(_nullEntry, oMap._nullEntry) &&
                 Collections.AreEqual(_subDictionary, oMap._subDictionary));
        }
Example #2
0
        /// <summary>
        /// Creates an Map from the IDictionary.
        /// </summary>
        /// <param name="sourceDictionary"></param>
        /// <returns></returns>

        public static IDictionary <K, V> AsEDictionary(IDictionary <K, V> sourceDictionary)
        {
            IDictionary <K, V> result = sourceDictionary as IDictionary <K, V>;

            if (result == null)
            {
                if (sourceDictionary != null)
                {
                    result = new BaseMap <K, V>(sourceDictionary);
                }
                else
                {
                    result = null;
                }
            }

            return(result);
        }