Пример #1
0
        public object Clone()
        {
            StiRepositoryItems repository = new StiRepositoryItems();

            if (items != null)
            {
                repository.items = items.Clone() as Hashtable;
            }
            return(repository);
        }
Пример #2
0
        public bool Equals(StiRepositoryItems obj)
        {
            if (obj == null)
            {
                return(false);
            }
            bool empty1 = items == null || items.Count == 0;
            bool empty2 = obj.items == null || obj.items.Count == 0;

            if (empty1 && empty2)
            {
                return(true);
            }
            if (empty1 && !empty2 || !empty1 && empty2)
            {
                return(false);
            }
            if (items.Count != obj.items.Count)
            {
                return(false);
            }
            foreach (DictionaryEntry de in items)
            {
                if (!obj.items.ContainsKey(de.Key))
                {
                    return(false);
                }
                object obj2 = obj.items[de.Key];
                if (de.Value == null)
                {
                    if (obj2 == null)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                if (!de.Value.Equals(obj2))
                {
                    return(false);
                }
                //if (de.Value != obj.items[de.Key]) return false;
            }
            return(true);
        }