示例#1
0
        public static SignaturePart Alternatives([ItemNotNull][NotNull] IEnumerable <SignaturePart> parts, [CanBeNull] string name = null)
        {
            var result = AlternativesPart.From(parts);

            result.Name = name;
            return(result);
        }
示例#2
0
 protected override JObject Visit(AlternativesPart part)
 {
     return(new JObject
     {
         ["$or"] = new JArray(part.Alternatives.Select(a => a.AcceptForValue(this)))
     });
 }
示例#3
0
        public static SignaturePart From([NotNull] SignaturePart inner)
        {
            if (inner is AlternativesPart ap)
            {
                return(AlternativesPart.From(ap.Alternatives.Select(From)));
            }

            return(new QuotedPart(inner));
        }
示例#4
0
 public void Visit(AlternativesPart part)
 {
     sb.Append('{');
     VisitWithDelimiter(part.Alternatives, " | ");
     sb.Append('}');
 }
示例#5
0
 void ISignatureVisitor.Visit(AlternativesPart part) => result = Visit(part);
示例#6
0
 protected abstract T Visit([NotNull] AlternativesPart part);