コード例 #1
0
        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);
            }
        }
コード例 #2
0
 private void OnEndPointTerminated(IAppServiceConnectionEndPoint endPoint, AppServiceEndPointTerminationReason reason)
 {
     ConnectionEndPoints.Remove(endPoint);
     endPoint.AppServiceConnectionTerminated -= OnEndPointTerminated;
 }