Ejemplo n.º 1
0
 public void Unsubscribe <T>(DIMSERequestHandler <T> cr) where T : AbstractDIMSERequest
 {
     if (typeof(T) == typeof(CEchoRequest))
     {
         CEchoRequestReceived -= (cr as DIMSERequestHandler <CEchoRequest>);
     }
     if (typeof(T) == typeof(CFindRequest))
     {
         CFindRequestReceived -= (cr as DIMSERequestHandler <CFindRequest>);
     }
     if (typeof(T) == typeof(CMoveRequest))
     {
         CMoveRequestReceived -= (cr as DIMSERequestHandler <CMoveRequest>);
     }
     if (typeof(T) == typeof(CStoreRequest))
     {
         CStoreRequestReceived -= (cr as DIMSERequestHandler <CStoreRequest>);
     }
     if (typeof(T) == typeof(CGetRequest))
     {
         CGetRequestReceived -= (cr as DIMSERequestHandler <CGetRequest>);
     }
     if (typeof(T) == typeof(NActionRequest))
     {
         NActionRequestRecieved -= (cr as DIMSERequestHandler <NActionRequest>);
     }
     if (typeof(T) == typeof(NEventReportRequest))
     {
         NEventReportRequestRecieved -= (cr as DIMSERequestHandler <NEventReportRequest>);
     }
 }
Ejemplo n.º 2
0
 public void Subscribe <T>(DIMSERequestHandler <T> cr) where T : AbstractDIMSERequest
 {
     if (typeof(T) == typeof(CEchoRequest))
     {
         CEchoRequestReceived += (cr as DIMSERequestHandler <CEchoRequest>);
     }
     if (typeof(T) == typeof(CFindRequest))
     {
         CFindRequestReceived += (cr as DIMSERequestHandler <CFindRequest>);
     }
     if (typeof(T) == typeof(CMoveRequest))
     {
         CMoveRequestReceived += (cr as DIMSERequestHandler <CMoveRequest>);
     }
     if (typeof(T) == typeof(CStoreRequest))
     {
         CStoreRequestReceived += (cr as DIMSERequestHandler <CStoreRequest>);
     }
     if (typeof(T) == typeof(CGetRequest))
     {
         CGetRequestReceived += (cr as DIMSERequestHandler <CGetRequest>);
     }
 }