Skip to content

Commit e729e37

Browse files
Update MethodBase docs to new language versions (#4184)
1 parent f8b1b0a commit e729e37

File tree

3 files changed

+10
-17
lines changed
  • samples/snippets
    • csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CS
    • visualbasic/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/VB
  • xml/System.Reflection

3 files changed

+10
-17
lines changed

samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CS/source.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public void m_public() {}
88
internal void m_internal() {}
99
protected void m_protected() {}
1010
protected internal void m_protected_public() {}
11+
private protected void m_private_protected() {}
1112

1213
public static void Main()
1314
{
@@ -42,5 +43,6 @@ m_public True False False False False
4243
m_internal False True False False False
4344
m_protected False False True False False
4445
m_protected_public False False False True False
46+
m_private_protected False False False False True
4547
*/
4648
// </Snippet1>

samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/VB/source.vb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Public class Example
1111
End Sub
1212
Protected Friend Sub m_Protected_Friend()
1313
End Sub
14+
Private Protected Sub m_Private_Protected()
15+
End Sub
1416

1517
Public Shared Sub Main()
1618

@@ -46,5 +48,6 @@ End Class
4648
'm_Friend False True False False False
4749
'm_Protected False False True False False
4850
'm_Protected_Friend False False False True False
51+
'm_Private_Protected False False False False True
4952
' </Snippet1>
5053

xml/System.Reflection/MethodBase.xml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,10 +1260,7 @@
12601260
12611261
## Examples
12621262
The following code example defines methods with varying levels of visibility, and displays the values of their <xref:System.Reflection.MethodBase.IsAssembly%2A>, <xref:System.Reflection.MethodBase.IsFamily%2A>, <xref:System.Reflection.MethodBase.IsFamilyOrAssembly%2A>, and <xref:System.Reflection.MethodBase.IsFamilyAndAssembly%2A> properties.
1263-
1264-
> [!NOTE]
1265-
> The Visual Basic and C# languages cannot define methods with <xref:System.Reflection.MethodAttributes.FamANDAssem?displayProperty=nameWithType> visibility; that access level appears only in the C++ example.
1266-
1263+
12671264
[!code-cpp[Classic MethodBase.IsAssembly Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CPP/source.cpp#1)]
12681265
[!code-csharp[Classic MethodBase.IsAssembly Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CS/source.cs#1)]
12691266
[!code-vb[Classic MethodBase.IsAssembly Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/VB/source.vb#1)]
@@ -1423,10 +1420,7 @@
14231420
14241421
## Examples
14251422
The following code example defines methods with varying levels of visibility, and displays the values of their <xref:System.Reflection.MethodBase.IsAssembly%2A>, <xref:System.Reflection.MethodBase.IsFamily%2A>, <xref:System.Reflection.MethodBase.IsFamilyOrAssembly%2A>, and <xref:System.Reflection.MethodBase.IsFamilyAndAssembly%2A> properties.
1426-
1427-
> [!NOTE]
1428-
> The Visual Basic and C# languages cannot define methods with <xref:System.Reflection.MethodAttributes.FamANDAssem?displayProperty=nameWithType> visibility; that access level appears only in the C++ example.
1429-
1423+
14301424
[!code-cpp[Classic MethodBase.IsAssembly Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CPP/source.cpp#1)]
14311425
[!code-csharp[Classic MethodBase.IsAssembly Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CS/source.cs#1)]
14321426
[!code-vb[Classic MethodBase.IsAssembly Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/VB/source.vb#1)]
@@ -1486,16 +1480,13 @@
14861480
<format type="text/markdown"><![CDATA[
14871481
14881482
## Remarks
1489-
The visibility of a method or constructor is exactly described by <xref:System.Reflection.MethodAttributes.FamANDAssem?displayProperty=nameWithType> if the visibility modifier is `protected private` in C++. Methods with this visibility cannot be defined in Visual Basic or C#.
1483+
The visibility of a method or constructor is exactly described by <xref:System.Reflection.MethodAttributes.FamANDAssem?displayProperty=nameWithType> if the visibility modifier is `private protected` in C#, `Private Protected` in Visual Basic, or `protected private` in C++.
14901484
14911485
14921486
14931487
## Examples
14941488
The following code example defines methods with varying levels of visibility, and displays the values of their <xref:System.Reflection.MethodBase.IsAssembly%2A>, <xref:System.Reflection.MethodBase.IsFamily%2A>, <xref:System.Reflection.MethodBase.IsFamilyOrAssembly%2A>, and <xref:System.Reflection.MethodBase.IsFamilyAndAssembly%2A> properties.
1495-
1496-
> [!NOTE]
1497-
> The Visual Basic and C# languages cannot define methods with <xref:System.Reflection.MethodAttributes.FamANDAssem?displayProperty=nameWithType> visibility; that access level appears only in the C++ example.
1498-
1489+
14991490
[!code-cpp[Classic MethodBase.IsAssembly Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CPP/source.cpp#1)]
15001491
[!code-csharp[Classic MethodBase.IsAssembly Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CS/source.cs#1)]
15011492
[!code-vb[Classic MethodBase.IsAssembly Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/VB/source.vb#1)]
@@ -1565,10 +1556,7 @@
15651556
15661557
## Examples
15671558
The following code example defines methods with varying levels of visibility, and displays the values of their <xref:System.Reflection.MethodBase.IsAssembly%2A>, <xref:System.Reflection.MethodBase.IsFamily%2A>, <xref:System.Reflection.MethodBase.IsFamilyOrAssembly%2A>, and <xref:System.Reflection.MethodBase.IsFamilyAndAssembly%2A> properties.
1568-
1569-
> [!NOTE]
1570-
> The Visual Basic and C# languages cannot define methods with <xref:System.Reflection.MethodAttributes.FamANDAssem?displayProperty=nameWithType> visibility; that access level appears only in the C++ example.
1571-
1559+
15721560
[!code-cpp[Classic MethodBase.IsAssembly Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CPP/source.cpp#1)]
15731561
[!code-csharp[Classic MethodBase.IsAssembly Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CS/source.cs#1)]
15741562
[!code-vb[Classic MethodBase.IsAssembly Example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/VB/source.vb#1)]

0 commit comments

Comments
 (0)