Exemple #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);
     }
 }
Exemple #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.");
     }
 }
Exemple #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.");
     }
 }
Exemple #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));
     }
 }
Exemple #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="elePara"></param>
 public CurrentElement(AT elePara)
 {
     this.elePara = elePara;
     this.current = elePara.GetMe().Current;
 }