White UI Automation 库如何使用 Castle DynamicProxy
本文关键字:何使用 Castle DynamicProxy UI Automation White | 更新日期: 2024-10-25 23:48:25
White UI Automation库广泛使用了Castle项目的DynamicProxy 2。据我了解,DynamicProxy 用于"包装"MS UI 自动化对象,并用于在其父窗口中检索对象。
我需要了解 DynamicProxy 是否必要,以及是否可以用更快的东西替换它,即静态构建的类而不是在运行时生成的代理类,IMO 是不必要的减慢速度。
DynamicProxy 在白色库中到底在做什么,它可以被替换吗?任何提示或指示都值得赞赏。
我决定不使用White(而是直接使用MS UI Automation),但我也在代码中使用Castle Dynamic Proxy。 以下是定位其使用位置的良好开端:
C:'Users'xxxx'Desktop'petmongrels-white-54723f8>findstr /s /c:"ProxyCreator" /c:"CreateClassProxy" /c:"IInterceptor" *.cs
Components'Core'Source'CustomCommands'CustomCommandInterceptor.cs: public class CustomCommandInterceptor : IInterceptor
Components'Core'Source'Interceptors'CoreInterceptor.cs: public class CoreInterceptor : IInterceptor
Components'Core'Source'UIItems'UIItemContainer.cs: var interceptors = (IInterceptor[]) interceptorField.GetValue(customUIItem);
Components'Repository'Source'Interceptors'ScreenObjectInterceptor.cs: public class ScreenObjectInterceptor : IInterceptor
Components'Repository'Source'Interceptors'UIItemInterceptor.cs: public class UIItemInterceptor : IInterceptor
Components'Repository'Source'Interceptors'WindowInterceptor.cs: public class WindowInterceptor : IInterceptor
Components'Repository'Source'Services'ServiceInterceptor.cs: public class ServiceInterceptor : IInterceptor
您可以在以下位置获取源代码: https://github.com/petmongrels/white
(我的有点过时了)