Пример #1
0
        /// <summary>
        /// Makes a deep copy of the current DojoMemberTypeTemplate.
        /// </summary>
        /// <returns> A new DojoMemberTypeTemplate object reflecting the cloned DojoMemberTypeTemplate object.</returns>
        public DojoMemberTypeTemplate Copy()
        {
            DojoMemberTypeTemplate dojoMemberTypeTemplate = new DojoMemberTypeTemplate();

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

            CopyTo(dojoMemberTypeTemplate, isolation);
            return(dojoMemberTypeTemplate);
        }
Пример #3
0
        /// <summary>
        /// Duplicates DojoMemberTypeTemplate object into a database; may or may not be the same database
        /// as the parent object.
        /// </summary>
        /// <returns> A new DojoMemberTypeTemplate object reflecting the replicated DojoMemberTypeTemplate object.</returns>
        public DojoMemberTypeTemplate Duplicate()
        {
            DojoMemberTypeTemplate clonedDojoMemberTypeTemplate = this.Clone();

            // Insert must be called after children are replicated!
            clonedDojoMemberTypeTemplate.iD       = DojoMemberTypeTemplateManager._insert(clonedDojoMemberTypeTemplate);
            clonedDojoMemberTypeTemplate.isSynced = true;
            return(clonedDojoMemberTypeTemplate);
        }
Пример #4
0
        public static DojoMemberTypeTemplate NewPlaceHolder(int iD)
        {
            DojoMemberTypeTemplate dojoMemberTypeTemplate = new DojoMemberTypeTemplate();

            dojoMemberTypeTemplate.iD            = iD;
            dojoMemberTypeTemplate.isPlaceHolder = true;
            dojoMemberTypeTemplate.isSynced      = true;
            return(dojoMemberTypeTemplate);
        }
Пример #5
0
        public void Remove(DojoMemberTypeTemplate value)
        {
            OnCollectionChanged(EventArgs.Empty);
            int index = IndexOf(value);

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

            clonedDojoMemberTypeTemplate.iD                 = iD;
            clonedDojoMemberTypeTemplate.isSynced           = isSynced;
            clonedDojoMemberTypeTemplate.createDate         = createDate;
            clonedDojoMemberTypeTemplate.modifyDate         = modifyDate;
            clonedDojoMemberTypeTemplate.name               = name;
            clonedDojoMemberTypeTemplate.description        = description;
            clonedDojoMemberTypeTemplate.orderNum           = orderNum;
            clonedDojoMemberTypeTemplate.memberTypeTreeHash = memberTypeTreeHash;
            clonedDojoMemberTypeTemplate.initialEmailFrom   = initialEmailFrom;
            clonedDojoMemberTypeTemplate.initialEmailBody   = initialEmailBody;
            clonedDojoMemberTypeTemplate.allowGuestPurchase = allowGuestPurchase;
            clonedDojoMemberTypeTemplate.allowPurchase      = allowPurchase;
            clonedDojoMemberTypeTemplate.allowRenewal       = allowRenewal;
            clonedDojoMemberTypeTemplate.allowAutoRenewal   = allowAutoRenewal;
            clonedDojoMemberTypeTemplate.ageYearsMax        = ageYearsMax;
            clonedDojoMemberTypeTemplate.ageYearsMin        = ageYearsMin;
            clonedDojoMemberTypeTemplate.memberForMin       = memberForMin;
            clonedDojoMemberTypeTemplate.memberForMax       = memberForMax;


            if (memberType != null)
            {
                clonedDojoMemberTypeTemplate.memberType = memberType;
            }

            if (parent != null)
            {
                clonedDojoMemberTypeTemplate.parent = parent;
            }

            if (root != null)
            {
                clonedDojoMemberTypeTemplate.root = root;
            }

            if (initialRank != null)
            {
                clonedDojoMemberTypeTemplate.initialRank = initialRank;
            }

            if (initialRole != null)
            {
                clonedDojoMemberTypeTemplate.initialRole = initialRole;
            }

            if (rankMin != null)
            {
                clonedDojoMemberTypeTemplate.rankMin = rankMin;
            }

            if (rankMax != null)
            {
                clonedDojoMemberTypeTemplate.rankMax = rankMax;
            }

            if (membershipTemplate1 != null)
            {
                clonedDojoMemberTypeTemplate.membershipTemplate1 = membershipTemplate1;
            }

            if (membershipTemplate2 != null)
            {
                clonedDojoMemberTypeTemplate.membershipTemplate2 = membershipTemplate2;
            }

            if (membershipTemplate3 != null)
            {
                clonedDojoMemberTypeTemplate.membershipTemplate3 = membershipTemplate3;
            }

            if (membershipTemplate4 != null)
            {
                clonedDojoMemberTypeTemplate.membershipTemplate4 = membershipTemplate4;
            }

            if (membershipTemplate5 != null)
            {
                clonedDojoMemberTypeTemplate.membershipTemplate5 = membershipTemplate5;
            }

            return(clonedDojoMemberTypeTemplate);
        }
Пример #10
0
 /// <summary>
 /// Compares the object's ID to another object's ID.
 /// </summary>
 public int CompareTo(DojoMemberTypeTemplate dojoMemberTypeTemplate)
 {
     return(this.iD - dojoMemberTypeTemplate.iD);
 }
Пример #11
0
        /// <summary>
        /// Compares the object's ID to another object's ID.
        /// </summary>
        int IComparable.CompareTo(object obj)
        {
            DojoMemberTypeTemplate dojoMemberTypeTemplate = (DojoMemberTypeTemplate)obj;

            return(this.iD - dojoMemberTypeTemplate.iD);
        }
Пример #12
0
 /// <summary>
 /// Deep copies the current DojoMemberTypeTemplate to another instance of DojoMemberTypeTemplate.
 /// </summary>
 /// <param name="DojoMemberTypeTemplate">The DojoMemberTypeTemplate to copy to.</param>
 /// <param name="isolation">Placeholders are used to isolate the DojoMemberTypeTemplate from its children.</param>
 public void CopyTo(DojoMemberTypeTemplate dojoMemberTypeTemplate, bool isolation)
 {
     dojoMemberTypeTemplate.iD            = iD;
     dojoMemberTypeTemplate.isPlaceHolder = isPlaceHolder;
     dojoMemberTypeTemplate.isSynced      = isSynced;
     dojoMemberTypeTemplate.createDate    = createDate;
     dojoMemberTypeTemplate.modifyDate    = modifyDate;
     dojoMemberTypeTemplate.name          = name;
     dojoMemberTypeTemplate.description   = description;
     dojoMemberTypeTemplate.orderNum      = orderNum;
     if (memberType != null)
     {
         if (isolation)
         {
             dojoMemberTypeTemplate.memberType = memberType.NewPlaceHolder();
         }
         else
         {
             dojoMemberTypeTemplate.memberType = memberType.Copy(false);
         }
     }
     dojoMemberTypeTemplate.memberTypeTreeHash = memberTypeTreeHash;
     if (parent != null)
     {
         if (isolation)
         {
             dojoMemberTypeTemplate.parent = parent.NewPlaceHolder();
         }
         else
         {
             dojoMemberTypeTemplate.parent = parent.Copy(false);
         }
     }
     if (root != null)
     {
         if (isolation)
         {
             dojoMemberTypeTemplate.root = root.NewPlaceHolder();
         }
         else
         {
             dojoMemberTypeTemplate.root = root.Copy(false);
         }
     }
     if (initialRank != null)
     {
         if (isolation)
         {
             dojoMemberTypeTemplate.initialRank = initialRank.NewPlaceHolder();
         }
         else
         {
             dojoMemberTypeTemplate.initialRank = initialRank.Copy(false);
         }
     }
     if (initialRole != null)
     {
         if (isolation)
         {
             dojoMemberTypeTemplate.initialRole = initialRole.NewPlaceHolder();
         }
         else
         {
             dojoMemberTypeTemplate.initialRole = initialRole.Copy(false);
         }
     }
     dojoMemberTypeTemplate.initialEmailFrom   = initialEmailFrom;
     dojoMemberTypeTemplate.initialEmailBody   = initialEmailBody;
     dojoMemberTypeTemplate.allowGuestPurchase = allowGuestPurchase;
     dojoMemberTypeTemplate.allowPurchase      = allowPurchase;
     dojoMemberTypeTemplate.allowRenewal       = allowRenewal;
     dojoMemberTypeTemplate.allowAutoRenewal   = allowAutoRenewal;
     dojoMemberTypeTemplate.ageYearsMax        = ageYearsMax;
     dojoMemberTypeTemplate.ageYearsMin        = ageYearsMin;
     dojoMemberTypeTemplate.memberForMin       = memberForMin;
     dojoMemberTypeTemplate.memberForMax       = memberForMax;
     if (rankMin != null)
     {
         if (isolation)
         {
             dojoMemberTypeTemplate.rankMin = rankMin.NewPlaceHolder();
         }
         else
         {
             dojoMemberTypeTemplate.rankMin = rankMin.Copy(false);
         }
     }
     if (rankMax != null)
     {
         if (isolation)
         {
             dojoMemberTypeTemplate.rankMax = rankMax.NewPlaceHolder();
         }
         else
         {
             dojoMemberTypeTemplate.rankMax = rankMax.Copy(false);
         }
     }
     if (membershipTemplate1 != null)
     {
         if (isolation)
         {
             dojoMemberTypeTemplate.membershipTemplate1 = membershipTemplate1.NewPlaceHolder();
         }
         else
         {
             dojoMemberTypeTemplate.membershipTemplate1 = membershipTemplate1.Copy(false);
         }
     }
     if (membershipTemplate2 != null)
     {
         if (isolation)
         {
             dojoMemberTypeTemplate.membershipTemplate2 = membershipTemplate2.NewPlaceHolder();
         }
         else
         {
             dojoMemberTypeTemplate.membershipTemplate2 = membershipTemplate2.Copy(false);
         }
     }
     if (membershipTemplate3 != null)
     {
         if (isolation)
         {
             dojoMemberTypeTemplate.membershipTemplate3 = membershipTemplate3.NewPlaceHolder();
         }
         else
         {
             dojoMemberTypeTemplate.membershipTemplate3 = membershipTemplate3.Copy(false);
         }
     }
     if (membershipTemplate4 != null)
     {
         if (isolation)
         {
             dojoMemberTypeTemplate.membershipTemplate4 = membershipTemplate4.NewPlaceHolder();
         }
         else
         {
             dojoMemberTypeTemplate.membershipTemplate4 = membershipTemplate4.Copy(false);
         }
     }
     if (membershipTemplate5 != null)
     {
         if (isolation)
         {
             dojoMemberTypeTemplate.membershipTemplate5 = membershipTemplate5.NewPlaceHolder();
         }
         else
         {
             dojoMemberTypeTemplate.membershipTemplate5 = membershipTemplate5.Copy(false);
         }
     }
 }
Пример #13
0
 /// <summary>
 /// Deep copies the current DojoMemberTypeTemplate to another instance of DojoMemberTypeTemplate.
 /// This method does not provide isolated copies; use overriden method for this feature.
 /// </summary>
 /// <param name="DojoMemberTypeTemplate">The DojoMemberTypeTemplate to copy to.</param>
 public void CopyTo(DojoMemberTypeTemplate dojoMemberTypeTemplate)
 {
     CopyTo(dojoMemberTypeTemplate, false);
 }
Пример #14
0
 public bool Contains(DojoMemberTypeTemplate value)
 {
     return(IndexOf(value) != -1);
 }