Ejemplo n.º 1
0
 public virtual void RemoveSettings(ProfileSetting __item)
 {
     if (__item != null)
     {
         __item.ParentProfile = null;
     }
 }
Ejemplo n.º 2
0
 public virtual void InternalRemoveSettings(ProfileSetting __item)
 {
     if (__item == null)
     {
         return;
     }
     settings?.Remove(__item);
 }
Ejemplo n.º 3
0
 public virtual void InternalAddSettings(ProfileSetting __item)
 {
     if (__item == null || disableInternalAdditions)
     {
         return;
     }
     settings?.Add(__item);
 }
Ejemplo n.º 4
0
 public virtual void AddSettings(ProfileSetting __item)
 {
     if (__item == null)
     {
         return;
     }
     if (__item.ParentProfile != this)
     {
         __item.ParentProfile = this;
     }
 }
Ejemplo n.º 5
0
 public void DeleteProfileSetting(zAppDev.DotNet.Framework.Identity.Model.ProfileSetting profilesetting, bool doNotCallDeleteForThis = false, bool isCascaded = false, object calledBy = null)
 {
     if (profilesetting == null || profilesetting.IsTransient())
     {
         return;
     }
     profilesetting.ParentProfile = null;
     if (!doNotCallDeleteForThis)
     {
         Delete <zAppDev.DotNet.Framework.Identity.Model.ProfileSetting>(profilesetting, isCascaded);
     }
 }
Ejemplo n.º 6
0
 public virtual void SetSettingsAt(ProfileSetting __item, int __index)
 {
     if (__item == null)
     {
         settings[__index].ParentProfile = null;
     }
     else
     {
         settings[__index] = __item;
         if (__item.ParentProfile != this)
         {
             __item.ParentProfile = this;
         }
     }
 }
Ejemplo n.º 7
0
 public virtual void AddAtIndexSettings(int index, ProfileSetting __item)
 {
     if (__item == null)
     {
         return;
     }
     settings?.Insert(index, __item);
     disableInternalAdditions = true;
     try
     {
         if (__item.ParentProfile != this)
         {
             __item.ParentProfile = this;
         }
     }
     finally
     {
         disableInternalAdditions = false;
     }
 }
/// <summary>
///     Returns true if self and the provided entity have the same Id values
///     and the Ids are not of the default Id value
/// </summary>
        protected bool HasSameNonDefaultIdAs(ProfileSetting compareTo)
        {
            return(!this.IsTransient() && !compareTo.IsTransient() && this.Id.Equals(compareTo.Id));
        }
/// <summary>
/// Copies the current object to a new instance
/// </summary>
/// <param name="deep">Copy members that refer to objects external to this class (not dependent)</param>
/// <param name="copiedObjects">Objects that should be reused</param>
/// <param name="asNew">Copy the current object as a new one, ready to be persisted, along all its members.</param>
/// <param name="reuseNestedObjects">If asNew is true, this flag if set, forces the reuse of all external objects.</param>
/// <param name="copy">Optional - An existing [ProfileSetting] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual ProfileSetting Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, ProfileSetting copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((ProfileSetting)copiedObjects[this]);
            }
            copy = copy ?? new ProfileSetting();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.Id          = this.Id;
            }
            copy.Key   = this.Key;
            copy.Value = this.Value;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            if (deep && this.parentProfile != null)
            {
                if (!copiedObjects.Contains(this.parentProfile))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.ParentProfile = this.ParentProfile;
                    }
                    else if (asNew)
                    {
                        copy.ParentProfile = this.ParentProfile.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.parentProfile = this.parentProfile.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.ParentProfile = (Profile)copiedObjects[this.ParentProfile];
                    }
                    else
                    {
                        copy.parentProfile = (Profile)copiedObjects[this.ParentProfile];
                    }
                }
            }
            return(copy);
        }