protected CommunityEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _communityUsers = (EntityCollection <CommunityUserEntity>)info.GetValue("_communityUsers", typeof(EntityCollection <CommunityUserEntity>)); _communityCategory = (CommunityCategoryEntity)info.GetValue("_communityCategory", typeof(CommunityCategoryEntity)); if (_communityCategory != null) { _communityCategory.AfterSave += new EventHandler(OnEntityAfterSave); } _user = (UserEntity)info.GetValue("_user", typeof(UserEntity)); if (_user != null) { _user.AfterSave += new EventHandler(OnEntityAfterSave); } _user1 = (UserEntity)info.GetValue("_user1", typeof(UserEntity)); if (_user1 != null) { _user1.AfterSave += new EventHandler(OnEntityAfterSave); } _user2 = (UserEntity)info.GetValue("_user2", typeof(UserEntity)); if (_user2 != null) { _user2.AfterSave += new EventHandler(OnEntityAfterSave); } this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary> setups the sync logic for member _communityCategory</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncCommunityCategory(IEntityCore relatedEntity) { if (_communityCategory != relatedEntity) { DesetupSyncCommunityCategory(true, true); _communityCategory = (CommunityCategoryEntity)relatedEntity; this.PerformSetupSyncRelatedEntity(_communityCategory, new PropertyChangedEventHandler(OnCommunityCategoryPropertyChanged), "CommunityCategory", Let3arafo.Data.RelationClasses.StaticCommunityRelations.CommunityCategoryEntityUsingCategoryIdStatic, true, new string[] { }); } }
/// <summary> Removes the sync logic for member _communityCategory</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 DesetupSyncCommunityCategory(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity(_communityCategory, new PropertyChangedEventHandler(OnCommunityCategoryPropertyChanged), "CommunityCategory", Let3arafo.Data.RelationClasses.StaticCommunityRelations.CommunityCategoryEntityUsingCategoryIdStatic, true, signalRelatedEntity, "Communities", resetFKFields, new int[] { (int)CommunityFieldIndex.CategoryId }); _communityCategory = null; }