c#获取事件绑定的所有方法


private bool HasBindingPropertiesListChangedEvent()
{
    var targetType = this._propertiesProvider.Properties.GetType();
    var eventField = targetType.GetField("ListChanged", BindingFlags.Instance | BindingFlags.NonPublic);
    if (eventField == null)
    {
        return false;
    }

    var handle = eventField.GetValue(this._propertiesProvider.Properties) as ListChangedEventHandler;
    if (handle == null)
    {
        return false;
    }

    return handle.GetInvocationList().Find(x => typeof(DataEntityPanelViewModel_OL).Name == x.Target.GetType().Name) != null;
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM