Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 public void test(AT t)
 {
     try
     {
         AutomationElement aaa = GetTopLevelWindow(t.GetMe());
     }
     catch (Exception ex)
     {
         throw new Exception("GetElementFromHwnd error. " + ex.Message);
     }
 }
Exemplo n.º 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.");
     }
 }
Exemplo n.º 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.");
     }
 }
Exemplo n.º 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));
     }
 }
Exemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="elePara"></param>
 public CurrentElement(AT elePara)
 {
     this.elePara = elePara;
     this.current = elePara.GetMe().Current;
 }