代码之家  ›  专栏  ›  技术社区  ›  Robin Rodricks

White UI Automation库如何使用Castle DynamicProxy?

  •  2
  • Robin Rodricks  · 技术社区  · 12 年前

    这个 White UI自动化库广泛使用 Castle Project' s的DynamicProxy 2。据我所知,DynamicProxy用于“包装”MS UI Automation对象,并用于在其父窗口内检索对象。

    我需要了解DynamicProxy是否有必要,以及是否可以用更快的东西取代它,即静态构建的类,而不是在运行时生成的代理类,这是不必要的放缓。

    DynamicProxy在White库中到底在做什么?它可以被替换吗?任何提示或指示都将不胜感激。

    1 回复  |  直到 12 年前
        1
  •  1
  •   chrismead    12 年前

    我决定不使用White(而是直接使用MSUIAutomation),但我也在代码中使用CastleDynamicProxy。以下是定位其使用位置的良好开端:

    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

    (我的有点过时了)