コード例 #1
0
 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
 }
コード例 #2
0
 /// <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.DAL.RelationClasses.StaticProductRelations.SupplierEntityUsingSupplierIdStatic, true, signalRelatedEntity, "Products", resetFKFields, new int[] { (int)ProductFieldIndex.SupplierId });
     _supplier = null;
 }