ApplicationCommands.Cut/Paste not disabled when ReadOnly

SyntaxEditor for WPF Forum

Posted 15 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Platform: .NET 3.0
NOTE: Please add 'Windows 7' to the operating system list when reporting a bug

This is very trivial at this point, but thought I'd go ahead and log it. I noticed that SE appears to properly register and respond to the various clipboard commands (i.e ApplicationCommands.Copy, ApplicationCommands.Cut, ApplicationCommands.Paste). I noticed that with a read-only document, the cut/paste commands are still enabled. Not sure if you've even done anything to control the 'CanExecute' behavior of those commands yet, but thought I'd point out that they are enabled on a read-only document when those operations are not possible.

Along those lines, IEditorView probably needs some properties like 'CanCut', 'CanCopy', 'CanPaste' that can be used to help determine when those commands are available. I don't think those were ever available in SE4.

Comments (2)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Ok we'll add the IsReadOnly check for the document to the can execute handlers of those commands. However if read-only ranges are used, we won't be checking those until actual execution time. The reason is that if there is a large block selection and there are a number of read-only regions in place, that particular check could be time consuming and therefore random command CanExecute polling could slow down your application.

We'll mark down to add CanCopy, etc. There are some equivalent methods in SE4 already.

Actipro Software Support

Posted 15 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Sounds perfect, and I completely agree about the read-only regions.
The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.