Exemplo n.º 1
0
        /// <summary>
        /// Makes a deep copy of the current DojoTestList.
        /// </summary>
        /// <returns> A new DojoTestList object reflecting the cloned DojoTestList object.</returns>
        /// <param name="isolation">Placeholders are used to isolate the DojoTestList from its children.</param>
        public DojoTestList Copy(bool isolation)
        {
            DojoTestList dojoTestList = new DojoTestList();

            CopyTo(dojoTestList, isolation);
            return(dojoTestList);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Makes a deep copy of the current DojoTestList.
        /// </summary>
        /// <returns> A new DojoTestList object reflecting the cloned DojoTestList object.</returns>
        public DojoTestList Copy()
        {
            DojoTestList dojoTestList = new DojoTestList();

            CopyTo(dojoTestList);
            return(dojoTestList);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Clones DojoTestList object and clones child objects with cloning or replication.
        /// as the parent object.
        /// </summary>
        /// <returns> A new DojoTestList object reflecting the replicated DojoTestList object.</returns>
        public DojoTestList Clone()
        {
            DojoTestList clonedDojoTestList = new DojoTestList();

            clonedDojoTestList.iD                    = iD;
            clonedDojoTestList.isSynced              = isSynced;
            clonedDojoTestList.createDate            = createDate;
            clonedDojoTestList.modifyDate            = modifyDate;
            clonedDojoTestList.editorComments        = editorComments;
            clonedDojoTestList.field1                = field1;
            clonedDojoTestList.candidatesCompileDate = candidatesCompileDate;


            if (test != null)
            {
                clonedDojoTestList.test = test;
            }

            if (status != null)
            {
                clonedDojoTestList.status = status;
            }

            if (editor != null)
            {
                clonedDojoTestList.editor = editor;
            }

            if (candidates != null)
            {
                clonedDojoTestList.candidates = candidates.Clone();
            }

            return(clonedDojoTestList);
        }
Exemplo n.º 4
0
        public static DojoTestList NewPlaceHolder(int iD)
        {
            DojoTestList dojoTestList = new DojoTestList();

            dojoTestList.iD            = iD;
            dojoTestList.isPlaceHolder = true;
            dojoTestList.isSynced      = true;
            return(dojoTestList);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Duplicates DojoTestList object into a database; may or may not be the same database
        /// as the parent object.
        /// </summary>
        /// <returns> A new DojoTestList object reflecting the replicated DojoTestList object.</returns>
        public DojoTestList Duplicate()
        {
            DojoTestList clonedDojoTestList = this.Clone();

            // Insert must be called after children are replicated!
            clonedDojoTestList.iD       = DojoTestListManager._insert(clonedDojoTestList);
            clonedDojoTestList.isSynced = true;
            return(clonedDojoTestList);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Deep copies the current DojoTestList to another instance of DojoTestList.
 /// </summary>
 /// <param name="DojoTestList">The DojoTestList to copy to.</param>
 /// <param name="isolation">Placeholders are used to isolate the DojoTestList from its children.</param>
 public void CopyTo(DojoTestList dojoTestList, bool isolation)
 {
     dojoTestList.iD            = iD;
     dojoTestList.isPlaceHolder = isPlaceHolder;
     dojoTestList.isSynced      = isSynced;
     dojoTestList.createDate    = createDate;
     dojoTestList.modifyDate    = modifyDate;
     if (test != null)
     {
         if (isolation)
         {
             dojoTestList.test = test.NewPlaceHolder();
         }
         else
         {
             dojoTestList.test = test.Copy(false);
         }
     }
     if (status != null)
     {
         if (isolation)
         {
             dojoTestList.status = status.NewPlaceHolder();
         }
         else
         {
             dojoTestList.status = status.Copy(false);
         }
     }
     if (editor != null)
     {
         if (isolation)
         {
             dojoTestList.editor = editor.NewPlaceHolder();
         }
         else
         {
             dojoTestList.editor = editor.Copy(false);
         }
     }
     dojoTestList.editorComments = editorComments;
     dojoTestList.field1         = field1;
     if (candidates != null)
     {
         if (isolation)
         {
             dojoTestList.candidates = candidates.Copy(true);
         }
         else
         {
             dojoTestList.candidates = candidates.Copy(false);
         }
     }
     dojoTestList.candidatesCompileDate = candidatesCompileDate;
 }
Exemplo n.º 7
0
        public void Remove(DojoTestList value)
        {
            OnCollectionChanged(EventArgs.Empty);
            int index = IndexOf(value);

            if (index == -1)
            {
                throw(new Exception("DojoTestList not found in collection."));
            }
            RemoveAt(index);
        }
Exemplo n.º 8
0
 public int IndexOf(DojoTestList value)
 {
     lock (this)
     {
         for (int x = 0; x < count; x++)
         {
             if (DojoTestListArray[x].Equals(value))
             {
                 return(x);
             }
         }
         return(-1);
     }
 }
Exemplo n.º 9
0
 public int Add(DojoTestList value)
 {
     OnCollectionChanged(EventArgs.Empty);
     lock (this)
     {
         count++;
         // Resize the array if the count is greater than the length
         // of the array.
         if (count > DojoTestListArray.GetUpperBound(0) + 1)
         {
             DojoTestList[] tempDojoTestListArray = new DojoTestList[count * 2];
             Array.Copy(DojoTestListArray, tempDojoTestListArray, count - 1);
             DojoTestListArray = tempDojoTestListArray;
         }
         DojoTestListArray[count - 1] = value;
     }
     return(count - 1);
 }
Exemplo n.º 10
0
 public void Insert(int index, DojoTestList value)
 {
     OnCollectionChanged(EventArgs.Empty);
     lock (this)
     {
         count++;
         // Resize the array if the count is greater than the length
         // of the array.
         if (count > DojoTestListArray.GetUpperBound(0) + 1)
         {
             DojoTestList[] tempDojoTestListArray = new DojoTestList[count * 2];
             Array.Copy(DojoTestListArray, tempDojoTestListArray, count - 1);
             DojoTestListArray = tempDojoTestListArray;
         }
         for (int x = index + 1; x == count - 2; x++)
         {
             DojoTestListArray[x] = DojoTestListArray[x - 1];
         }
         DojoTestListArray[index] = value;
     }
 }
Exemplo n.º 11
0
 public bool Contains(DojoTestList value)
 {
     return(IndexOf(value) != -1);
 }
Exemplo n.º 12
0
 /// <summary>
 /// Compares the object's ID to another object's ID.
 /// </summary>
 public int CompareTo(DojoTestList dojoTestList)
 {
     return(this.iD - dojoTestList.iD);
 }
Exemplo n.º 13
0
        /// <summary>
        /// Compares the object's ID to another object's ID.
        /// </summary>
        int IComparable.CompareTo(object obj)
        {
            DojoTestList dojoTestList = (DojoTestList)obj;

            return(this.iD - dojoTestList.iD);
        }
Exemplo n.º 14
0
 /// <summary>
 /// Deep copies the current DojoTestList to another instance of DojoTestList.
 /// This method does not provide isolated copies; use overriden method for this feature.
 /// </summary>
 /// <param name="DojoTestList">The DojoTestList to copy to.</param>
 public void CopyTo(DojoTestList dojoTestList)
 {
     CopyTo(dojoTestList, false);
 }