protected ProductEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _orderDetails = (EntityCollection <OrderDetailEntity>)info.GetValue("_orderDetails", typeof(EntityCollection <OrderDetailEntity>)); _category = (CategoryEntity)info.GetValue("_category", typeof(CategoryEntity)); if (_category != null) { _category.AfterSave += new EventHandler(OnEntityAfterSave); } _supplier = (SupplierEntity)info.GetValue("_supplier", typeof(SupplierEntity)); if (_supplier != null) { _supplier.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 _supplier</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncSupplier(IEntityCore relatedEntity) { if(_supplier!=relatedEntity) { DesetupSyncSupplier(true, true); _supplier = (SupplierEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _supplier, new PropertyChangedEventHandler( OnSupplierPropertyChanged ), "Supplier", Northwind.Data.RelationClasses.StaticProductRelations.SupplierEntityUsingSupplierIdStatic, true, new string[] { } ); } }
/// <summary> Removes the sync logic for member _supplier</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 DesetupSyncSupplier(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity( _supplier, new PropertyChangedEventHandler( OnSupplierPropertyChanged ), "Supplier", Northwind.Data.RelationClasses.StaticProductRelations.SupplierEntityUsingSupplierIdStatic, true, signalRelatedEntity, "Products", resetFKFields, new int[] { (int)ProductFieldIndex.SupplierId } ); _supplier = null; }
protected ProductEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if(SerializationHelper.Optimization != SerializationOptimization.Fast) { _orderDetails = (EntityCollection<OrderDetailEntity>)info.GetValue("_orderDetails", typeof(EntityCollection<OrderDetailEntity>)); _category = (CategoryEntity)info.GetValue("_category", typeof(CategoryEntity)); if(_category!=null) { _category.AfterSave+=new EventHandler(OnEntityAfterSave); } _supplier = (SupplierEntity)info.GetValue("_supplier", typeof(SupplierEntity)); if(_supplier!=null) { _supplier.AfterSave+=new EventHandler(OnEntityAfterSave); } this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary> Removes the sync logic for member _supplier</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 DesetupSyncSupplier(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity(_supplier, new PropertyChangedEventHandler(OnSupplierPropertyChanged), "Supplier", Northwind.Data.RelationClasses.StaticProductRelations.SupplierEntityUsingSupplierIdStatic, true, signalRelatedEntity, "Products", resetFKFields, new int[] { (int)ProductFieldIndex.SupplierId }); _supplier = null; }