public void OnIncomingAppServiceConnection(IBackgroundTaskInstance taskInstance) { var appService = taskInstance.TriggerDetails as AppServiceTriggerDetails; IAppServiceConnectionEndPoint endPoint = CreateEndPoint(taskInstance, appService); if (endPoint != null) { endPoint.AppServiceConnectionTerminated += OnEndPointTerminated; ConnectionEndPoints.Add(endPoint); } }
private void OnEndPointTerminated(IAppServiceConnectionEndPoint endPoint, AppServiceEndPointTerminationReason reason) { ConnectionEndPoints.Remove(endPoint); endPoint.AppServiceConnectionTerminated -= OnEndPointTerminated; }