Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
        /// <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.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);
        }