public void Unsubscribe <T>(DIMSEResponseHandler <T> cr) where T : AbstractDIMSEResponse
 {
     if (typeof(T) == typeof(CEchoResponse))
     {
         CEchoResponseReceived -= (cr as DIMSEResponseHandler <CEchoResponse>);
     }
     if (typeof(T) == typeof(CFindResponse))
     {
         CFindResponseReceived -= (cr as DIMSEResponseHandler <CFindResponse>);
     }
     if (typeof(T) == typeof(CMoveResponse))
     {
         CMoveResponseReceived -= (cr as DIMSEResponseHandler <CMoveResponse>);
     }
     if (typeof(T) == typeof(CStoreResponse))
     {
         CStoreResponseReceived -= (cr as DIMSEResponseHandler <CStoreResponse>);
     }
     if (typeof(T) == typeof(CGetResponse))
     {
         CGetResponseReceived -= (cr as DIMSEResponseHandler <CGetResponse>);
     }
     if (typeof(T) == typeof(NActionResponse))
     {
         NActionResponseReceived -= (cr as DIMSEResponseHandler <NActionResponse>);
     }
     if (typeof(T) == typeof(NEventReportResponse))
     {
         NEventReportResponseReceived -= (cr as DIMSEResponseHandler <NEventReportResponse>);
     }
 }
Exemple #2
0
 public void Subscribe <T>(DIMSEResponseHandler <T> cr) where T : AbstractDIMSEResponse
 {
     if (typeof(T) == typeof(CEchoResponse))
     {
         CEchoResponseReceived += (cr as DIMSEResponseHandler <CEchoResponse>);
     }
     if (typeof(T) == typeof(CFindResponse))
     {
         CFindResponseReceived += (cr as DIMSEResponseHandler <CFindResponse>);
     }
     if (typeof(T) == typeof(CMoveResponse))
     {
         CMoveResponseReceived += (cr as DIMSEResponseHandler <CMoveResponse>);
     }
     if (typeof(T) == typeof(CStoreResponse))
     {
         CStoreResponseReceived += (cr as DIMSEResponseHandler <CStoreResponse>);
     }
     if (typeof(T) == typeof(CGetResponse))
     {
         CGetResponseReceived += (cr as DIMSEResponseHandler <CGetResponse>);
     }
 }