/// <summary> setups the sync logic for member _customerDemographic</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncCustomerDemographic(IEntityCore relatedEntity) { if (_customerDemographic != relatedEntity) { DesetupSyncCustomerDemographic(true, true); _customerDemographic = (CustomerDemographicEntity)relatedEntity; this.PerformSetupSyncRelatedEntity(_customerDemographic, new PropertyChangedEventHandler(OnCustomerDemographicPropertyChanged), "CustomerDemographic", Northwind.DAL.RelationClasses.StaticCustomerCustomerDemoRelations.CustomerDemographicEntityUsingCustomerTypeIdStatic, true, new string[] { }); } }
protected CustomerCustomerDemoEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _customer = (CustomerEntity)info.GetValue("_customer", typeof(CustomerEntity)); if (_customer != null) { _customer.AfterSave += new EventHandler(OnEntityAfterSave); } _customerDemographic = (CustomerDemographicEntity)info.GetValue("_customerDemographic", typeof(CustomerDemographicEntity)); if (_customerDemographic != null) { _customerDemographic.AfterSave += new EventHandler(OnEntityAfterSave); } this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary>Private CTor for deserialization</summary> /// <param name="info"></param> /// <param name="context"></param> protected CustomerCustomerDemoEntity(SerializationInfo info, StreamingContext context) : base(info, context) { _customer = (CustomerEntity)info.GetValue("_customer", typeof(CustomerEntity)); if (_customer != null) { _customer.AfterSave += new EventHandler(OnEntityAfterSave); } _customerReturnsNewIfNotFound = info.GetBoolean("_customerReturnsNewIfNotFound"); _alwaysFetchCustomer = info.GetBoolean("_alwaysFetchCustomer"); _alreadyFetchedCustomer = info.GetBoolean("_alreadyFetchedCustomer"); _customerDemographic = (CustomerDemographicEntity)info.GetValue("_customerDemographic", typeof(CustomerDemographicEntity)); if (_customerDemographic != null) { _customerDemographic.AfterSave += new EventHandler(OnEntityAfterSave); } _customerDemographicReturnsNewIfNotFound = info.GetBoolean("_customerDemographicReturnsNewIfNotFound"); _alwaysFetchCustomerDemographic = info.GetBoolean("_alwaysFetchCustomerDemographic"); _alreadyFetchedCustomerDemographic = info.GetBoolean("_alreadyFetchedCustomerDemographic"); this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance()); // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary> Removes the sync logic for member _customerDemographic</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 DesetupSyncCustomerDemographic(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity(_customerDemographic, new PropertyChangedEventHandler(OnCustomerDemographicPropertyChanged), "CustomerDemographic", Northwind.DAL.RelationClasses.StaticCustomerCustomerDemoRelations.CustomerDemographicEntityUsingCustomerTypeIdStatic, true, signalRelatedEntity, "CustomerCustomerDemos", resetFKFields, new int[] { (int)CustomerCustomerDemoFieldIndex.CustomerTypeId }); _customerDemographic = null; }