/// <summary>
 /// Constructor to initialise a new relationship
 /// </summary>
 /// <param name="owningBo">The business object that owns the relationship</param>
 /// <param name="lRelDef">The relationship definition</param>
 /// <param name="lBOPropCol">The set of properties used to initialise the RelKey object</param>
 /// <param name="timeOut">The timeout between when the collection was last loaded.</param>
 public MultipleRelationship
     (IBusinessObject owningBo, IRelationshipDef lRelDef, IBOPropCol lBOPropCol, int timeOut)
     : base(owningBo, lRelDef, lBOPropCol)
 {
     _boCol = new Lazy <RelatedBusinessObjectCollection <TBusinessObject> >(() =>
                                                                            (RelatedBusinessObjectCollection <TBusinessObject>)
                                                                            RelationshipUtils.CreateRelatedBusinessObjectCollection(_relDef.RelatedObjectAssemblyName, _relDef.RelatedObjectClassName, this));
     TimeOut = timeOut;
 }
Beispiel #2
0
        private void RemoveFromSingleReverseRelationship(IRelationship reverseRelationship)
        {
            var singleReverseRelationship = reverseRelationship as SingleRelationshipBase;

            if (singleReverseRelationship == null)
            {
                return;
            }

            RelationshipUtils.CheckCorrespondingSingleRelationshipsAreValid(this, singleReverseRelationship);
            ((ISingleRelationship)singleReverseRelationship).SetRelatedObject(null);
        }
Beispiel #3
0
        private void AddToSingleReverseRelationship(IRelationship reverseRelationship)
        {
            var singleRelationship = reverseRelationship as ISingleRelationship;

            if (singleRelationship == null)
            {
                return;
            }
            RelationshipUtils.CheckCorrespondingSingleRelationshipsAreValid
                (this, (SingleRelationshipBase)singleRelationship);
            singleRelationship.SetRelatedObject(this.OwningBO);
        }
 /// <summary>
 /// Do the initialisation of this relationship.
 /// </summary>
 protected override void DoInitialisation()
 {
     RelationshipUtils.SetupCriteriaForRelationship(this, _boCol.Value);
 }