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

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

            CopyTo(dojoTestListJournalEntry);
            return(dojoTestListJournalEntry);
        }
Beispiel #3
0
        public static DojoTestListJournalEntry NewPlaceHolder(int iD)
        {
            DojoTestListJournalEntry dojoTestListJournalEntry = new DojoTestListJournalEntry();

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

            // Insert must be called after children are replicated!
            clonedDojoTestListJournalEntry.iD       = DojoTestListJournalEntryManager._insert(clonedDojoTestListJournalEntry);
            clonedDojoTestListJournalEntry.isSynced = true;
            return(clonedDojoTestListJournalEntry);
        }
Beispiel #5
0
        public void Remove(DojoTestListJournalEntry value)
        {
            OnCollectionChanged(EventArgs.Empty);
            int index = IndexOf(value);

            if (index == -1)
            {
                throw(new Exception("DojoTestListJournalEntry not found in collection."));
            }
            RemoveAt(index);
        }
Beispiel #6
0
 public int IndexOf(DojoTestListJournalEntry value)
 {
     lock (this)
     {
         for (int x = 0; x < count; x++)
         {
             if (DojoTestListJournalEntryArray[x].Equals(value))
             {
                 return(x);
             }
         }
         return(-1);
     }
 }
Beispiel #7
0
 public int Add(DojoTestListJournalEntry value)
 {
     OnCollectionChanged(EventArgs.Empty);
     lock (this)
     {
         count++;
         // Resize the array if the count is greater than the length
         // of the array.
         if (count > DojoTestListJournalEntryArray.GetUpperBound(0) + 1)
         {
             DojoTestListJournalEntry[] tempDojoTestListJournalEntryArray = new DojoTestListJournalEntry[count * 2];
             Array.Copy(DojoTestListJournalEntryArray, tempDojoTestListJournalEntryArray, count - 1);
             DojoTestListJournalEntryArray = tempDojoTestListJournalEntryArray;
         }
         DojoTestListJournalEntryArray[count - 1] = value;
     }
     return(count - 1);
 }
Beispiel #8
0
 public void Insert(int index, DojoTestListJournalEntry value)
 {
     OnCollectionChanged(EventArgs.Empty);
     lock (this)
     {
         count++;
         // Resize the array if the count is greater than the length
         // of the array.
         if (count > DojoTestListJournalEntryArray.GetUpperBound(0) + 1)
         {
             DojoTestListJournalEntry[] tempDojoTestListJournalEntryArray = new DojoTestListJournalEntry[count * 2];
             Array.Copy(DojoTestListJournalEntryArray, tempDojoTestListJournalEntryArray, count - 1);
             DojoTestListJournalEntryArray = tempDojoTestListJournalEntryArray;
         }
         for (int x = index + 1; x == count - 2; x++)
         {
             DojoTestListJournalEntryArray[x] = DojoTestListJournalEntryArray[x - 1];
         }
         DojoTestListJournalEntryArray[index] = value;
     }
 }
Beispiel #9
0
        /// <summary>
        /// Clones DojoTestListJournalEntry object and clones child objects with cloning or replication.
        /// as the parent object.
        /// </summary>
        /// <returns> A new DojoTestListJournalEntry object reflecting the replicated DojoTestListJournalEntry object.</returns>
        public DojoTestListJournalEntry Clone()
        {
            DojoTestListJournalEntry clonedDojoTestListJournalEntry = new DojoTestListJournalEntry();

            clonedDojoTestListJournalEntry.iD         = iD;
            clonedDojoTestListJournalEntry.isSynced   = isSynced;
            clonedDojoTestListJournalEntry.createDate = createDate;
            clonedDojoTestListJournalEntry.comment    = comment;


            if (testList != null)
            {
                clonedDojoTestListJournalEntry.testList = testList;
            }

            if (member != null)
            {
                clonedDojoTestListJournalEntry.member = member;
            }

            if (entryType != null)
            {
                clonedDojoTestListJournalEntry.entryType = entryType;
            }

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

            if (promotion != null)
            {
                clonedDojoTestListJournalEntry.promotion = promotion;
            }

            return(clonedDojoTestListJournalEntry);
        }
Beispiel #10
0
 public bool Contains(DojoTestListJournalEntry value)
 {
     return(IndexOf(value) != -1);
 }
Beispiel #11
0
 /// <summary>
 /// Compares the object's ID to another object's ID.
 /// </summary>
 public int CompareTo(DojoTestListJournalEntry dojoTestListJournalEntry)
 {
     return(this.iD - dojoTestListJournalEntry.iD);
 }
Beispiel #12
0
        /// <summary>
        /// Compares the object's ID to another object's ID.
        /// </summary>
        int IComparable.CompareTo(object obj)
        {
            DojoTestListJournalEntry dojoTestListJournalEntry = (DojoTestListJournalEntry)obj;

            return(this.iD - dojoTestListJournalEntry.iD);
        }
Beispiel #13
0
 /// <summary>
 /// Deep copies the current DojoTestListJournalEntry to another instance of DojoTestListJournalEntry.
 /// </summary>
 /// <param name="DojoTestListJournalEntry">The DojoTestListJournalEntry to copy to.</param>
 /// <param name="isolation">Placeholders are used to isolate the DojoTestListJournalEntry from its children.</param>
 public void CopyTo(DojoTestListJournalEntry dojoTestListJournalEntry, bool isolation)
 {
     dojoTestListJournalEntry.iD            = iD;
     dojoTestListJournalEntry.isPlaceHolder = isPlaceHolder;
     dojoTestListJournalEntry.isSynced      = isSynced;
     if (testList != null)
     {
         if (isolation)
         {
             dojoTestListJournalEntry.testList = testList.NewPlaceHolder();
         }
         else
         {
             dojoTestListJournalEntry.testList = testList.Copy(false);
         }
     }
     if (member != null)
     {
         if (isolation)
         {
             dojoTestListJournalEntry.member = member.NewPlaceHolder();
         }
         else
         {
             dojoTestListJournalEntry.member = member.Copy(false);
         }
     }
     if (entryType != null)
     {
         if (isolation)
         {
             dojoTestListJournalEntry.entryType = entryType.NewPlaceHolder();
         }
         else
         {
             dojoTestListJournalEntry.entryType = entryType.Copy(false);
         }
     }
     dojoTestListJournalEntry.createDate = createDate;
     if (editor != null)
     {
         if (isolation)
         {
             dojoTestListJournalEntry.editor = editor.NewPlaceHolder();
         }
         else
         {
             dojoTestListJournalEntry.editor = editor.Copy(false);
         }
     }
     dojoTestListJournalEntry.comment = comment;
     if (promotion != null)
     {
         if (isolation)
         {
             dojoTestListJournalEntry.promotion = promotion.NewPlaceHolder();
         }
         else
         {
             dojoTestListJournalEntry.promotion = promotion.Copy(false);
         }
     }
 }
Beispiel #14
0
 /// <summary>
 /// Deep copies the current DojoTestListJournalEntry to another instance of DojoTestListJournalEntry.
 /// This method does not provide isolated copies; use overriden method for this feature.
 /// </summary>
 /// <param name="DojoTestListJournalEntry">The DojoTestListJournalEntry to copy to.</param>
 public void CopyTo(DojoTestListJournalEntry dojoTestListJournalEntry)
 {
     CopyTo(dojoTestListJournalEntry, false);
 }