F Francisco K. do Amaral Sep 23, 2003 #1 Hi, How can I make a method visible only for classes from the same namespace?? thanks
M Michael Lang Sep 23, 2003 #2 How can I make a method visible only for classes from the same namespace?? Click to expand... You can't. But you can make your classes and/or members only visible within the same assembly (dll) with the "internal" keyword (C#). You can also limit visibility to itself and all derived classes using the "protected" keyword (C#).
How can I make a method visible only for classes from the same namespace?? Click to expand... You can't. But you can make your classes and/or members only visible within the same assembly (dll) with the "internal" keyword (C#). You can also limit visibility to itself and all derived classes using the "protected" keyword (C#).
J Jon Skeet Sep 23, 2003 #3 Francisco K. do Amaral said: How can I make a method visible only for classes from the same namespace?? Click to expand... You can't, I'm afraid. Namespaces don't have any effect on accessibility.
Francisco K. do Amaral said: How can I make a method visible only for classes from the same namespace?? Click to expand... You can't, I'm afraid. Namespaces don't have any effect on accessibility.
J Jason Smith Sep 24, 2003 #4 What you CAN do is look at the call stack, see who is calling you, and throw an exception if not from the correct namespace. Not pretty, not elegant, but if you have to do it, you have to do it.
What you CAN do is look at the call stack, see who is calling you, and throw an exception if not from the correct namespace. Not pretty, not elegant, but if you have to do it, you have to do it.