/// <summary> setups the sync logic for member _userTitle</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncUserTitle(IEntityCore relatedEntity) { if(_userTitle!=relatedEntity) { DesetupSyncUserTitle(true, true); _userTitle = (UserTitleEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _userTitle, new PropertyChangedEventHandler( OnUserTitlePropertyChanged ), "UserTitle", SD.HnD.DAL.RelationClasses.StaticUserRelations.UserTitleEntityUsingUserTitleIDStatic, true, ref _alreadyFetchedUserTitle, new string[] { } ); } }
/// <summary> Removes the sync logic for member _userTitle</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncUserTitle(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity( _userTitle, new PropertyChangedEventHandler( OnUserTitlePropertyChanged ), "UserTitle", SD.HnD.DAL.RelationClasses.StaticUserRelations.UserTitleEntityUsingUserTitleIDStatic, true, signalRelatedEntity, "Users", resetFKFields, new int[] { (int)UserFieldIndex.UserTitleID } ); _userTitle = null; }
/// <summary>Private CTor for deserialization</summary> /// <param name="info"></param> /// <param name="context"></param> protected UserEntityBase(SerializationInfo info, StreamingContext context) : base(info, context) { _loggedAudits = (SD.HnD.DAL.CollectionClasses.AuditDataCoreCollection)info.GetValue("_loggedAudits", typeof(SD.HnD.DAL.CollectionClasses.AuditDataCoreCollection)); _alwaysFetchLoggedAudits = info.GetBoolean("_alwaysFetchLoggedAudits"); _alreadyFetchedLoggedAudits = info.GetBoolean("_alreadyFetchedLoggedAudits"); _bookmarks = (SD.HnD.DAL.CollectionClasses.BookmarkCollection)info.GetValue("_bookmarks", typeof(SD.HnD.DAL.CollectionClasses.BookmarkCollection)); _alwaysFetchBookmarks = info.GetBoolean("_alwaysFetchBookmarks"); _alreadyFetchedBookmarks = info.GetBoolean("_alreadyFetchedBookmarks"); _iPBansSet = (SD.HnD.DAL.CollectionClasses.IPBanCollection)info.GetValue("_iPBansSet", typeof(SD.HnD.DAL.CollectionClasses.IPBanCollection)); _alwaysFetchIPBansSet = info.GetBoolean("_alwaysFetchIPBansSet"); _alreadyFetchedIPBansSet = info.GetBoolean("_alreadyFetchedIPBansSet"); _postedMessages = (SD.HnD.DAL.CollectionClasses.MessageCollection)info.GetValue("_postedMessages", typeof(SD.HnD.DAL.CollectionClasses.MessageCollection)); _alwaysFetchPostedMessages = info.GetBoolean("_alwaysFetchPostedMessages"); _alreadyFetchedPostedMessages = info.GetBoolean("_alreadyFetchedPostedMessages"); _roleUser = (SD.HnD.DAL.CollectionClasses.RoleUserCollection)info.GetValue("_roleUser", typeof(SD.HnD.DAL.CollectionClasses.RoleUserCollection)); _alwaysFetchRoleUser = info.GetBoolean("_alwaysFetchRoleUser"); _alreadyFetchedRoleUser = info.GetBoolean("_alreadyFetchedRoleUser"); _supportQueueThreadsClaimed = (SD.HnD.DAL.CollectionClasses.SupportQueueThreadCollection)info.GetValue("_supportQueueThreadsClaimed", typeof(SD.HnD.DAL.CollectionClasses.SupportQueueThreadCollection)); _alwaysFetchSupportQueueThreadsClaimed = info.GetBoolean("_alwaysFetchSupportQueueThreadsClaimed"); _alreadyFetchedSupportQueueThreadsClaimed = info.GetBoolean("_alreadyFetchedSupportQueueThreadsClaimed"); _supportQueueThreadsPlaced = (SD.HnD.DAL.CollectionClasses.SupportQueueThreadCollection)info.GetValue("_supportQueueThreadsPlaced", typeof(SD.HnD.DAL.CollectionClasses.SupportQueueThreadCollection)); _alwaysFetchSupportQueueThreadsPlaced = info.GetBoolean("_alwaysFetchSupportQueueThreadsPlaced"); _alreadyFetchedSupportQueueThreadsPlaced = info.GetBoolean("_alreadyFetchedSupportQueueThreadsPlaced"); _startedThreads = (SD.HnD.DAL.CollectionClasses.ThreadCollection)info.GetValue("_startedThreads", typeof(SD.HnD.DAL.CollectionClasses.ThreadCollection)); _alwaysFetchStartedThreads = info.GetBoolean("_alwaysFetchStartedThreads"); _alreadyFetchedStartedThreads = info.GetBoolean("_alreadyFetchedStartedThreads"); _threadSubscription = (SD.HnD.DAL.CollectionClasses.ThreadSubscriptionCollection)info.GetValue("_threadSubscription", typeof(SD.HnD.DAL.CollectionClasses.ThreadSubscriptionCollection)); _alwaysFetchThreadSubscription = info.GetBoolean("_alwaysFetchThreadSubscription"); _alreadyFetchedThreadSubscription = info.GetBoolean("_alreadyFetchedThreadSubscription"); _startedThreadsInForums = (SD.HnD.DAL.CollectionClasses.ForumCollection)info.GetValue("_startedThreadsInForums", typeof(SD.HnD.DAL.CollectionClasses.ForumCollection)); _alwaysFetchStartedThreadsInForums = info.GetBoolean("_alwaysFetchStartedThreadsInForums"); _alreadyFetchedStartedThreadsInForums = info.GetBoolean("_alreadyFetchedStartedThreadsInForums"); _roles = (SD.HnD.DAL.CollectionClasses.RoleCollection)info.GetValue("_roles", typeof(SD.HnD.DAL.CollectionClasses.RoleCollection)); _alwaysFetchRoles = info.GetBoolean("_alwaysFetchRoles"); _alreadyFetchedRoles = info.GetBoolean("_alreadyFetchedRoles"); _threadsInBookmarks = (SD.HnD.DAL.CollectionClasses.ThreadCollection)info.GetValue("_threadsInBookmarks", typeof(SD.HnD.DAL.CollectionClasses.ThreadCollection)); _alwaysFetchThreadsInBookmarks = info.GetBoolean("_alwaysFetchThreadsInBookmarks"); _alreadyFetchedThreadsInBookmarks = info.GetBoolean("_alreadyFetchedThreadsInBookmarks"); _postedMessagesInThreads = (SD.HnD.DAL.CollectionClasses.ThreadCollection)info.GetValue("_postedMessagesInThreads", typeof(SD.HnD.DAL.CollectionClasses.ThreadCollection)); _alwaysFetchPostedMessagesInThreads = info.GetBoolean("_alwaysFetchPostedMessagesInThreads"); _alreadyFetchedPostedMessagesInThreads = info.GetBoolean("_alreadyFetchedPostedMessagesInThreads"); _threadCollectionViaThreadSubscription = (SD.HnD.DAL.CollectionClasses.ThreadCollection)info.GetValue("_threadCollectionViaThreadSubscription", typeof(SD.HnD.DAL.CollectionClasses.ThreadCollection)); _alwaysFetchThreadCollectionViaThreadSubscription = info.GetBoolean("_alwaysFetchThreadCollectionViaThreadSubscription"); _alreadyFetchedThreadCollectionViaThreadSubscription = info.GetBoolean("_alreadyFetchedThreadCollectionViaThreadSubscription"); _userTitle = (UserTitleEntity)info.GetValue("_userTitle", typeof(UserTitleEntity)); if(_userTitle!=null) { _userTitle.AfterSave+=new EventHandler(OnEntityAfterSave); } _userTitleReturnsNewIfNotFound = info.GetBoolean("_userTitleReturnsNewIfNotFound"); _alwaysFetchUserTitle = info.GetBoolean("_alwaysFetchUserTitle"); _alreadyFetchedUserTitle = info.GetBoolean("_alreadyFetchedUserTitle"); this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance()); // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary> Retrieves the related entity of type 'UserTitleEntity', using a relation of type 'n:1'</summary> /// <param name="forceFetch">if true, it will discard any changes currently in the currently loaded related entity and will refetch the entity from the persistent storage</param> /// <returns>A fetched entity of type 'UserTitleEntity' which is related to this entity.</returns> public virtual UserTitleEntity GetSingleUserTitle(bool forceFetch) { if( ( !_alreadyFetchedUserTitle || forceFetch || _alwaysFetchUserTitle) && !this.IsSerializing && !this.IsDeserializing && !this.InDesignMode) { bool performLazyLoading = this.CheckIfLazyLoadingShouldOccur(Relations.UserTitleEntityUsingUserTitleID); UserTitleEntity newEntity = new UserTitleEntity(); bool fetchResult = false; if(performLazyLoading) { AddToTransactionIfNecessary(newEntity); fetchResult = newEntity.FetchUsingPK(this.UserTitleID); } if(fetchResult) { newEntity = (UserTitleEntity)GetFromActiveContext(newEntity); } else { if(!_userTitleReturnsNewIfNotFound) { RemoveFromTransactionIfNecessary(newEntity); newEntity = null; } } this.UserTitle = newEntity; _alreadyFetchedUserTitle = fetchResult; } return _userTitle; }
/// <summary>Creates a new, empty UserTitleEntity object.</summary> /// <returns>A new, empty UserTitleEntity object.</returns> public override IEntity Create() { IEntity toReturn = new UserTitleEntity(); // __LLBLGENPRO_USER_CODE_REGION_START CreateNewUserTitle // __LLBLGENPRO_USER_CODE_REGION_END return toReturn; }