Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public override SecurityElement ToXml()
{
// These first three lines create an element with the required format.
SecurityElement e = new SecurityElement("IPermission");
// Replace the double quotation marks (“”) with single quotation marks (‘’)
// Replace the double quotation marks ("") with single quotation marks ('')
// to remain XML compliant when the culture is not neutral.
e.AddAttribute("class", GetType().AssemblyQualifiedName.Replace('\"', '\''));
e.AddAttribute("version", "1");
Expand Down Expand Up @@ -206,4 +206,4 @@ public Boolean IsUnrestricted()

#endregion
}
//</snippet1>
//</snippet1>
24 changes: 12 additions & 12 deletions snippets/visualbasic/VS_Snippets_CLR/Permission/vb/permission.vb
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ NotInheritable Public Class SoundPermission
Private m_specifiedAsUnrestricted As [Boolean] = False
Private m_flags As SoundPermissionState = SoundPermissionState.NoSound
' This constructor creates and initializes a permission with generic access.
Public Sub New(ByVal state As PermissionState)
Public Sub New(ByVal state As PermissionState)
m_specifiedAsUnrestricted = state = PermissionState.Unrestricted

End Sub
' This constructor creates and initializes a permission with specific access.
Public Sub New(ByVal flags As SoundPermissionState)
' This constructor creates and initializes a permission with specific access.
Public Sub New(ByVal flags As SoundPermissionState)
If Not [Enum].IsDefined(GetType(SoundPermissionState), flags) Then
Throw New ArgumentException("flags value is not valid for the SoundPermissionState enuemrated type")
End If
m_specifiedAsUnrestricted = False
m_flags = flags

End Sub
' For debugging, return the state of this object as XML.
Public Overrides Function ToString() As String
Public Overrides Function ToString() As String
Return ToXml().ToString()
End Function 'ToString

End Function 'ToString
' Private method to cast (if possible) an IPermission to the type.
Private Function VerifyTypeMatch(ByVal target As IPermission) As SoundPermission
If [GetType]() <> target.GetType() Then
Expand All @@ -53,7 +53,7 @@ NotInheritable Public Class SoundPermission
Return CType(target, SoundPermission)

End Function 'VerifyTypeMatch
' This is the Private Clone helper method.
' This is the Private Clone helper method.
Private Function Clone(ByVal specifiedAsUnrestricted As [Boolean], ByVal flags As SoundPermissionState) As SoundPermission
Dim soundPerm As SoundPermission = CType(Clone(), SoundPermission)
soundPerm.m_specifiedAsUnrestricted = specifiedAsUnrestricted
Expand Down Expand Up @@ -169,7 +169,7 @@ NotInheritable Public Class SoundPermission
Public Overrides Function ToXml() As SecurityElement
' These first three lines create an element with the required format.
Dim e As New SecurityElement("IPermission")
' Replace the double quotation marks ("") with single quotation marks (‘’)
' Replace the double quotation marks ("") with single quotation marks ('')
' to remain XML compliant when the culture is not neutral.
e.AddAttribute("class", [GetType]().AssemblyQualifiedName.Replace(ControlChars.Quote, "'"c))
e.AddAttribute("version", "1")
Expand Down Expand Up @@ -200,8 +200,8 @@ NotInheritable Public Class SoundPermission
Public Function Clone() As [Object] Implements System.ICloneable.Clone
Return MemberwiseClone()

End Function 'Clone
End Function 'Clone
#End Region

End Class
'</snippet1>
'</snippet1>
8 changes: 4 additions & 4 deletions xml/System.Xaml.Schema/XamlTypeName.xml
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@

```
NestedTypeName = Name | Name '+' NestedTypeName
TypeName = NestedTypeName | NestedTypeName ‘[]’
XamlTypeName = Prefix ‘:’ TypeName TypeArgs | TypeName TypeArgs
TypeArgs = empty | ‘(‘ XamlTypeNameList ‘)’
TypeName = NestedTypeName | NestedTypeName '[]'
XamlTypeName = Prefix ':' TypeName TypeArgs | TypeName TypeArgs
TypeArgs = empty | '(' XamlTypeNameList ')'
XamlTypeNameList = XamlTypeName XamlTypeNameList1
XamlTypeNameList1 = empty | ‘,’ XamlTypeNameList
XamlTypeNameList1 = empty | ',' XamlTypeNameList
```

]]></format>
Expand Down