public bool TryFindMember( string memberName, out MetadataProperty property, out MetadataChildRef childRef) { property = this.Properties.Find(memberName); if (property != null) { childRef = (MetadataChildRef)null; return(true); } MetadataClass byIdentName = this.Metadata.Classes.FindByIdentName(memberName); if (byIdentName != null) { childRef = this.Childs.Find(byIdentName); if (childRef != null) { return(true); } } else { childRef = (MetadataChildRef)null; } return(false); }
protected internal DataObjectChildList(DataObject owner, MetadataChildRef childRef) { this.Object = owner; this.ChildRef = childRef; this.FIsComplete = owner.IsNew; this.FItems = new ArrayList(); }
public DataObjectChildList GetChilds(MetadataChildRef childRef) { this.CheckNotUntypedNull(); this.CheckNotError(); DataObjectChildList[] dataObjectChildListArray = this.FChilds ?? (this.FChilds = new DataObjectChildList[this.Class.Childs.Count]); return(dataObjectChildListArray[childRef.Index] ?? (dataObjectChildListArray[childRef.Index] = this.Session[childRef.ChildClass].CreateChildListInstance(this, childRef))); }
internal void CompleteChildLists(MetadataChildRef childRef) { if (this.FCompletedChildRefs == null) { this.FCompletedChildRefs = new bool[this.Class.Childs.Count]; } this.FCompletedChildRefs[childRef.Index] = true; }
public ChildNavigationStep( SqlUtils.Navigation navigation, SqlUtils.NavigationStep predecessor, string path, MetadataChildRef childRef) : base(navigation, predecessor, path) { this.ChildRef = childRef; }
public void NeedMember( string memberName, out MetadataProperty property, out MetadataChildRef childRef) { if (!this.TryFindMember(memberName, out property, out childRef)) { throw new DataException(string.Format("\"{0}\" не является ни свойством, ни дочерним классом.", (object)memberName)); } }
private static void GenerateChilds(MetadataClass cls, StringBuilder sb) { for (int index = 0; index < cls.Childs.Count; ++index) { MetadataChildRef child = cls.Childs[index]; MetadataClass childClass = child.ChildClass; CodeGenerator.GenerateDoc("\t", "summary", childClass.Caption, sb); sb.AppendFormat("\tpublic {0}ChildList {1} {{ get {{ return ({0}ChildList)base.GetChilds(Meta.{1}); }} }}\n", (object)childClass.QTypeName, (object)child.MemberName); } }
internal void RemoveChild(DataObject child, bool checkWriting) { DataObjectChildList[] fchilds = this.FChilds; if (fchilds == null) { return; } MetadataChildRef metadataChildRef = this.Class.Childs.Need(child.Class); fchilds[metadataChildRef.Index]?.RemoveChild(child, checkWriting); }
internal MetadataChildRef Ensure(MetadataAssociationRef ownerRef) { MetadataChildRef metadataChildRef = this.Find(ownerRef.Association.Class); if (metadataChildRef == null) { metadataChildRef = new MetadataChildRef(ownerRef, this.FItems.Count); this.FItems.Add(metadataChildRef); } return(metadataChildRef); }
public MetadataChildRef Find(MetadataClass childClass) { for (int index = 0; index < this.FItems.Count; ++index) { MetadataChildRef metadataChildRef = this[index]; if (metadataChildRef.ChildClass == childClass) { return(metadataChildRef); } } return((MetadataChildRef)null); }
private ChildRefLoadPlan EnsureChildRef( MetadataChildRef childRef, LoadPlan plan, LoadPlan.MergedPlans mergedPlans) { for (int index = 0; index < this.Childs.Count; ++index) { ChildRefLoadPlan child = this.Childs[index]; if (child.ChildRef == childRef) { child.Plan.MergeWith(plan, mergedPlans); return(child); } } ChildRefLoadPlan childRefLoadPlan = new ChildRefLoadPlan(childRef, plan); this.Childs.Add((object)childRefLoadPlan); return(childRefLoadPlan); }
public ChildRefLoadPlan EnsureChildRef(MetadataChildRef childRef, LoadPlan plan) => this.EnsureChildRef(childRef, plan, new LoadPlan.MergedPlans());
public UnplannedChildrenLoadingEventArgs(MetadataChildRef childRef) => this.ChildRef = childRef;
public ChildRefLoadPlan(MetadataChildRef childRef, LoadPlan plan) { this.ChildRef = childRef; this.Plan = LoadPlan.UseExistingOrCreateNew(plan, childRef.ChildClass); }
protected internal virtual DataObjectChildList CreateChildListInstance( DataObject owner, MetadataChildRef childRef) { return(new DataObjectChildList(owner, childRef)); }
internal bool IsChildListCompleted(MetadataChildRef childRef) => this.FCompletedChildRefs != null && this.FCompletedChildRefs[childRef.Index];