Telerik® JustMock™ by Progress

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.

Namespace: Telerik.JustMock
Assembly: Telerik.JustMock (in Telerik.JustMock.dll) Version: 2013.3.1021.0 (2013.3.1021.0)

Syntax

C#
public sealed class PrivateAccessor : IDynamicMetaObjectProvider
Visual Basic
Public NotInheritable Class PrivateAccessor _
	Implements IDynamicMetaObjectProvider

Remarks

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.

Inheritance Hierarchy

System..::..Object
  Telerik.JustMock..::..PrivateAccessor

See Also