How to create a live template for event firing?

Hi All

I normally use a private method to fire my events. Something like this:


And now I want to create a live template to create this method for me but I'm having some trouble with the template. So far I have:


Where the $EXPR$ should give me the possibility to get a code complete window with all my events. I just can't seem to select the correct macro to do this. Can somebody give me some hints which macro might work??

Regards Patrick

3 comments
Comment actions Permalink

Patrick,

Currently, there seems to be no appropriate macro for your case. In the version
2.0 we plan to add some which will suit your needs. Also there will be Open
API which will allow you to add your own macros.

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi All

I normally use a private method to fire my events. Something like
this:

 
> private void FireOnChange()
> {
> EventHandler localEvent = OnChange;
> if (localEvent != null)
> {
> localEvent(this, new EventArgs());
> }
> }]]>

And now I want to create a live template to create this method for me
but I'm having some trouble with the template. So far I have:

 private void Fire$EXPR$()
> {
> EventHandler localEvent = $EXPR$;
> if (localEvent != null)
> {
> localEvent(this, new EventArgs());
> }
> }]]>

Where the $EXPR$ should give me the possibility to get a code complete
window with all my events. I just can't seem to select the correct
macro to do this. Can somebody give me some hints which macro might
work??

Regards Patrick




0
Comment actions Permalink

Hi

Well thanks for the answer. I kinda guessed something like that. I guess I'll just have to type the event name for now. Even without the feature I asked for the templating system makes it a whole lot easier ;)

Regards

Patrick

0
Comment actions Permalink

I earlier asked for a macro that would allow me to state a base class type
to do code completion on ... for example, I know the variable will end up
being a type name rooted at some specific base type, and I want to make it
easy to enter said type... any chance of that being in 2.0?


"Valentin Kipiatkov (JetBrains)" <valentin@jetbrains.com> wrote in message
news:473785632495164203870877@news.intellij.net...

Patrick,

>

Currently, there seems to be no appropriate macro for your case. In the
version 2.0 we plan to add some which will suit your needs. Also there
will be Open API which will allow you to add your own macros.

>

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>
>> Hi All
>>
>> I normally use a private method to fire my events. Something like
>> this:
>>
>>

>
>> private void FireOnChange()
>> {
>> EventHandler localEvent = OnChange;
>> if (localEvent != null)
>> {
>> localEvent(this, new EventArgs());
>> }
>> }]]>

>> And now I want to create a live template to create this method for me
>> but I'm having some trouble with the template. So far I have:
>>

> private void Fire$EXPR$()
>> {
>> EventHandler localEvent = $EXPR$;
>> if (localEvent != null)
>> {
>> localEvent(this, new EventArgs());
>> }
>> }]]>

>> Where the $EXPR$ should give me the possibility to get a code complete
>> window with all my events. I just can't seem to select the correct
>> macro to do this. Can somebody give me some hints which macro might
>> work??
>>
>> Regards Patrick
>>
>
>



0

Please sign in to leave a comment.