コード例 #1
0
        public void GetQuestionnaireAsync(Action <IOperationResult <Questionnaire> > callback)
        {
            IAsyncResult asyncResult = this.service.BeginGetQuestionnaire(
                (ar) =>
            {
                OperationResult <Questionnaire> operationResult = new OperationResult <Questionnaire>();
                try
                {
                    operationResult.Result = service.EndGetQuestionnaire(ar);
                }
                catch (Exception ex)
                {
                    operationResult.Error = ex;
                }

                synchronizationContext.Post(
                    (state) =>
                {
                    callback(operationResult);
                },
                    null);
            },
                null);
        }