Exemple #1
0
        /// <summary>
        /// Gets the parent element.
        /// </summary>
        /// <returns>The Parent of the object or <c>null</c></returns>
        public OoAccComponent GetParent()
        {
            lock (_accLock)
            {
                if (AccCont != null)
                {
                    var par = AccCont.getAccessibleParent();

                    if (par != null)
                    {
                        return(new OoAccComponent(par));
                    }
                }
                return(null);
            }
        }
Exemple #2
0
 /// <summary>
 /// Gets the children.
 /// </summary>
 /// <returns>List of accessible child elements</returns>
 public List <XAccessible> GetChilds()
 {
     lock (_accLock)
     {
         List <XAccessible> childs = new List <XAccessible>();
         if (AccCont != null)
         {
             int c = ChildCount;
             for (int i = 0; i < c; i++)
             {
                 var child = AccCont.getAccessibleChild(i);
                 //if (child != null) // don't destroy the parent index!
                 childs.Add(child);
             }
         }
         return(childs);
     }
 }
Exemple #3
0
 /// <summary>
 /// Gets the child of this element at the given index.
 /// </summary>
 /// <param name="index">The index.</param>
 /// <returns>The child as wrapped object or <c>null</c></returns>
 public OoAccComponent GetChild(int index)
 {
     lock (_accLock)
     {
         if (AccCont != null)
         {
             int cCount = ChildCount;
             if (cCount > index)
             {
                 try
                 {
                     var child = AccCont.getAccessibleChild(index);
                     if (child != null)
                     {
                         return(new OoAccComponent(child));
                     }
                 }
                 catch { }
             }
         }
         return(null);
     }
 }
Exemple #4
0
 /// <summary>
 /// Determines whether this instance is valid.
 /// </summary>
 /// <returns>
 ///     <c>true</c> if this instance is valid; otherwise, <c>false</c>.
 /// </returns>
 /// <remarks>This function is time limited to 100 ms.</remarks>
 public bool IsValid()
 {
     if (AccComp != null && AccCont != null)
     {
         try
         {
             int  c       = -1;
             bool success = TimeLimitExecutor.WaitForExecuteWithTimeLimit(100, () => { c = AccCont.getAccessibleChildCount(); });
             if (c >= 0)
             {
                 return(true);
             }
             return(false);
         }
         catch
         {
             return(false);
         }
     }
     return(false);
 }