本文整理匯總了C#中System.Reflection.EventInfo.IsMulticast屬性的典型用法代碼示例。如果您正苦於以下問題:C# EventInfo.IsMulticast屬性的具體用法?C# EventInfo.IsMulticast怎麽用?C# EventInfo.IsMulticast使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Reflection.EventInfo
的用法示例。
在下文中一共展示了EventInfo.IsMulticast屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ShowEvents
//引入命名空間
using System;
using System.Reflection;
class MainClass {
public static void ShowEvents(Type t) {
EventInfo[] events = t.GetEvents();
Console.WriteLine("Implemented Events");
foreach (EventInfo e in events) {
Console.WriteLine("Event name: {0}", e.Name);
Console.WriteLine("Multicast: {0}", e.IsMulticast ? "Yes" : "No");
Console.WriteLine("Member Type {0}", e.MemberType.ToString());
}
}
public static void ShowTypes(string name, Assembly assembly) {
Type[] typeArray = assembly.GetTypes();
Console.WriteLine("Assembly Name: {0}", name);
foreach (Type type in typeArray) {
if (type.IsClass) {
ShowEvents(type);
}
}
}
public static void Main(string[] args) {
for (int i = 0; i < args.Length; ++i) {
// Get the assemble object (from System.Reflection)
Assembly assembly = Assembly.LoadFrom(args[0]);
ShowTypes(args[0], assembly);
}
}
}