Ejemplo n.º 1
0
        public void SubmitQuestionnaireAsync(Questionnaire questionnaire, Action<IOperationResult> callback)
        {
            this.service.BeginSubmitQuestionnaire(
                questionnaire,
                (ar) =>
                {
                    var operationResult = new OperationResult();

                    try
                    {
                        this.service.EndSubmitQuestionnaire(ar);
                    }
                    catch (Exception ex)
                    {
                        operationResult.Error = ex;
                    }

                    synchronizationContext.Post(
                        (state) =>
                        {
                            callback(operationResult);
                        },
                        null);
                },
                null);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public void GetQuestionnaireTemplateSummaryAsync(QuestionnaireTemplate questionnaireTemplate, Action<IOperationResult<QuestionnaireTemplateSummary>> callback)
        {
            this.service.BeginGetQuestionnaireTemplateSummary(
                questionnaireTemplate,
                (ar) =>
                {
                    var operationResult = new OperationResult<QuestionnaireTemplateSummary>();

                    try
                    {
                        operationResult.Result = this.service.EndGetQuestionnaireTemplateSummary(ar);
                    }
                    catch (Exception ex)
                    {
                        operationResult.Error = ex;
                    }

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