3 Replies Latest reply on Mar 29, 2017 10:28 PM by Rick Davin

    AFEventSource and Datareference

    I.Berry

      Per this excellent reference :Implementing the AF Data Pipe in a Custom Data Reference

       

      These are the high level steps to implement a datareference that supportes the Event Pipe

      • Implement AFEventSource with AddSignup, RemoveSignup, GetEvents() and Dispose(bool).
      • Add a static method, CreateDataPipe, in your implementation of AFDataReference to return an AFEventSource object that you have implemented

       

      I have followed this guide quite closely, but have noticed that the AFEventSource.GetEvents() that I have implemented does not seem to be used, it is using only the base class GetEvents(). This can be pretty misleading because the eventpipe seems to work as soon as you add AFDataMethods.DataPipe to the supported data methods, but it is not using the new implementation.

       

      I have not found that by adding this method to my DataReference:

       

              public static object CreateDataPipe()

              {

                  MatlabEventSource pipe = new MatlabEventSource();

                  return pipe;

              }

       

      That the MatlabEventSource class will be used to respond to GetEvents. The MatlabEventSource I have implemented does overide the GetEvents() method:

       

      class MatlabEventSource : AFEventSource

          {

                 protected override bool GetEvents()

                 {

                          ...

                 }

           }

       

      Attached are the two source files, any help much appreciated!

       

      Regards,

      Ivan