Tidy up blank methods

  • Thread starter Thread starter Alistair George
  • Start date Start date
A

Alistair George

Good morning is there a method using the C# ide to 'clean up' all
methods which have nothing inside them. EG sometimes I make an event
which later I clear out - the project is full of them.
Normally, you can go to properties, events, right click and 'reset' but
that is not what I am looking for. Thanks.
 
Alistair,

Not that I know of. There might be some third party components which
will do this, but I am not aware of any.

You could create a plug in for VS.NET which will examine the method
bodies (the IDE interface has methods to allow you to inspect this) and then
delete them.

You could also look at the compiled assembly and then check for an IL
signature which corresponds to an empy method (reflection would help you
with that). Of course, the caveat here is that you need a compiled
assembly, which you might not be able to obtain (due to compilation errors
in your project which you are working on in the IDE).
 
Hi,

Alistair George said:
Good morning is there a method using the C# ide to 'clean up' all methods
which have nothing inside them. EG sometimes I make an event which later I
clear out - the project is full of them.
Normally, you can go to properties, events, right click and 'reset' but
that is not what I am looking for. Thanks.

Not that I know of. Really sometimes I do the same but they are not that
many as to require a tool to get rid of them.
 
Ignacio said:
Hi,



Not that I know of. Really sometimes I do the same but they are not that
many as to require a tool to get rid of them.
Thanks for info. I'm quite new to C# and some things I like, but some
other things I dont. EG there are many long winded processes which are
just not necessary in other ide such as menu items; C# you have to right
click then properties, events to define an event for that menu item. In
other IDE you just double click the item, and it starts a new event
ready for your code. Lots of expeditious things like that which you
would think that MS would have sorted by 2007.
Al.
 
Hi,

Alistair George said:
Thanks for info. I'm quite new to C# and some things I like, but some
other things I dont. EG there are many long winded processes which are
just not necessary in other ide such as menu items;

I did not understand what you said, could you explain further?

C# you have to right
click then properties, events to define an event for that menu item. In
other IDE you just double click the item, and it starts a new event ready
for your code. Lots of expeditious things like that which you would think
that MS would have sorted by 2007.
Al.

VS does the same, each control has a default event, if you double click it
in the designer you will get a stub ready.

I think that you need to explore further the IDE.
 
Ignacio Machin ( .NET/ C# MVP ) said:
Hi,



I did not understand what you said, could you explain further?

C# you have to right

VS does the same, each control has a default event, if you double click it
in the designer you will get a stub ready.

I think that you need to explore further the IDE.

Also in the properties editor, it has its own toolbar where you can select
between properties and events. If you list the events, then you can
immediately create the handler for any event, not just the default one.

Looking again I think this is what you already know about. So why not leave
the event list open, which saves you the right click+properties?
 
C# you have to right

VS does the same, each control has a default event, if you double click it
in the designer you will get a stub ready.

I think that you need to explore further the IDE.


Most likely sometimes it works but yesterday it was not doing it for me
hence the above comments.
Today it is working so perhaps my IDE is playing up. I have spoken to
another who has same C# as me, and his crashes (C# aborts) when we try
to cut a menu item so thats an issue that we have to put up with.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top