Beispiel #1
0
 private void CheckComplete()
 {
     if (this.FIsComplete)
     {
         return;
     }
     if (this.Object.IsNull)
     {
         this.FIsComplete = true;
     }
     else
     {
         DataStorage storage       = this.Object.Storage;
         DataSession masterSession = this.Session.MasterSession;
         if (masterSession != null)
         {
             DataObjectChildList childs      = masterSession[storage.Class][this.Object.Id].GetChilds(this.ChildRef);
             DataStorage         dataStorage = this.Session[this.ChildRef.ChildClass];
             MetadataProperty    property    = this.ChildRef.AggregationRef.Association.Property;
             for (int index = 0; index < childs.Count; ++index)
             {
                 DataObject untypedValue = (DataObject)dataStorage[childs[index].Id][property].UntypedValue;
             }
             this.FIsComplete = true;
         }
         else if (storage.IsChildListCompleted(this.ChildRef))
         {
             this.FIsComplete = true;
         }
         else
         {
             this.Session.TraceUnplannedChildrenLoading(this.ChildRef);
             LoadPlan plan = new LoadPlan(storage.Class);
             plan.EnsureChildRef(this.ChildRef, new LoadPlan(this.ChildRef.ChildClass));
             storage.Session.LoadData(plan, (DataObjectList)null, new DataId[1]
             {
                 this.Object.Id
             }, (string)null);
         }
     }
 }