示例#1
0
 public static ClassCollectionItem getInstance()
 {
     if (instance == null)
     {
         instance = new ClassCollectionItem();
     }
     return(instance);
 }
示例#2
0
        public override bool Equals(object obj)
        {
            if (obj == null || !this.GetType().Equals(obj.GetType()))
            {
                return(false);
            }

            ClassCollectionItem s = (ClassCollectionItem)obj;

            return(s.Count == Count);
        }
示例#3
0
        public ClassCollectionItem Unite(ClassCollectionItem coll)
        {
            ClassCollectionItem united = new ClassCollectionItem();

            foreach (Item item in this)
            {
                united.Add(item);
            }
            foreach (Item item in coll)
            {
                if (!this.IsThere(item.NameOfItem))
                {
                    united.Add(item);
                }
            }
            return(united);
        }