Skip to content

Instantly share code, notes, and snippets.

@kumpera
Created November 2, 2015 22:48
Show Gist options
  • Save kumpera/e9c622f061be757b89dd to your computer and use it in GitHub Desktop.
Save kumpera/e9c622f061be757b89dd to your computer and use it in GitHub Desktop.
using System.Reflection;
using System;
using System.Collections.Generic;
namespace DummyApp {
public class TestClass {
readonly List<string> testClassProperty = new List<string> ();
internal List<string> TestClassProperty {
get {
return testClassProperty;
}
}
}
}
namespace DummyApp {
class MainClass {
public static void Main (string[] args)
{
var obj = new TestClass ();
obj.GetType ().InvokeMember ("TestClassProperty", BindingFlags.NonPublic | BindingFlags.GetProperty, Type.DefaultBinder, obj, null);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment