예제 #1
0
파일: AT.cs 프로젝트: LuffyAutomation/UIA
 /// <summary>
 ///
 /// </summary>
 public void test(AT t)
 {
     try
     {
         AutomationElement aaa = GetTopLevelWindow(t.GetMe());
     }
     catch (Exception ex)
     {
         throw new Exception("GetElementFromHwnd error. " + ex.Message);
     }
 }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="elePara"></param>
 public WindowEvents(AT elePara)
 {
     this.elePara = elePara;
     try
     {
         WindowPattern = (WindowPattern)elePara.GetMe().GetCurrentPattern(WindowPattern.Pattern);
     }
     catch (Exception)
     {
         throw new Exception("Failed to get WindowEvents.");
     }
 }
예제 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="elePara"></param>
 public ScrollEvents(AT elePara)
 {
     this.elePara = elePara;
     try
     {
         scrollPattern = (ScrollPattern)elePara.GetMe().GetCurrentPattern(ScrollPattern.Pattern);
     }
     catch (Exception)
     {
         //throw new Exception("Failed to get scrollable item.");
     }
 }
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public bool IsSelected()
 {
     try
     {
         SelectionItemPattern t = (SelectionItemPattern)elePara.GetMe().GetCurrentPattern(SelectionItemPattern.Pattern);
         return(t.Current.IsSelected);
     }
     catch (Exception ex)
     {
         throw new Exception(string.Format("Failed to get isSelected status. {0}", ex));
     }
 }
예제 #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="elePara"></param>
 public CurrentElement(AT elePara)
 {
     this.elePara = elePara;
     this.current = elePara.GetMe().Current;
 }