/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (path == null) { path = pathFrom + (this.GetName() ?? "UNNAMED"); this.DeclaredPath = path; } } if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.VisitDef(path, preChildren, postChildren)) { return(true); } if (postChildren != null && postChildren.Invoke(this, path)) { return(false); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + "operationCombineAttributes"; this.DeclaredPath = path; } } if (preChildren?.Invoke(this, path) == true) { return(false); } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + this.TraitName; this.DeclaredPath = path; } //trackVisits(path); if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.ExtendsTrait != null) { if (this.ExtendsTrait.Visit(path + "/extendsTrait/", preChildren, postChildren)) { return(true); } } if (this.Parameters != null) { if (this._hasParameters.VisitList(path + "/hasParameters/", preChildren, postChildren)) { return(true); } } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { // name of arg is forced down from trait ref. you get what you get and you don't throw a fit. string path = pathFrom; //trackVisits(path); if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.Value != null) { if (this.Value is CdmObject valueAsJObject) { if (valueAsJObject.Visit($"{path}/value/", preChildren, postChildren)) { return(true); } } } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom; // name of arg is forced down from trait ref. you get what you get and you don't throw a fit. this.DeclaredPath = path; } } //trackVisits(path); if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.Value != null) { if (this.Value is CdmObject valueAsJObject) { if (valueAsJObject.Visit($"{path}/value/", preChildren, postChildren)) { return(true); } } } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + this.Name; this.DeclaredPath = path; } } //trackVisits(path); if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.Entity.Visit(path + "/entity/", preChildren, postChildren)) { return(true); } if (this.VisitAtt(path, preChildren, postChildren)) { return(true); } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + (!string.IsNullOrEmpty(this.ConstantEntityName) ? this.ConstantEntityName : "(unspecified)"); this.DeclaredPath = path; } } //trackVisits(path); if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.EntityShape != null) { this.EntityShape.Owner = this; if (this.EntityShape.Visit(path + "/entityShape/", preChildren, postChildren)) { return(true); } } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + "projection"; this.DeclaredPath = path; } } if (preChildren?.Invoke(this, path) == true) { return(false); } if (this.Source != null) { if (this.Source.Visit(path + "/source/", preChildren, postChildren)) { return(true); } } bool result = false; if (this.Operations != null && this.Operations.Count > 0) { // since this.Operations.VisitList results is non-unique attribute context paths if there are 2 or more operations of the same type. // e.g. with composite keys // the solution is to add a unique identifier to the path by adding the operation index or opIdx for (int opIndex = 0; opIndex < this.Operations.Count; opIndex++) { this.Operations[opIndex].Index = opIndex + 1; if ((this.Operations.AllItems[opIndex] != null) && (this.Operations.AllItems[opIndex].Visit($"{path}/operation/index{opIndex + 1}/", preChildren, postChildren))) { result = true; } else { result = false; } } if (result) { return(true); } } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + (this.Value != null ? "value/" : ""); this.DeclaredPath = path; } //trackVisits(path); if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.Value != null) { Type valueType = this.Value.GetType(); if (this.Value is CdmObject valueAsJObject) { if (valueAsJObject.Visit(path, preChildren, postChildren)) { return(true); } } } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + this.Name; this.DeclaredPath = path; } } //trackVisits(path); if (preChildren?.Invoke(this, path) == true) return false; if (this.DataType?.Visit(path + "/dataType/", preChildren, postChildren) == true) return true; if (this.AttributeContext?.Visit(path + "/attributeContext/", preChildren, postChildren) == true) return true; if (this.VisitAtt(path, preChildren, postChildren)) return true; if (postChildren != null && postChildren.Invoke(this, path)) return true; return false; }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + this.Name; this.DeclaredPath = path; } //trackVisits(path); if (preChildren?.Invoke(this, path) == true) { return(false); } if (this.DataType?.Visit(path + "/dataType/", preChildren, postChildren) == true) { return(true); } if (this.AttributeContext?.Visit(path + "/attributeContext/", preChildren, postChildren) == true) { return(true); } if (this.VisitAtt(path, preChildren, postChildren)) { return(true); } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { if (string.IsNullOrEmpty(this.DeclaredPath)) { this.DeclaredPath = pathFrom + this.Name; } var path = this.DeclaredPath; if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.VisitDef(path, preChildren, postChildren)) { return(true); } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = this.UpdateDeclaredPath(pathFrom); //trackVisits(path); if (preChildren?.Invoke(this, path) == true) { return(false); } if (this.ExtendsPurpose != null) { this.ExtendsPurpose.Owner = this; if (this.ExtendsPurpose.Visit(path + "/extendsPurpose/", preChildren, postChildren)) { return(true); } } if (this.VisitDef(path, preChildren, postChildren)) { return(true); } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = this.UpdateDeclaredPath(pathFrom); if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.ExtendsTrait != null) { this.ExtendsTrait.Owner = this; if (this.ExtendsTrait.Visit(path + "/extendsTrait/", preChildren, postChildren)) { return(true); } } if (this.Parameters != null) { if (this.Parameters.VisitList(path + "/hasParameters/", preChildren, postChildren)) { return(true); } } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { if (preChildren != null && preChildren.Invoke(this, pathFrom)) { return(false); } if (this.Definitions != null) { if (this.Definitions.VisitList(pathFrom, preChildren, postChildren)) { return(true); } } if (this.Entities != null) { if (this.Entities.VisitList(pathFrom, preChildren, postChildren)) { return(true); } } if (this.SubManifests != null) { if (this.SubManifests.VisitList(pathFrom, preChildren, postChildren)) { return(true); } } if (postChildren != null && postChildren.Invoke(this, pathFrom)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { if (string.IsNullOrEmpty(this.DeclaredPath)) { this.DeclaredPath = pathFrom + this.Name; } path = this.DeclaredPath; } if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.VisitDef(path, preChildren, postChildren)) { return(true); } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + this.DataTypeName; this.DeclaredPath = path; } //trackVisits(path); if (preChildren?.Invoke(this, path) == true) { return(false); } if (this.ExtendsDataType?.Visit(path + "/extendsDataType/", preChildren, postChildren) == true) { return(true); } if (this.VisitDef(path, preChildren, postChildren)) { return(true); } if (postChildren?.Invoke(this, path) == true) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = this.UpdateDeclaredPath(pathFrom); //trackVisits(path); if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.DefaultValue != null) { Type defaultValueType = this.DefaultValue.GetType(); if ((this.DefaultValue is CdmObject) && (this.DefaultValue as CdmObject).Visit(path + "/defaultValue/", preChildren, postChildren)) { return(true); } } if (this.DataTypeRef != null) { if (this.DataTypeRef.Visit(path + "/dataType/", preChildren, postChildren)) { return(true); } } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + $"operationReplaceAsForeignKey"; this.DeclaredPath = path; } } if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.ReplaceWith != null) { if (this.ReplaceWith.Visit(pathFrom + "foreignKeyAttribute/", preChildren, postChildren)) { return(true); } } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = this.UpdateDeclaredPath(pathFrom); if (preChildren?.Invoke(this, path) == true) { return(false); } if (this.TraitsToAdd != null && CdmObjectBase.VisitList(this.TraitsToAdd, $"{path}/traitsToAdd/", preChildren, postChildren)) { return(true); } if (this.TraitsToRemove != null && CdmObjectBase.VisitList(this.TraitsToRemove, $"{path}/traitsToRemove/", preChildren, postChildren)) { return(true); } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { if (preChildren != null && preChildren.Invoke(this, pathFrom)) { return(false); } if (postChildren != null && postChildren.Invoke(this, pathFrom)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = this.UpdateDeclaredPath(pathFrom); if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.DataPartitions != null) { if (this.DataPartitions.VisitList(path + "/dataPartitions/", preChildren, postChildren)) { return(true); } } if (this.DataPartitionPatterns != null) { if (this.DataPartitionPatterns.VisitList(path + "/dataPartitionPatterns/", preChildren, postChildren)) { return(true); } } if (this.IncrementalPartitions != null) { if (this.IncrementalPartitions.VisitList(path + "/incrementalPartitions/", preChildren, postChildren)) { return(true); } } if (this.IncrementalPartitionPatterns != null) { if (this.IncrementalPartitionPatterns.VisitList(path + "/incrementalPartitionPatterns/", preChildren, postChildren)) { return(true); } } if (this.VisitDef(path, preChildren, postChildren)) { return(true); } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
public QuadTree VisitAfter(VisitCallback callback) { Queue <Quad> quads = new Queue <Quad>(10); Queue <Quad> next = new Queue <Quad>(10); if (root != null) { quads.Enqueue(new Quad(root, tlX, tlY, brX, brY)); } Quad q; TreeNode child; while (quads.Count > 0) { q = quads.Dequeue(); TreeNode node = q.node; if (!node.IsLeaf()) { double x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1; double xm = (x0 + x1) / 2, ym = (y0 + y1) / 2; if ((child = node.quadrants[0]) != null) { quads.Enqueue(new Quad(child, x0, y0, xm, ym)); } if ((child = node.quadrants[1]) != null) { quads.Enqueue(new Quad(child, xm, y0, x1, ym)); } if ((child = node.quadrants[2]) != null) { quads.Enqueue(new Quad(child, x0, ym, xm, y1)); } if ((child = node.quadrants[3]) != null) { quads.Enqueue(new Quad(child, xm, ym, x1, y1)); } } next.Enqueue(q); } while (next.Count > 0) { q = next.Dequeue(); callback.Invoke(q.node, q.x0, q.y0, q.x1, q.y1); } return(this); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (!string.IsNullOrEmpty(this.NamedReference)) { path = pathFrom + this.NamedReference; } else { path = pathFrom; } this.DeclaredPath = path; } if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.ExplicitReference != null && string.IsNullOrEmpty(this.NamedReference)) { if (this.ExplicitReference.Visit(path, preChildren, postChildren)) { return(true); } } if (this.VisitRef(path, preChildren, postChildren)) { return(true); } if (this.AppliedTraits != null) { if (this.AppliedTraits.VisitList(path + "/appliedTraits/", preChildren, postChildren)) { return(true); } } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = this.UpdateDeclaredPath(pathFrom); if (preChildren?.Invoke(this, path) == true) { return(false); } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + this.Name; this.DeclaredPath = path; } } if (preChildren?.Invoke(this, path) == true) { return(false); } if (this.Parent?.Visit(path + "/parent/", preChildren, postChildren) == true) { return(true); } if (this.Definition?.Visit(path + "/definition/", preChildren, postChildren) == true) { return(true); } if (this.Contents != null && CdmObjectBase.VisitList(this.Contents, path + "/", preChildren, postChildren)) // fix that as any. { return(true); } if (this.Lineage != null && CdmObjectBase.VisitList(this.Lineage, path + "/lineage/", preChildren, postChildren)) // fix that as any. { return(true); } if (this.VisitDef(path, preChildren, postChildren)) { return(true); } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (path == null) { path = pathFrom + this.EntityName; this.DeclaredPath = path; } } if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.DataPartitions != null) { if (this.DataPartitions.VisitList(path + "/dataPartitions/", preChildren, postChildren)) { return(true); } } if (this.DataPartitionPatterns != null) { if (this.DataPartitionPatterns.VisitList(path + "/dataPartitionPatterns/", preChildren, postChildren)) { return(true); } } if (this.VisitDef(path, preChildren, postChildren)) { return(true); } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + this.AttributeGroupName; this.DeclaredPath = path; } } //trackVisits(path); if (preChildren?.Invoke(this, path) == true) { return(false); } if (this.AttributeContext != null) { this.AttributeContext.Owner = this; } if (this.AttributeContext?.Visit(path + "/attributeContext/", preChildren, postChildren) == true) { return(true); } if (this.Members != null) { if (this.Members.VisitList(path + "/members/", preChildren, postChildren)) { return(true); } } if (this.VisitDef(path, preChildren, postChildren)) { return(true); } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + this.Name; this.DeclaredPath = path; } } //trackVisits(path); if (preChildren?.Invoke(this, path) == true) { return(false); } if (this.DataType?.Visit($"{path}/dataType/", preChildren, postChildren) == true) { return(true); } if (this.AttributeContext?.Visit($"{path}/attributeContext/", preChildren, postChildren) == true) { return(true); } if (this.Projection != null) { this.Projection.Owner = this; } if (this.Projection?.Visit($"{path}/projection/", preChildren, postChildren) == true) { return(true); } if (this.VisitAtt(path, preChildren, postChildren)) { return(true); } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }
/// <inheritdoc /> public override bool Visit(string pathFrom, VisitCallback preChildren, VisitCallback postChildren) { string path = string.Empty; if (this.Ctx.Corpus.blockDeclaredPathChanges == false) { path = this.DeclaredPath; if (string.IsNullOrEmpty(path)) { path = pathFrom + this.Name; this.DeclaredPath = path; } } //trackVisits(path); if (preChildren != null && preChildren.Invoke(this, path)) { return(false); } if (this.DefaultValue != null) { Type defaultValueType = this.DefaultValue.GetType(); if ((this.DefaultValue is CdmObject) && (this.DefaultValue as CdmObject).Visit(path + "/defaultValue/", preChildren, postChildren)) { return(true); } } if (this.DataTypeRef != null) { if (this.DataTypeRef.Visit(path + "/dataType/", preChildren, postChildren)) { return(true); } } if (postChildren != null && postChildren.Invoke(this, path)) { return(true); } return(false); }