示例#1
0
 /// <summary> setups the sync logic for member _businessEntity</summary>
 /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
 private void SetupSyncBusinessEntity(IEntityCore relatedEntity)
 {
     if (_businessEntity != relatedEntity)
     {
         DesetupSyncBusinessEntity(true, true);
         _businessEntity = (BusinessEntityEntity)relatedEntity;
         this.PerformSetupSyncRelatedEntity(_businessEntity, new PropertyChangedEventHandler(OnBusinessEntityPropertyChanged), "BusinessEntity", AdventureWorks.Dal.Adapter.v50.RelationClasses.StaticBusinessEntityAddressRelations.BusinessEntityEntityUsingBusinessEntityIdStatic, true, new string[] {  });
     }
 }
 protected VendorEntity(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     if (SerializationHelper.Optimization != SerializationOptimization.Fast)
     {
         _productVendors       = (EntityCollection <ProductVendorEntity>)info.GetValue("_productVendors", typeof(EntityCollection <ProductVendorEntity>));
         _purchaseOrderHeaders = (EntityCollection <PurchaseOrderHeaderEntity>)info.GetValue("_purchaseOrderHeaders", typeof(EntityCollection <PurchaseOrderHeaderEntity>));
         _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
 }
示例#3
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
 }
示例#4
0
 /// <summary> Removes the sync logic for member _businessEntity</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 DesetupSyncBusinessEntity(bool signalRelatedEntity, bool resetFKFields)
 {
     this.PerformDesetupSyncRelatedEntity(_businessEntity, new PropertyChangedEventHandler(OnBusinessEntityPropertyChanged), "BusinessEntity", AdventureWorks.Dal.Adapter.v50.RelationClasses.StaticBusinessEntityAddressRelations.BusinessEntityEntityUsingBusinessEntityIdStatic, true, signalRelatedEntity, "BusinessEntityAddresses", resetFKFields, new int[] { (int)BusinessEntityAddressFieldIndex.BusinessEntityId });
     _businessEntity = null;
 }
		/// <summary> setups the sync logic for member _businessEntity</summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		private void SetupSyncBusinessEntity(IEntityCore relatedEntity)
		{
			if(_businessEntity!=relatedEntity)
			{
				DesetupSyncBusinessEntity(true, true);
				_businessEntity = (BusinessEntityEntity)relatedEntity;
				this.PerformSetupSyncRelatedEntity( _businessEntity, new PropertyChangedEventHandler( OnBusinessEntityPropertyChanged ), "BusinessEntity", AdventureWorks.Dal.Adapter.v50.RelationClasses.StaticPersonRelations.BusinessEntityEntityUsingBusinessEntityIdStatic, true, new string[] {  } );
			}
		}
		/// <summary> Removes the sync logic for member _businessEntity</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 DesetupSyncBusinessEntity(bool signalRelatedEntity, bool resetFKFields)
		{
			this.PerformDesetupSyncRelatedEntity( _businessEntity, new PropertyChangedEventHandler( OnBusinessEntityPropertyChanged ), "BusinessEntity", AdventureWorks.Dal.Adapter.v50.RelationClasses.StaticPersonRelations.BusinessEntityEntityUsingBusinessEntityIdStatic, true, signalRelatedEntity, "Person", false, new int[] { (int)PersonFieldIndex.BusinessEntityId } );
			_businessEntity = null;
		}
		protected PersonEntity(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			if(SerializationHelper.Optimization != SerializationOptimization.Fast) 
			{
				_businessEntityContacts = (EntityCollection<BusinessEntityContactEntity>)info.GetValue("_businessEntityContacts", typeof(EntityCollection<BusinessEntityContactEntity>));
				_contactCreditCards = (EntityCollection<ContactCreditCardEntity>)info.GetValue("_contactCreditCards", typeof(EntityCollection<ContactCreditCardEntity>));
				_customers = (EntityCollection<CustomerEntity>)info.GetValue("_customers", typeof(EntityCollection<CustomerEntity>));
				_emailAddresses = (EntityCollection<EmailAddressEntity>)info.GetValue("_emailAddresses", typeof(EntityCollection<EmailAddressEntity>));
				_personPhones = (EntityCollection<PersonPhoneEntity>)info.GetValue("_personPhones", typeof(EntityCollection<PersonPhoneEntity>));
				_businessEntity = (BusinessEntityEntity)info.GetValue("_businessEntity", typeof(BusinessEntityEntity));
				if(_businessEntity!=null)
				{
					_businessEntity.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_employee = (EmployeeEntity)info.GetValue("_employee", typeof(EmployeeEntity));
				if(_employee!=null)
				{
					_employee.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_password = (PasswordEntity)info.GetValue("_password", typeof(PasswordEntity));
				if(_password!=null)
				{
					_password.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
			}
			// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
			// __LLBLGENPRO_USER_CODE_REGION_END
		}
		protected BusinessEntityContactEntity(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			if(SerializationHelper.Optimization != SerializationOptimization.Fast) 
			{
				_businessEntity = (BusinessEntityEntity)info.GetValue("_businessEntity", typeof(BusinessEntityEntity));
				if(_businessEntity!=null)
				{
					_businessEntity.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_contactType = (ContactTypeEntity)info.GetValue("_contactType", typeof(ContactTypeEntity));
				if(_contactType!=null)
				{
					_contactType.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_person = (PersonEntity)info.GetValue("_person", typeof(PersonEntity));
				if(_person!=null)
				{
					_person.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
			}
			// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
			// __LLBLGENPRO_USER_CODE_REGION_END
		}
		protected StoreEntity(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			if(SerializationHelper.Optimization != SerializationOptimization.Fast) 
			{
				_customers = (EntityCollection<CustomerEntity>)info.GetValue("_customers", typeof(EntityCollection<CustomerEntity>));
				_salesPerson = (SalesPersonEntity)info.GetValue("_salesPerson", typeof(SalesPersonEntity));
				if(_salesPerson!=null)
				{
					_salesPerson.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
		}