public static DelegateContract Create <TKey, TData>(IStreamingContract <TKey, TData> contract, string streamingType) { var delegateContract = new DelegateContract(); delegateContract.KeyType = typeof(TKey); delegateContract.ValueType = typeof(TData); delegateContract.StreamingType = streamingType; delegateContract._subscribe = (key, callback) => contract.Subscribe((TKey)key, (IStreamingCallback <TData>)callback); delegateContract._unsubscribe = (key, callback) => contract.Unsubscribe((TKey)key, (IStreamingCallback <TData>)callback); delegateContract._unsubscribeCallback = (callback) => contract.Unsubscribe((IStreamingCallback <TData>)callback); return(delegateContract); }
public NetworkAdapterService(string streamingType, DelegateContract delegateContract) { StreamingType = streamingType; _delegateContract = delegateContract; }