I would like to say that I think the strategy you are pursuing here is not good OO design. If you want to publish access to a method in a Class, why not, as others commented, make it public in the first place ?
If it's the case that you don't have access to the source code in which the method is defined, then I think Mehdi's solution via reflection is the only way you can proceed.
But, in this case, I do believe you have access to the source based on your example.
If you want to return a method, in .NET 3.5 or later, you can use Action<t> for a method that has no return value, or Func<t> for a method that does have return. See the MSDN docs to understand that the number of specified parameter types to Action and Func can vary (the overloads).
Here's how that might work in your case:
public class RevealprivateMethod
{
private int addTwo(int i, int j)
{
return (i + j);
}
public Func<int, int, int> accessAddTwo
{
get { return addTwo; }
}
}
To use the method in 'RevealPrivateMethod from outside the class, for example:
RevealprivateMethod rpmInstance = new RevealprivateMethod();
int result = rpmInstance.accessAddTwo(5, 8);