Ejemplo n.º 1
0
        public bool Execute()
        {
            bool result = false;

            var dialog = new AnnotationDialog(_model, _container, new ReviewNote());

            if (dialog.ShowDialog(Form.ActiveForm) == DialogResult.OK)
            {
                var schemaManager = new AnnotationsPropertySchemaManager(_model);
                schemaManager.AddAnnotation(_container, dialog.Annotation);
                result = true;
            }

            return(result);
        }
Ejemplo n.º 2
0
        public bool Execute()
        {
            var result = false;

            if (_annotation is TopicToBeClarified topicToBeClarified)
            {
                var dialog = new AnnotationDialog(_model, _container, topicToBeClarified, true);
                if (dialog.ShowDialog(Form.ActiveForm) == DialogResult.Abort)
                {
                    var schemaManager = new AnnotationsPropertySchemaManager(_model);
                    schemaManager.RemoveAnnotation(_container, topicToBeClarified);
                }

                result = true;
            }
            else if (_annotation is Highlight highlight)
            {
                var dialog = new AnnotationDialog(_model, _container, highlight, true);
                if (dialog.ShowDialog(Form.ActiveForm) == DialogResult.Abort)
                {
                    var schemaManager = new AnnotationsPropertySchemaManager(_model);
                    schemaManager.RemoveAnnotation(_container, highlight);
                }

                result = true;
            }
            else if (_annotation is ReviewNote reviewNote)
            {
                var dialog = new AnnotationDialog(_model, _container, reviewNote, true);
                if (dialog.ShowDialog(Form.ActiveForm) == DialogResult.Abort)
                {
                    var schemaManager = new AnnotationsPropertySchemaManager(_model);
                    schemaManager.RemoveAnnotation(_container, reviewNote);
                }

                result = true;
            }

            return(result);
        }