Beispiel #1
0
        void automation_EditContent(object sender, AnnEditContentEventArgs e)
        {
            AnnObject annObject = e.TargetObject;

            if (annObject == null || !annObject.SupportsContent || annObject is AnnSelectionObject)
            {
                return;
            }

            if (sender is AnnDrawDesigner && annObject.Id != AnnObject.StickyNoteObjectId)
            {
                return;
            }

            using (var dlg = new AutomationUpdateObjectDialog())
            {
                dlg.Automation = this.Automation;
                dlg.SetPageVisible(AutomationUpdateObjectDialogPage.Properties, false);
                dlg.SetPageVisible(AutomationUpdateObjectDialogPage.Reviews, false);
                dlg.TargetObject = annObject;

                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    Automation.InvalidateObject(annObject);
                }
            }
        }
Beispiel #2
0
        private void automation_EditContent(object sender, AnnEditContentEventArgs e)
        {
            var automation = _documentViewer.Annotations.Automation;

            if (automation == null)
            {
                return;
            }

            e.Cancel = true;

            RemoveAutomationTextBox(true);

            AnnObject targetObject = e.TargetObject;

            if (targetObject == null)
            {
                return;
            }

            // if text object, we cannot do that. Ignore, the EditText will fire
            var textObject = targetObject as AnnTextObject;

            if (textObject != null)
            {
                return;
            }

            if (sender is AnnDrawDesigner && targetObject.Id != AnnObject.StickyNoteObjectId)
            {
                return;
            }

            using (var dlg = new AutomationUpdateObjectDialog())
            {
                dlg.SetPageVisible(AutomationUpdateObjectDialogPage.Properties, false);
                dlg.SetPageVisible(AutomationUpdateObjectDialogPage.Reviews, false);
                dlg.TargetObject = targetObject;

                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    e.Cancel = false;
                    automation.InvalidateObject(targetObject);
                }
            }
        }