Пример #1
0
        private void invokeQuestionContentPartAddedEvent(QuestionContentPart newPart)
        {
            QuestionContentPartAddedDelegate temp = this.QuestionContentPartAddedEvent;

            if (temp != null)
            {
                temp(newPart);
            }
        }
        private void prepareEventHandler()
        {
            this.questionContentPartAddedHandler = (part) =>
            {
                if (part is QuestionBlank)
                {
                    var query = from temp in this.richTextEditor.Parts
                                where temp is QuestionBlank
                                select temp;

                    this.addReferenceAnswerTabItem(string.Format("空{0}", query.Count() + 1), part as QuestionBlank);
                }
            };

            this.questionContentPartRemovedHandler = (part) =>
            {
                if (part is QuestionBlank)
                {
                    this.removeReferenceAnswerTabItem(part as QuestionBlank);
                }
            };
        }