Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to intercept drop operation of Code elements (methods) from SolutionExplorer onto Text Editor

$
0
0

Hi

I'd like to write an extension such that if the user drags one or more methods/properties from Solution Explorer and drops them onto the Text Editor; I give them the option to generate some code. For example; if we had a class Customer with properties Name and Age, and the VS user drags "Age" from the Solution Explorer, I could search for an appropriate variable near the drop location and prefix the variablename onto the age.

Ie. the example below:

class MyTest {

  void myFunc() {

    var myCustomer = new Customer();

// drop here

  }

}

The user finds the Customer class in SE, and drags age and drops it as indicated.

The plugin identifies a local variable "myCustomer" and insert the code "myCustomer.Age" instead of the huge XML document currently dropped.

I have implemented IDropHandlerProvider but cannot get it to intercept this particular drop operation. Can you advise?


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>