Capture paste command when copying from the plugin feature layer .net sdk

02-02-2023 12:10 AM
New Contributor II


I am working on the plugin data sources to add the feature layers. These feature layers are not editable by default. So when I am trying to copy and paste it to the same layer I am getting an error that

"No editable layers". I have attached the error in the attachment as well. 

Now I want to capture the paste event and modify the above error message with my own and rest of the copy paste functionality should work as it is.

Any help for this or is this possible??

One more question in the copy paste functionality it will only paste to the same layer by default or it will find any editable feature and paste there?


@GKmieliauskas @Wolf @UmaHarano 

0 Kudos
1 Reply
by Esri Regular Contributor
Esri Regular Contributor

You could try to implement a 'custom' paste handler in your module class by overriding both CanPasteAsync and PasteAsync CanPasteAsync Method (Module)—ArcGIS Pro

I think you would have to look at the content of the clipboard to find out if the clipboard data applies to your use case.  You would need to return true on CanPasteAsync and then popup you own error message in PasteAsync.  I attached a sample (released with 3.1) of a custom paste implementation. 

To make sure that your custom clipboard handler gets called regardless of any user interaction you need to set the Module's autoLoad setting to true in the config.daml file:

<insertModule .... autoLoad="true" ...


0 Kudos