public static FutureInstanceVisitor <T> CreateForFutureInstance <T>(ObjectVisitorOptions options, IDictionary <string, object> initialValues = null) { options ??= ObjectVisitorOptions.Default; var handler = UnsafeObjectHandleSwitcher.Switch <T>(options.AlgorithmKind)().With <T>(); return(new FutureInstanceVisitor <T>(handler, options, initialValues)); }
public static StaticTypeObjectVisitor <T> CreateForStaticType <T>(ObjectVisitorOptions options) { options ??= ObjectVisitorOptions.Default; var handler = UnsafeObjectHandleSwitcher.Switch <T>(options.AlgorithmKind)().With <T>(); return(new StaticTypeObjectVisitor <T>(handler, options)); }
public static InstanceVisitor <T> CreateForInstance <T>(T instance, ObjectVisitorOptions options) { options ??= ObjectVisitorOptions.Default; var handler = UnsafeObjectHandleSwitcher.Switch <T>(options.AlgorithmKind)().AndSetInstance(instance).With <T>(); return(new InstanceVisitor <T>(handler, options)); }
public static StaticTypeObjectVisitor <T> CreateForStaticType <T, TStrategy>(ObjectVisitorOptions options) where TStrategy : class, IValidationStrategy <T>, new() { options ??= ObjectVisitorOptions.Default; var handler = UnsafeObjectHandleSwitcher.Switch <T>(options.AlgorithmKind)().With <T>(); var visitor = new StaticTypeObjectVisitor <T>(handler, options); visitor.VerifiableEntry.SetStrategy <TStrategy>(); return(visitor); }
public static FutureInstanceVisitor <T> CreateForFutureInstance <T, TStrategy>(ObjectVisitorOptions options, IDictionary <string, object> initialValues = null) where TStrategy : class, IValidationStrategy <T>, new() { options ??= ObjectVisitorOptions.Default; var handler = UnsafeObjectHandleSwitcher.Switch <T>(options.AlgorithmKind)().With <T>(); var visitor = new FutureInstanceVisitor <T>(handler, options, initialValues); visitor.VerifiableEntry.SetStrategy <TStrategy>(); return(visitor); }