本文整理匯總了VB.NET中System.Reflection.MethodBase.IsFamilyOrAssembly屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET MethodBase.IsFamilyOrAssembly屬性的具體用法?VB.NET MethodBase.IsFamilyOrAssembly怎麽用?VB.NET MethodBase.IsFamilyOrAssembly使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。
在下文中一共展示了MethodBase.IsFamilyOrAssembly屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Example
' 導入命名空間
Imports System.Reflection
Public class Example
Public Sub m_Public()
End Sub
Friend Sub m_Friend()
End Sub
Protected Sub m_Protected()
End Sub
Protected Friend Sub m_Protected_Friend()
End Sub
Public Shared Sub Main()
Console.WriteLine(vbCrLf & _
"{0,-30}{1,-18}{2}", "", "IsAssembly", "IsFamilyOrAssembly")
Console.WriteLine("{0,-21}{1,-18}{2,-18}{3}" & vbCrLf, _
"", "IsPublic", "IsFamily", "IsFamilyAndAssembly")
For Each m As MethodBase In GetType(Example).GetMethods( _
BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public)
If Left(m.Name, 1) = "m"
Console.WriteLine("{0,-21}{1,-9}{2,-9}{3,-9}{4,-9}{5,-9}", _
m.Name, _
m.IsPublic, _
m.IsAssembly, _
m.IsFamily, _
m.IsFamilyOrAssembly, _
m.IsFamilyAndAssembly _
)
End If
Next
End Sub
End Class
輸出:
IsAssembly IsFamilyOrAssembly IsPublic IsFamily IsFamilyAndAssembly m_Public True False False False False m_Friend False True False False False m_Protected False False True False False m_Protected_Friend False False False True False