public void Should_match_all_methods_matching_the_required_signature() { var subject = new ReflectionEventSubscriber(new EventTest()); Action<int> i; subject.TryGetEventHandler(out i).Should().BeTrue(); Action<string> str; subject.TryGetEventHandler(out str).Should().BeTrue(); Action<byte> b; subject.TryGetEventHandler(out b).Should().BeFalse(); Action<bool> boolean; subject.TryGetEventHandler(out boolean).Should().BeFalse(); Action<bool> c; subject.TryGetEventHandler(out c).Should().BeFalse(); }
public Log4NetMongoEvents() { _subscriber = new ReflectionEventSubscriber(this); }
public DiagnosticsActivityEventSubscriber() { _subscriber = new ReflectionEventSubscriber(this, bindingFlags: BindingFlags.Instance | BindingFlags.NonPublic); }
public MongoClientCommandEventHandler() { Subscribe = new ReflectionEventSubscriber(this); }
/// <summary> /// Initializes a new instance of the <see cref="TraceSourceSdamEventSubscriber"/> class. /// </summary> /// <param name="traceSource">The trace source.</param> public TraceSourceSdamEventSubscriber(TraceSource traceSource) { _traceSource = Ensure.IsNotNull(traceSource, nameof(traceSource)); _subscriber = new ReflectionEventSubscriber(this, bindingFlags: BindingFlags.Instance | BindingFlags.NonPublic); }
public MongoEventsLogger(ILogger <CommandStartedEvent> commandStartedLogger) { _CommandStartedLogger = commandStartedLogger; _Subscriber = new ReflectionEventSubscriber(this); }
public logMongoEvents() { _Subscriber = new ReflectionEventSubscriber(this); }
public DiagnosticsActivityEventSubscriber(DiagnosticListener diagnosticListener) { _diagnosticListener = diagnosticListener; _subscriber = new ReflectionEventSubscriber(this, bindingFlags: BindingFlags.Instance | BindingFlags.NonPublic); }
public EventSubscriber() { subscriber = new ReflectionEventSubscriber(this); }
/// <summary> /// Creates instance of <see cref="MongoEventSubscriber" /> class. /// </summary> public MongoEventSubscriber() { _subscriber = new ReflectionEventSubscriber(new MongoListener()); }
public MongoDBEventsSubscriber() { this.eventSubscriber = new ReflectionEventSubscriber(this); this.scopes = new Dictionary <int, IScope>(); }