Пример #1
0
        /// <summary>
        /// Determines whether this instance is visible (has positive bounds).
        /// </summary>
        /// <returns>
        ///     <c>true</c> if this instance is visible; otherwise, <c>false</c>.
        /// </returns>
        /// <remarks>Parts of this function are time limited to 100 ms.</remarks>
        public bool IsVisible()
        {
            if (IsValid())
            {
                System.Drawing.Rectangle b = new System.Drawing.Rectangle();
                var bT = TimeLimitExecutor.ExecuteWithTimeLimit(100, () => { b = Bounds; });

                while (bT != null && bT.IsAlive && bT.ThreadState == ThreadState.Running)
                {
                    Thread.Sleep(1);
                }

                if (b != null && b.Height > 0 && b.Width > 0)
                {
                    //TODO: test the states for visible?!
                    return(true);
                }
            }

            return(false);
        }
 void XSelectionChangeListener.selectionChanged(unoidl.com.sun.star.lang.EventObject aEvent)
 {
     TimeLimitExecutor.ExecuteWithTimeLimit(500, () => { fireSelectionEvent(aEvent); }, "SelectionChanged");
 }
Пример #3
0
 /// <summary>
 /// Handles accessible events.
 /// </summary>
 /// <param name="aEvent">a event.</param>
 /// <remarks>This Event handler it time limited to 15,000 ms.</remarks>
 void XAccessibleEventListener.notifyEvent(AccessibleEventObject aEvent)
 {
     TimeLimitExecutor.ExecuteWithTimeLimit(15000, delegate() { fireSelectionEvent(aEvent); }, "AccEvntFrwd_NotifyEvent");
 }