c# - Method Within A Method -
i creating c# library reusable code , trying create method inside method. have method this:
public static void method1() { // code }
what this:
public static void method1() { public static void method2() { } public static void method3() { } }
then choose either method1.method2
or method1.method3
. compiler isn't happy this, appreciated. thanks.
no, can't that. could create nested class:
public class containingclass { public static class nestedclass { public static void method2() { } public static void method3() { } } }
you'd call:
containingclass.nestedclass.method2();
or
containingclass.nestedclass.method3();
i wouldn't recommend though. usually it's bad idea have public nested types.
can tell more you're trying achieve? there may better approach.
Comments
Post a Comment