Does Visual Studio 2010 support something like Eclipse's "Generate delegate methods"?

Posted by devoured elysium on Stack Overflow See other posts from Stack Overflow or by devoured elysium
Published on 2010-04-20T22:49:50Z Indexed on 2010/04/20 22:53 UTC
Read the original article Hit count: 177

Eclipse allows us to define a class as:

interface MyInterface {
    void methodA();
    int methodB();
}

class A : MyInterface {
    MyInterface myInterface;
}

and then with this "Generate delegate methods", it will implement all needed methods for the interface, redirecting their logic to myInterface's methods:

class A : MyInterface {
    MyInterface myInterface;

    public void methodA() {
        myInterface.methodA();
    }

    public int methodB() {
        return myInterface.methodB();
    }
}

Is it possible to accomplish the same with VS2010? And with R#?

Thanks

© Stack Overflow or respective owner

Related posts about visual-studio

Related posts about visual-studio-2010