MediaPermission 构造函数

定义

初始化 MediaPermission 类的新实例。

重载

MediaPermission()

初始化 MediaPermission 类的新实例。

MediaPermission(MediaPermissionAudio)

通过指定音频权限级别,初始化 MediaPermission 类的新实例。

MediaPermission(MediaPermissionImage)

通过指定一个图像权限级别,初始化 MediaPermission 类的一个新实例。

MediaPermission(MediaPermissionVideo)

通过指定视频权限级别,初始化 MediaPermission 类的一个新实例。

MediaPermission(PermissionState)

通过指定一个权限状态,初始化 MediaPermission 类的一个新实例。

MediaPermission(MediaPermissionAudio, MediaPermissionVideo, MediaPermissionImage)

通过指定音频、视频和图像权限级别,初始化 MediaPermission 类的新实例。

MediaPermission()

Source:
MediaPermission.cs
Source:
MediaPermission.cs
Source:
MediaPermission.cs
Source:
MediaPermission.cs

初始化 MediaPermission 类的新实例。

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

适用于

MediaPermission(MediaPermissionAudio)

Source:
MediaPermission.cs
Source:
MediaPermission.cs
Source:
MediaPermission.cs
Source:
MediaPermission.cs

通过指定音频权限级别,初始化 MediaPermission 类的新实例。

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)

参数

permissionAudio
MediaPermissionAudio

MediaPermissionAudio 的枚举值。

示例

下面的代码示例演示如何使用 值创建 MediaPermissionMediaPermissionAudio

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

注解

图像和视频权限的默认值为 SafeImageSafeVideo

适用于

MediaPermission(MediaPermissionImage)

Source:
MediaPermission.cs
Source:
MediaPermission.cs
Source:
MediaPermission.cs
Source:
MediaPermission.cs

通过指定一个图像权限级别,初始化 MediaPermission 类的一个新实例。

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)

参数

permissionImage
MediaPermissionImage

MediaPermissionImage 的枚举值。

示例

下面的代码示例演示如何使用 值创建 MediaPermissionMediaPermissionImage

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

注解

音频和视频权限的默认值为 SafeAudioSafeVideo

适用于

MediaPermission(MediaPermissionVideo)

Source:
MediaPermission.cs
Source:
MediaPermission.cs
Source:
MediaPermission.cs
Source:
MediaPermission.cs

通过指定视频权限级别,初始化 MediaPermission 类的一个新实例。

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)

参数

permissionVideo
MediaPermissionVideo

MediaPermissionVideo 的枚举值。

示例

下面的代码示例演示如何使用 值创建 MediaPermissionMediaPermissionVideo

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

注解

音频和图像权限的默认值为 SafeAudioSafeImage

适用于

MediaPermission(PermissionState)

Source:
MediaPermission.cs
Source:
MediaPermission.cs
Source:
MediaPermission.cs
Source:
MediaPermission.cs

通过指定一个权限状态,初始化 MediaPermission 类的一个新实例。

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)

参数

state
PermissionState

PermissionState 的枚举值。

示例

下面的代码示例演示如何使用 值创建 MediaPermissionPermissionState

// 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)

注解

如果 state 设置为 Unrestricted,则向所有媒体类型授予播放或显示的完整权限,不受限制。 如果 state 设置为 None,则限制所有媒体类型播放或显示。

适用于

MediaPermission(MediaPermissionAudio, MediaPermissionVideo, MediaPermissionImage)

Source:
MediaPermission.cs
Source:
MediaPermission.cs
Source:
MediaPermission.cs
Source:
MediaPermission.cs

通过指定音频、视频和图像权限级别,初始化 MediaPermission 类的新实例。

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)

参数

permissionAudio
MediaPermissionAudio

MediaPermissionAudio 的枚举值。

permissionVideo
MediaPermissionVideo

MediaPermissionVideo 的枚举值。

permissionImage
MediaPermissionImage

MediaPermissionImage 的枚举值。

示例

下面的代码示例演示如何使用 、 MediaPermissionVideoMediaPermissionImage 值创建MediaPermissionMediaPermissionAudio

// 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)

适用于