public CodeGenerationParameter Parent(Label label)
        {
            if (!HasParent())
            {
                throw new NotSupportedException("Orphan parameter");
            }

            CodeGenerationParameter matchedParent = _parent;

            while (matchedParent != null)
            {
                if (matchedParent.IsLabeled(this.label))
                {
                    return(matchedParent);
                }
                matchedParent = matchedParent.Parent();
            }

            throw new NotSupportedException("Orphan parameter");
        }
Ejemplo n.º 2
0
 public static CodeGenerationParameters From(Label label, string value)
 {
     return(From(CodeGenerationParameter.Of(label, value)));
 }
 private void OwnedBy(CodeGenerationParameter parent) => _parent = parent;