/// <summary> /// Creates a new <c>SamBaseEventHandler</c> instance and registers /// overridable handler methods for all events generated by the given /// <see cref="SamReader">SamReader</see>. /// </summary> public SamBaseEventHandler(SamReader samReader) { _samReader = samReader; _samReader.DestReplyReceived += new DestReplyReceivedHandler(OnDestReplyReceived); _samReader.HelloReplyReceived += new HelloReplyReceivedHandler(OnHelloReplyReceived); _samReader.NamingReplyReceived += new NamingReplyReceivedHandler(OnNamingReplyReceived); _samReader.SessionStatusReceived += new SessionStatusReceivedHandler(OnSessionStatusReceived); _samReader.StreamClosedReceived += new StreamClosedReceivedHandler(OnStreamClosedReceived); _samReader.StreamConnectedReceived += new StreamConnectedReceivedHandler(OnStreamConnectedReceived); _samReader.StreamDataReceived += new StreamDataReceivedHandler(OnStreamDataReceived); _samReader.StreamStatusReceived += new StreamStatusReceivedHandler(OnStreamStatusReceived); _samReader.UnknownMessageReceived += new UnknownMessageReceivedHandler(OnUnknownMessageReceived); }