本文整理汇总了VB.NET中System.Security.ISecurityEncodable.FromXml方法的典型用法代码示例。如果您正苦于以下问题:VB.NET ISecurityEncodable.FromXml方法的具体用法?VB.NET ISecurityEncodable.FromXml怎么用?VB.NET ISecurityEncodable.FromXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.ISecurityEncodable
的用法示例。
在下文中一共展示了ISecurityEncodable.FromXml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: FromXml
' Populate the permission's fields from XML.
Public Overrides Sub FromXml(ByVal e As SecurityElement)
m_specifiedAsUnrestricted = False
m_flags = 0
' If XML indicates an unrestricted permission, make this permission unrestricted.
Dim s As String = CStr(e.Attributes("Unrestricted"))
If Not (s Is Nothing) Then
m_specifiedAsUnrestricted = Convert.ToBoolean(s)
If m_specifiedAsUnrestricted Then
m_flags = SoundPermissionState.PlayAnySound
End If
End If
' If XML indicates a restricted permission, parse the flags.
If Not m_specifiedAsUnrestricted Then
s = CStr(e.Attributes("Flags"))
If Not (s Is Nothing) Then
m_flags = CType(Convert.ToInt32([Enum].Parse(GetType(SoundPermission), s, True)), SoundPermissionState)
End If
End If
End Sub