程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> C# >> C#入門知識 >> 使用反射移除指定對象的未知的事件的調用委托列表輔助類

使用反射移除指定對象的未知的事件的調用委托列表輔助類

編輯:C#入門知識

     
       
           
                 
           BindingFlags _SEARCH_BINDINGFLAGS = BindingFlags.Instance |
                                                                    BindingFlags.Static |
                                                                    BindingFlags.Public |
  
          
                   
          
          
            ClearEventHandler( targetObj,              Type targetType =             EventInfo eventInfo =              (eventInfo == )   ArgumentException(             Delegate[] eventInvocationList =              (Delegate handler     
          
                   
          
          
           Delegate[] GetEventInvocationList( targetObj,              FieldInfo eventFieldInfo = GetEventField(targetObj.GetType(), eventName,               (eventFieldInfo !=                   eventFieldValue =                  (eventFieldValue                                       }                      PropertyInfo propertyInfo = targetObj.GetType().GetProperty(                      (propertyInfo !=                          EventHandlerList eventHandlerList = propertyInfo.GetValue(targetObj, )                           (eventHandlerList !=                              Delegate eventHanlder =                              (eventHanlder !=                                                      
          
                   
          
          
          
          
           FieldInfo GetEventField(Type target,  eventName,              FieldInfo eventInfo =              (inherited && eventInfo ==                   (target.BaseType !=                       (target.BaseType ==                          eventInfo = GetEventField(target.BaseType,  + eventName,                      
                         eventInfo = GetEventField(target.BaseType, eventName,                  
          
                   
          
          
          
           EventInfo GetEvent(Type target,                 }

PS:該Demo存在很大的缺憾,僅供參考,還請高人指點一二以協助小弟進行改善以及完善。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved