2020-06-30 12:48:39 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
----
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
Type dynClass = Type.GetType("MyInternalClass");
|
|
|
|
// Noncompliant. Using BindingFlags.NonPublic will return non-public members
|
|
|
|
BindingFlags bindingAttr = BindingFlags.NonPublic | BindingFlags.Static;
|
|
|
|
MethodInfo dynMethod = dynClass.GetMethod("mymethod", bindingAttr);
|
|
|
|
object result = dynMethod.Invoke(dynClass, null);
|
|
|
|
----
|
|
|
|
|
|
|
|
include::../see.adoc[]
|
2021-06-02 20:44:38 +02:00
|
|
|
|
|
|
|
ifdef::rspecator-view[]
|
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::comments-and-links.adoc[]
|
|
|
|
endif::rspecator-view[]
|