/// <summary> setups the sync logic for member _countryRegion</summary>
 /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
 private void SetupSyncCountryRegion(IEntityCore relatedEntity)
 {
     if (_countryRegion != relatedEntity)
     {
         DesetupSyncCountryRegion(true, true);
         _countryRegion = (CountryRegionEntity)relatedEntity;
         this.PerformSetupSyncRelatedEntity(_countryRegion, new PropertyChangedEventHandler(OnCountryRegionPropertyChanged), "CountryRegion", AdventureWorks.Dal.Adapter.v51.RelationClasses.StaticSalesTerritoryRelations.CountryRegionEntityUsingCountryRegionCodeStatic, true, new string[] {  });
     }
 }
 protected SalesTerritoryEntity(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     if (SerializationHelper.Optimization != SerializationOptimization.Fast)
     {
         _customers               = (EntityCollection <CustomerEntity>)info.GetValue("_customers", typeof(EntityCollection <CustomerEntity>));
         _salesOrderHeaders       = (EntityCollection <SalesOrderHeaderEntity>)info.GetValue("_salesOrderHeaders", typeof(EntityCollection <SalesOrderHeaderEntity>));
         _salesPeople             = (EntityCollection <SalesPersonEntity>)info.GetValue("_salesPeople", typeof(EntityCollection <SalesPersonEntity>));
         _salesTerritoryHistories = (EntityCollection <SalesTerritoryHistoryEntity>)info.GetValue("_salesTerritoryHistories", typeof(EntityCollection <SalesTerritoryHistoryEntity>));
         _stateProvinces          = (EntityCollection <StateProvinceEntity>)info.GetValue("_stateProvinces", typeof(EntityCollection <StateProvinceEntity>));
         _countryRegion           = (CountryRegionEntity)info.GetValue("_countryRegion", typeof(CountryRegionEntity));
         if (_countryRegion != null)
         {
             _countryRegion.AfterSave += new EventHandler(OnEntityAfterSave);
         }
         this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
     }
     // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
     // __LLBLGENPRO_USER_CODE_REGION_END
 }
Exemple #3
0
 protected CountryRegionCurrencyEntity(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     if (SerializationHelper.Optimization != SerializationOptimization.Fast)
     {
         _countryRegion = (CountryRegionEntity)info.GetValue("_countryRegion", typeof(CountryRegionEntity));
         if (_countryRegion != null)
         {
             _countryRegion.AfterSave += new EventHandler(OnEntityAfterSave);
         }
         _currency = (CurrencyEntity)info.GetValue("_currency", typeof(CurrencyEntity));
         if (_currency != null)
         {
             _currency.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 _countryRegion</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 DesetupSyncCountryRegion(bool signalRelatedEntity, bool resetFKFields)
 {
     this.PerformDesetupSyncRelatedEntity(_countryRegion, new PropertyChangedEventHandler(OnCountryRegionPropertyChanged), "CountryRegion", AdventureWorks.Dal.Adapter.v51.RelationClasses.StaticSalesTerritoryRelations.CountryRegionEntityUsingCountryRegionCodeStatic, true, signalRelatedEntity, "SalesTerritories", resetFKFields, new int[] { (int)SalesTerritoryFieldIndex.CountryRegionCode });
     _countryRegion = null;
 }