public static ServiceLiveClient Subscribe(MainViewModel mainViewModel) { ServiceLiveClient serviceLive = null; try { System.ServiceModel.InstanceContext context = new System.ServiceModel.InstanceContext(new ServiceLiveCallbackHandler(mainViewModel)); serviceLive = new ServiceLiveClient(context); serviceLive.Subscribe(); } catch (Exception) { } return serviceLive; }
public static void Subscribe(ObservableCollection<KeyValuePair<DateTime, double>> heartQueue, ObservableCollection<KeyValuePair<DateTime, double>> tempQueue) { try { _callBack = new InstanceContext(new CallbackHandler(heartQueue, tempQueue)); _serviceLive = new ServiceLiveClient(_callBack); _serviceLive.Subscribe(); } catch (Exception) { _callBack = null; _serviceLive = null; } }
public ServiceLiveManager(IServiceLiveCallback i) { this._ic = new InstanceContext(i); this._client = new ServiceLiveClient(this._ic); }