Gives access to the non-public members of a type or instance. This class provides functionality similar to the one that exists in regular reflection classes with the added benefit that it can bypass essential security checks related to accessing non-public members through reflection.
Assembly: Telerik.JustMock(in Telerik.JustMock.dll)
public sealed class PrivateAccessor : IDynamicMetaObjectProvider
Public NotInheritable Class PrivateAccessor _ Implements IDynamicMetaObjectProvider
When the profiler is enabled, PrivateAccessor acquires additional power: - It can even be used to access all kinds of non-public members in Silverlight (and when running in partial trust in general). - All calls made through PrivateAccessor are always made with full trust (unrestricted) permissions. You can assign a PrivateAccessor to a dynamic variable and access it as if you're referencing the original object: dynamic acc = new PrivateAccessor(myobj); acc.PrivateProperty = acc.PrivateMethod(123); // PrivateProperty and PrivateMethod are private members on myobj's type.