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

            CopyTo(dojoTest, isolation);
            return(dojoTest);
        }
Exemple #2
0
        /// <summary>
        /// Makes a deep copy of the current DojoTest.
        /// </summary>
        /// <returns> A new DojoTest object reflecting the cloned DojoTest object.</returns>
        public DojoTest Copy()
        {
            DojoTest dojoTest = new DojoTest();

            CopyTo(dojoTest);
            return(dojoTest);
        }
Exemple #3
0
        /// <summary>
        /// Clones DojoTest object and clones child objects with cloning or replication.
        /// as the parent object.
        /// </summary>
        /// <returns> A new DojoTest object reflecting the replicated DojoTest object.</returns>
        public DojoTest Clone()
        {
            DojoTest clonedDojoTest = new DojoTest();

            clonedDojoTest.iD          = iD;
            clonedDojoTest.isSynced    = isSynced;
            clonedDojoTest.name        = name;
            clonedDojoTest.description = description;
            clonedDojoTest.testDate    = testDate;


            if (location != null)
            {
                clonedDojoTest.location = location;
            }

            if (listMemberType1 != null)
            {
                clonedDojoTest.listMemberType1 = listMemberType1;
            }

            if (listMemberType2 != null)
            {
                clonedDojoTest.listMemberType2 = listMemberType2;
            }

            if (listMemberType3 != null)
            {
                clonedDojoTest.listMemberType3 = listMemberType3;
            }

            if (panelChief != null)
            {
                clonedDojoTest.panelChief = panelChief;
            }

            if (panelMembers != null)
            {
                clonedDojoTest.panelMembers = panelMembers.Clone();
            }

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

            if (activeTestList != null)
            {
                clonedDojoTest.activeTestList = activeTestList;
            }

            if (item != null)
            {
                clonedDojoTest.item = item;
            }

            return(clonedDojoTest);
        }
Exemple #4
0
        public static DojoTest NewPlaceHolder(int iD)
        {
            DojoTest dojoTest = new DojoTest();

            dojoTest.iD            = iD;
            dojoTest.isPlaceHolder = true;
            dojoTest.isSynced      = true;
            return(dojoTest);
        }
Exemple #5
0
        /// <summary>
        /// Duplicates DojoTest object into a database; may or may not be the same database
        /// as the parent object.
        /// </summary>
        /// <returns> A new DojoTest object reflecting the replicated DojoTest object.</returns>
        public DojoTest Duplicate()
        {
            DojoTest clonedDojoTest = this.Clone();

            // Insert must be called after children are replicated!
            clonedDojoTest.iD       = DojoTestManager._insert(clonedDojoTest);
            clonedDojoTest.isSynced = true;
            return(clonedDojoTest);
        }
Exemple #6
0
        public void Remove(DojoTest value)
        {
            OnCollectionChanged(EventArgs.Empty);
            int index = IndexOf(value);

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

            return(this.iD - dojoTest.iD);
        }
Exemple #13
0
 /// <summary>
 /// Deep copies the current DojoTest to another instance of DojoTest.
 /// </summary>
 /// <param name="DojoTest">The DojoTest to copy to.</param>
 /// <param name="isolation">Placeholders are used to isolate the DojoTest from its children.</param>
 public void CopyTo(DojoTest dojoTest, bool isolation)
 {
     dojoTest.iD            = iD;
     dojoTest.isPlaceHolder = isPlaceHolder;
     dojoTest.isSynced      = isSynced;
     dojoTest.name          = name;
     dojoTest.description   = description;
     dojoTest.testDate      = testDate;
     if (location != null)
     {
         if (isolation)
         {
             dojoTest.location = location.NewPlaceHolder();
         }
         else
         {
             dojoTest.location = location.Copy(false);
         }
     }
     if (listMemberType1 != null)
     {
         if (isolation)
         {
             dojoTest.listMemberType1 = listMemberType1.NewPlaceHolder();
         }
         else
         {
             dojoTest.listMemberType1 = listMemberType1.Copy(false);
         }
     }
     if (listMemberType2 != null)
     {
         if (isolation)
         {
             dojoTest.listMemberType2 = listMemberType2.NewPlaceHolder();
         }
         else
         {
             dojoTest.listMemberType2 = listMemberType2.Copy(false);
         }
     }
     if (listMemberType3 != null)
     {
         if (isolation)
         {
             dojoTest.listMemberType3 = listMemberType3.NewPlaceHolder();
         }
         else
         {
             dojoTest.listMemberType3 = listMemberType3.Copy(false);
         }
     }
     if (panelChief != null)
     {
         if (isolation)
         {
             dojoTest.panelChief = panelChief.NewPlaceHolder();
         }
         else
         {
             dojoTest.panelChief = panelChief.Copy(false);
         }
     }
     if (panelMembers != null)
     {
         if (isolation)
         {
             dojoTest.panelMembers = panelMembers.Copy(true);
         }
         else
         {
             dojoTest.panelMembers = panelMembers.Copy(false);
         }
     }
     if (status != null)
     {
         if (isolation)
         {
             dojoTest.status = status.NewPlaceHolder();
         }
         else
         {
             dojoTest.status = status.Copy(false);
         }
     }
     if (activeTestList != null)
     {
         if (isolation)
         {
             dojoTest.activeTestList = activeTestList.NewPlaceHolder();
         }
         else
         {
             dojoTest.activeTestList = activeTestList.Copy(false);
         }
     }
     if (item != null)
     {
         if (isolation)
         {
             dojoTest.item = item.NewPlaceHolder();
         }
         else
         {
             dojoTest.item = item.Copy(false);
         }
     }
 }
Exemple #14
0
 /// <summary>
 /// Deep copies the current DojoTest to another instance of DojoTest.
 /// This method does not provide isolated copies; use overriden method for this feature.
 /// </summary>
 /// <param name="DojoTest">The DojoTest to copy to.</param>
 public void CopyTo(DojoTest dojoTest)
 {
     CopyTo(dojoTest, false);
 }