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);
 }
Exemple #4
0
 public MongoClientCommandEventHandler()
 {
     Subscribe = new ReflectionEventSubscriber(this);
 }
Exemple #5
0
 /// <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);
 }
Exemple #6
0
 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);
 }
Exemple #9
0
 public EventSubscriber()
 {
     subscriber = new ReflectionEventSubscriber(this);
 }
Exemple #10
0
 /// <summary>
 ///     Creates instance of <see cref="MongoEventSubscriber" /> class.
 /// </summary>
 public MongoEventSubscriber()
 {
     _subscriber = new ReflectionEventSubscriber(new MongoListener());
 }
Exemple #11
0
 public MongoDBEventsSubscriber()
 {
     this.eventSubscriber = new ReflectionEventSubscriber(this);
     this.scopes          = new Dictionary <int, IScope>();
 }