Beispiel #1
0
        /// <summary>
        /// Makes a deep copy of the current DojoPromotion.
        /// </summary>
        /// <returns> A new DojoPromotion object reflecting the cloned DojoPromotion object.</returns>
        public DojoPromotion Copy()
        {
            DojoPromotion dojoPromotion = new DojoPromotion();

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

            CopyTo(dojoPromotion, isolation);
            return(dojoPromotion);
        }
Beispiel #3
0
        public static DojoPromotion NewPlaceHolder(int iD)
        {
            DojoPromotion dojoPromotion = new DojoPromotion();

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

            // Insert must be called after children are replicated!
            clonedDojoPromotion.iD       = DojoPromotionManager._insert(clonedDojoPromotion);
            clonedDojoPromotion.isSynced = true;
            return(clonedDojoPromotion);
        }
        public void Remove(DojoPromotion value)
        {
            OnCollectionChanged(EventArgs.Empty);
            int index = IndexOf(value);

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

            clonedDojoPromotion.iD            = iD;
            clonedDojoPromotion.isSynced      = isSynced;
            clonedDojoPromotion.promotionDate = promotionDate;


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

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

            if (promotionRank != null)
            {
                clonedDojoPromotion.promotionRank = promotionRank;
            }

            if (lastRank != null)
            {
                clonedDojoPromotion.lastRank = lastRank;
            }

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

            return(clonedDojoPromotion);
        }
Beispiel #10
0
 /// <summary>
 /// Compares the object's ID to another object's ID.
 /// </summary>
 public int CompareTo(DojoPromotion dojoPromotion)
 {
     return(this.iD - dojoPromotion.iD);
 }
Beispiel #11
0
        /// <summary>
        /// Compares the object's ID to another object's ID.
        /// </summary>
        int IComparable.CompareTo(object obj)
        {
            DojoPromotion dojoPromotion = (DojoPromotion)obj;

            return(this.iD - dojoPromotion.iD);
        }
Beispiel #12
0
 /// <summary>
 /// Deep copies the current DojoPromotion to another instance of DojoPromotion.
 /// </summary>
 /// <param name="DojoPromotion">The DojoPromotion to copy to.</param>
 /// <param name="isolation">Placeholders are used to isolate the DojoPromotion from its children.</param>
 public void CopyTo(DojoPromotion dojoPromotion, bool isolation)
 {
     dojoPromotion.iD            = iD;
     dojoPromotion.isPlaceHolder = isPlaceHolder;
     dojoPromotion.isSynced      = isSynced;
     if (member != null)
     {
         if (isolation)
         {
             dojoPromotion.member = member.NewPlaceHolder();
         }
         else
         {
             dojoPromotion.member = member.Copy(false);
         }
     }
     if (test != null)
     {
         if (isolation)
         {
             dojoPromotion.test = test.NewPlaceHolder();
         }
         else
         {
             dojoPromotion.test = test.Copy(false);
         }
     }
     dojoPromotion.promotionDate = promotionDate;
     if (promotionRank != null)
     {
         if (isolation)
         {
             dojoPromotion.promotionRank = promotionRank.NewPlaceHolder();
         }
         else
         {
             dojoPromotion.promotionRank = promotionRank.Copy(false);
         }
     }
     if (lastRank != null)
     {
         if (isolation)
         {
             dojoPromotion.lastRank = lastRank.NewPlaceHolder();
         }
         else
         {
             dojoPromotion.lastRank = lastRank.Copy(false);
         }
     }
     if (status != null)
     {
         if (isolation)
         {
             dojoPromotion.status = status.NewPlaceHolder();
         }
         else
         {
             dojoPromotion.status = status.Copy(false);
         }
     }
 }
Beispiel #13
0
 /// <summary>
 /// Deep copies the current DojoPromotion to another instance of DojoPromotion.
 /// This method does not provide isolated copies; use overriden method for this feature.
 /// </summary>
 /// <param name="DojoPromotion">The DojoPromotion to copy to.</param>
 public void CopyTo(DojoPromotion dojoPromotion)
 {
     CopyTo(dojoPromotion, false);
 }
 public bool Contains(DojoPromotion value)
 {
     return(IndexOf(value) != -1);
 }