Exemple #1
0
 /// <summary> setups the sync logic for member _addressType</summary>
 /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
 private void SetupSyncAddressType(IEntityCore relatedEntity)
 {
     if (_addressType != relatedEntity)
     {
         DesetupSyncAddressType(true, true);
         _addressType = (AddressTypeEntity)relatedEntity;
         this.PerformSetupSyncRelatedEntity(_addressType, new PropertyChangedEventHandler(OnAddressTypePropertyChanged), "AddressType", AdventureWorks.Dal.Adapter.v41.RelationClasses.StaticBusinessEntityAddressRelations.AddressTypeEntityUsingAddressTypeIdStatic, true, new string[] {  });
     }
 }
Exemple #2
0
 protected BusinessEntityAddressEntity(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     if (SerializationHelper.Optimization != SerializationOptimization.Fast)
     {
         _address = (AddressEntity)info.GetValue("_address", typeof(AddressEntity));
         if (_address != null)
         {
             _address.AfterSave += new EventHandler(OnEntityAfterSave);
         }
         _addressType = (AddressTypeEntity)info.GetValue("_addressType", typeof(AddressTypeEntity));
         if (_addressType != null)
         {
             _addressType.AfterSave += new EventHandler(OnEntityAfterSave);
         }
         _businessEntity = (BusinessEntityEntity)info.GetValue("_businessEntity", typeof(BusinessEntityEntity));
         if (_businessEntity != null)
         {
             _businessEntity.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 _addressType</summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		private void SetupSyncAddressType(IEntityCore relatedEntity)
		{
			if(_addressType!=relatedEntity)
			{
				DesetupSyncAddressType(true, true);
				_addressType = (AddressTypeEntity)relatedEntity;
				this.PerformSetupSyncRelatedEntity( _addressType, new PropertyChangedEventHandler( OnAddressTypePropertyChanged ), "AddressType", AdventureWorks.Dal.Adapter.v41.RelationClasses.StaticBusinessEntityAddressRelations.AddressTypeEntityUsingAddressTypeIdStatic, true, new string[] {  } );
			}
		}
		/// <summary> Removes the sync logic for member _addressType</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 DesetupSyncAddressType(bool signalRelatedEntity, bool resetFKFields)
		{
			this.PerformDesetupSyncRelatedEntity( _addressType, new PropertyChangedEventHandler( OnAddressTypePropertyChanged ), "AddressType", AdventureWorks.Dal.Adapter.v41.RelationClasses.StaticBusinessEntityAddressRelations.AddressTypeEntityUsingAddressTypeIdStatic, true, signalRelatedEntity, "BusinessEntityAddresses", resetFKFields, new int[] { (int)BusinessEntityAddressFieldIndex.AddressTypeId } );
			_addressType = null;
		}
		protected BusinessEntityAddressEntity(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			if(SerializationHelper.Optimization != SerializationOptimization.Fast) 
			{
				_address = (AddressEntity)info.GetValue("_address", typeof(AddressEntity));
				if(_address!=null)
				{
					_address.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_addressType = (AddressTypeEntity)info.GetValue("_addressType", typeof(AddressTypeEntity));
				if(_addressType!=null)
				{
					_addressType.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_businessEntity = (BusinessEntityEntity)info.GetValue("_businessEntity", typeof(BusinessEntityEntity));
				if(_businessEntity!=null)
				{
					_businessEntity.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
			}
			// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
			// __LLBLGENPRO_USER_CODE_REGION_END
			
		}
Exemple #6
0
 /// <summary> Removes the sync logic for member _addressType</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 DesetupSyncAddressType(bool signalRelatedEntity, bool resetFKFields)
 {
     this.PerformDesetupSyncRelatedEntity(_addressType, new PropertyChangedEventHandler(OnAddressTypePropertyChanged), "AddressType", AdventureWorks.Dal.Adapter.v41.RelationClasses.StaticBusinessEntityAddressRelations.AddressTypeEntityUsingAddressTypeIdStatic, true, signalRelatedEntity, "BusinessEntityAddresses", resetFKFields, new int[] { (int)BusinessEntityAddressFieldIndex.AddressTypeId });
     _addressType = null;
 }