[MonoDevelop] Add File question

Michael Hutchinson m.j.hutchinson at gmail.com
Sat Jun 14 14:07:39 EDT 2008


On Thu, Jun 12, 2008 at 12:24 PM, Ken Weinert <mc at quarter-flash.com> wrote:
> Is there a facility I've not seen?
>
> It would be incredibly handy for the Add File dialog to have the
> option to add a file that implements an interface.
>
> If you chose this option then you'd get a list of interfaces and be
> able to check what you're implementing and then, when the file is
> created, use a template (or reflection) to put in method stubs, all of
> which would throw the NotImplementedException in order to ensure that
> the methods actually get implemented.
>
> Or, perhaps, there is a different method to do this already and I've
> just not found it.

It's in the context menu for a class's identifier.

e.g.

class Foo : IBah
{
}

Right-click on Foo, select Class Foo -> implement Interface -> IBlah

(IIRC; it's similar to that, anyway)

Also, all overrideable methods should come up in code completion for
the "override" keyword. This too generates stubs.

>
> If it doesn't exist already, would this be handled by an add-in or by
> expanding the existing code?

It's implemented in the Refactory in the MonoDevelop.Ide addin. This
specifies an refactorer inferface with small refactoring operations
that language bindings can implement, and then offers cmposite
refactoring  features made up of these, e.g. "implement interface" is
implemented on top of the "add member" feature.

> As you can tell, I don't know a lot about the internals of
> MonoDevelop, but I'd be willing to take a look at doing it if that
> turns out to be necessary.
>
> Of course, if I'm the only one with this itch then it might not be
> worth scratching.

As you can see, it has already been scratched (to some extent).

However, in the past there has been talk of implementing a  "new class
wizard". Doing this right could get quite complicated; see the mailing
list archives for the discussions. If you're interrested in this,
please resurrect the relevant discussions.

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Monodevelop-list mailing list