Example #1
0
        public bool Contains(ADACodeItem element)
        {
            foreach (ADACode element in this)
            {
                if (element == element)
                {
                    return(true);
                }
            }

            return(false);
        }
Example #2
0
        public ADACodeItem AddObject(ADACodeItem newObject, int index)
        {
            //The object must be set and it must NOT have a parent
            if (newObject == null)
            {
                return(null);
            }

            if (newObject.Parent != null)
            {
                throw new Exception(ErrorStringObjectHasParent);
            }


            if ((index < -1) || (index > Me.Count))
            {
                //Subscript out of range
                throw new System.ArgumentOutOfRangeException();
            }

            if (newObject.Key == "")
            {
                newObject.Key = System.Guid.NewGuid().ToString;
            }

            try
            {
                if (index = -1)
                {
                    MyBase.List.Add(newObject);
                }
                else
                {
                    MyBase.List.Insert(index, newObject);
                }
            }
            catch (Exception ex)
            {
                Globals.SetErr(ex);
            }

            newObject.SetParent(this);

            return(newObject);
        }
Example #3
0
 public ADACodeItem AddObject(ADACodeItem newObject)
 {
     return(AddObject(newObject, -1));
 }