Re: changing methods access modifires in runtime?




Ehsan Khoddam mohammadi wrote:
Hi, Is it possible to change an access modifire on runtime?
consider this example:

public Class Test {
Test (boolean isPublic,...){
....
if (!isPublic)
//changing someMethod() to public
}
private void someMethod(){
....
}
....

}



thanx

Not without class instrumentation, and I doubt you *really* want to do
this anyway...
What is the underlying problem you are trying to solve? There are
probable many ways to do what you want.

.



Relevant Pages

  • Re: Can’t copy to clipboard
    ... > at System.Windows.Forms.Clipboard.SetDataObject(Object data, Boolean copy) ... Dennis ... private void btnCopyAddress_Click ...
    (microsoft.public.dotnet.framework)
  • changing methods access modifires in runtime?
    ... Is it possible to change an access modifire on runtime? ... public Class Test { ... Test (boolean isPublic,...){ ... //changing someMethod() to public ...
    (comp.lang.java.programmer)
  • Re: Try...Catch across assemblies
    ... you will get a messagebox showing the error when run from ... The bad news is I don't entirely understand it. ... public class Test: Form ... private void LoadEventHandler ...
    (microsoft.public.dotnet.framework)
  • Unhandled Exceptions outside of VS
    ... Some of us on the .net framework were working on an issue that I've ... generate an unhandled exception. ... public class Test: Form ... private void LoadEventHandler ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Generics: Using a typed class as a key.
    ... T someMethod(Classclazz, T t) { ... works with passing in regular non-generic classes, ...
    (comp.lang.java.programmer)