Exemple #1
0
 /// <summary>
 /// Creates a new <see cref="TypeMatchException"/>.
 /// </summary>
 /// <param name="typeMatch">The <see cref="ITypeMatch"/> expression that failed.</param>
 /// <param name="objectType">The <see cref="Type"/> of the bad object.</param>
 public TypeMatchException(ITypeMatch typeMatch, Type objectType) : base($"A required type match failed to match the provided type \"{objectType.Name}\".")
 {
     TypeMatch  = typeMatch;
     ObjectType = objectType;
 }
Exemple #2
0
 /// <summary>
 /// Creates a new <see cref="CustomTypeConfiguration"/>.
 /// </summary>
 public CustomTypeConfiguration()
 {
     NativeTypes = TrustedTypes = new NoTypeMatch();
 }
Exemple #3
0
 /// <summary>
 /// Adds two <see cref="ITypeMatch"/> expressions together.
 /// </summary>
 /// <param name="match">The existing <see cref="ITypeMatch"/> expression.</param>
 /// <param name="add">The <see cref="ITypeMatch"/> to add.</param>
 /// <returns>An <see cref="ITypeMatch"/> that matches all <see cref="System.Type"/>s that either of the component expressions match.</returns>
 public static ITypeMatch Concat(this ITypeMatch match, ITypeMatch add) => new ConcatTypeMatch(match, add);