2013-09-08 4 views
0

이봐 난 WPF 응용 프로그램에서 이미지를 얻기 위해 노력하고 모든 :WPF UI 자동화 찾는 이미지

enter image description here

당신은 이미지가 트리

"원격 전화"창 아래에서 볼 수 있듯이 > "" "custom>" "이미지

텍스트 상자와 버튼을 찾고 단추를 호출하는 방법을 찾았지만 아직 이미지를 가져 와서 표시 할 수있는 코드를 찾지 못했습니다. 내 양식 상자 안에.

LogMessage("Getting RootElement..."); 
AutomationElement rootElement = AutomationElement.RootElement; 

if (rootElement != null) 
{ 
    LogMessage("OK." + Environment.NewLine); 

    Automation.Condition condition = new PropertyCondition(AutomationElement.NameProperty, "Remote phone"); 

    LogMessage("Searching for Remote Phone Window..."); 
    AutomationElement appElement = rootElement.FindFirst(TreeScope.Children, condition); 

    if (appElement != null) 
    { 
     LogMessage("OK " + Environment.NewLine); 
     LogMessage("Searching for Image..."); 

     AutomationElement txtElementA = GetTextElement(appElement, "image"); 

     if (txtElementA != null) 
      etc..etc... 

IT는 appElement이 잘 찾지 만 그것은 txtElementA에 도달하면 그것은 자신이 GetTextElement 대신 사진/이미지 요소를 찾고 있기 때문에해야 NULL입니다.

이미지를 찾고 그것을 잡아 내 양식의 그림 상자에 표시하는 적절한 코드는 무엇입니까?

감사합니다.

답변

0

수행하려는 작업을 지원하는 UI 자동화 패턴이 없습니다. 검사 창을 보면 IsXXXPatternAvailable 속성이 모두 false라는 것을 알 수 있습니다. 즉, 사용할 수있는 패턴이 하나도 없다는 것을 의미합니다 (IsLegacyIAccessblePatternAvailable을 제외하고는 그 중 하나가 도움이되지 않습니다).