コード例 #1
0
        public void GetQuestionnaireTemplatesAsync(Action <IOperationResult <IEnumerable <QuestionnaireTemplate> > > callback)
        {
            this.service.BeginGetQuestionnaireTemplates(
                (ar) =>
            {
                OperationResult <IEnumerable <QuestionnaireTemplate> > operationResult = new OperationResult <IEnumerable <QuestionnaireTemplate> >();
                try
                {
                    operationResult.Result = service.EndGetQuestionnaireTemplates(ar);
                }
                catch (Exception ex)
                {
                    operationResult.Error = ex;
                }

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