Redigera

Dela via


MediaPermission Constructors

Definition

Initializes a new instance of the MediaPermission class.

Overloads

MediaPermission()

Initializes a new instance of the MediaPermission class.

MediaPermission(MediaPermissionAudio)

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

MediaPermission(MediaPermissionImage)

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

MediaPermission(MediaPermissionVideo)

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

MediaPermission(PermissionState)

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

MediaPermission(MediaPermissionAudio, MediaPermissionVideo, MediaPermissionImage)

Initializes a new instance of the MediaPermission class by specifying the audio, video, and image permission levels.

MediaPermission()

Source:
MediaPermission.cs
Source:
MediaPermission.cs

Initializes a new instance of the MediaPermission class.

public:
 MediaPermission();
public MediaPermission ();
Public Sub New ()

Applies to

MediaPermission(MediaPermissionAudio)

Source:
MediaPermission.cs
Source:
MediaPermission.cs

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

public:
 MediaPermission(System::Security::Permissions::MediaPermissionAudio permissionAudio);
public MediaPermission (System.Security.Permissions.MediaPermissionAudio permissionAudio);
new System.Security.Permissions.MediaPermission : System.Security.Permissions.MediaPermissionAudio -> System.Security.Permissions.MediaPermission
Public Sub New (permissionAudio As MediaPermissionAudio)

Parameters

permissionAudio
MediaPermissionAudio

An enumerated value of MediaPermissionAudio.

Examples

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

MediaPermission mediaPermission = new MediaPermission(MediaPermissionAudio.SiteOfOriginAudio);
Dim mediaPermission As New MediaPermission(MediaPermissionAudio.SiteOfOriginAudio)

Remarks

The default values for image and video permissions are SafeImage and SafeVideo.

Applies to

MediaPermission(MediaPermissionImage)

Source:
MediaPermission.cs
Source:
MediaPermission.cs

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

public:
 MediaPermission(System::Security::Permissions::MediaPermissionImage permissionImage);
public MediaPermission (System.Security.Permissions.MediaPermissionImage permissionImage);
new System.Security.Permissions.MediaPermission : System.Security.Permissions.MediaPermissionImage -> System.Security.Permissions.MediaPermission
Public Sub New (permissionImage As MediaPermissionImage)

Parameters

permissionImage
MediaPermissionImage

An enumerated value of MediaPermissionImage.

Examples

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

MediaPermission mediaPermission = new MediaPermission(MediaPermissionImage.NoImage);
Dim mediaPermission As New MediaPermission(MediaPermissionImage.NoImage)

Remarks

The default values for audio and video permissions are SafeAudio and SafeVideo.

Applies to

MediaPermission(MediaPermissionVideo)

Source:
MediaPermission.cs
Source:
MediaPermission.cs

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

public:
 MediaPermission(System::Security::Permissions::MediaPermissionVideo permissionVideo);
public MediaPermission (System.Security.Permissions.MediaPermissionVideo permissionVideo);
new System.Security.Permissions.MediaPermission : System.Security.Permissions.MediaPermissionVideo -> System.Security.Permissions.MediaPermission
Public Sub New (permissionVideo As MediaPermissionVideo)

Parameters

permissionVideo
MediaPermissionVideo

An enumerated value of MediaPermissionVideo.

Examples

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

MediaPermission mediaPermission = new MediaPermission(MediaPermissionVideo.AllVideo);
Dim mediaPermission As New MediaPermission(MediaPermissionVideo.AllVideo)

Remarks

The default values for audio and image permissions are SafeAudio and SafeImage.

Applies to

MediaPermission(PermissionState)

Source:
MediaPermission.cs
Source:
MediaPermission.cs

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

public:
 MediaPermission(System::Security::Permissions::PermissionState state);
public MediaPermission (System.Security.Permissions.PermissionState state);
new System.Security.Permissions.MediaPermission : System.Security.Permissions.PermissionState -> System.Security.Permissions.MediaPermission
Public Sub New (state As PermissionState)

Parameters

state
PermissionState

An enumerated value of PermissionState.

Examples

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);
' Provide full access to the resource protected by the permission.
Dim mediaPermission As New MediaPermission(PermissionState.Unrestricted)

Remarks

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.

Applies to

MediaPermission(MediaPermissionAudio, MediaPermissionVideo, MediaPermissionImage)

Source:
MediaPermission.cs
Source:
MediaPermission.cs

Initializes a new instance of the MediaPermission class by specifying the audio, video, and image permission levels.

public:
 MediaPermission(System::Security::Permissions::MediaPermissionAudio permissionAudio, System::Security::Permissions::MediaPermissionVideo permissionVideo, System::Security::Permissions::MediaPermissionImage permissionImage);
public MediaPermission (System.Security.Permissions.MediaPermissionAudio permissionAudio, System.Security.Permissions.MediaPermissionVideo permissionVideo, System.Security.Permissions.MediaPermissionImage permissionImage);
new System.Security.Permissions.MediaPermission : System.Security.Permissions.MediaPermissionAudio * System.Security.Permissions.MediaPermissionVideo * System.Security.Permissions.MediaPermissionImage -> System.Security.Permissions.MediaPermission
Public Sub New (permissionAudio As MediaPermissionAudio, permissionVideo As MediaPermissionVideo, permissionImage As MediaPermissionImage)

Parameters

permissionAudio
MediaPermissionAudio

An enumerated value of MediaPermissionAudio.

permissionVideo
MediaPermissionVideo

An enumerated value of MediaPermissionVideo.

permissionImage
MediaPermissionImage

An enumerated value of MediaPermissionImage.

Examples

The following code example shows how to create a MediaPermission with MediaPermissionAudio, MediaPermissionVideo, and MediaPermissionImage values

// Provide full access to the resource protected by the permission.
MediaPermission mediaPermission = new MediaPermission(
    MediaPermissionAudio.SiteOfOriginAudio,
    MediaPermissionVideo.SiteOfOriginVideo,
    MediaPermissionImage.SiteOfOriginImage);
' Provide full access to the resource protected by the permission.
Dim mediaPermission As New MediaPermission(MediaPermissionAudio.SiteOfOriginAudio, MediaPermissionVideo.SiteOfOriginVideo, MediaPermissionImage.SiteOfOriginImage)

Applies to