Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# get private property

PropertyInfo prop =
    typeof(Foo).GetProperty("FooBar", BindingFlags.NonPublic | BindingFlags.Instance);

MethodInfo getter = prop.GetGetMethod(nonPublic: true);
object bar = getter.Invoke(f, null);
Comment

c# get private property

PropertyInfo strProperty = 
    bar.GetType().GetProperty("Str", BindingFlags.NonPublic | BindingFlags.Instance);

MethodInfo strGetter = strProperty.GetGetMethod(nonPublic: true);

string val = (string)strGetter.Invoke(bar, null);
Comment

PREVIOUS NEXT
Code Example
Csharp :: display image script unity 
Csharp :: list add value position c# 
Csharp :: subtract to time c# 
Csharp :: oncollisionenter2d 
Csharp :: gql query with parameters 
Csharp :: unity normalize 
Csharp :: unity how to check index of enum 
Csharp :: c# string length 
Csharp :: unity GetNestedComponentsInChildren 
Csharp :: list cast< c# 
Csharp :: int if null put zero c# 
Csharp :: C# Convert xml to datatable 
Csharp :: catch multiple exception c# 
Csharp :: c# sc create service 
Csharp :: excel rows count 
Csharp :: Triangle perimeter 
Csharp :: list contains type c# 
Csharp :: one line condition c# 
Csharp :: logical operators in c# 
Csharp :: read system data dataset 
Csharp :: dotnet core clickable row 
Csharp :: unity show scene 
Csharp :: function to accept interger 
Csharp :: c# delay 1 second 
Csharp :: sdl quit event not working multiple windows 
Csharp :: save string to file c# 
Csharp :: asp.net list size 
Csharp :: to string c# fields 
Csharp :: how to make dissapear an object in unity 
Csharp :: asp net identity extend relationship 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =