MediaPermission.MediaPermission(PermissionState) Constructor

Initializes a new instance of the MediaPermission class by specifying a permission state.

Namespace: System.Security.Permissions
Assembly: WindowsBase (in windowsbase.dll)

public MediaPermission (
	PermissionState state
)
public MediaPermission (
	PermissionState state
)
public function MediaPermission (
	state : PermissionState
)
You cannot use constructors in XAML.

Parameters

state

An enumerated value of PermissionState.

If state is set to Unrestricted, all media types are granted full permission to play or display with no restrictions. If state is set to None, all media types are restricted from playing or displaying.

The following code example shows how to create a MediaPermission with a PermissionState value.

// Provide full access to the resource protected by the permission.
MediaPermission mediaPermission = new MediaPermission(PermissionState.Unrestricted);

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show: