Exemplo n.º 1
0
        private void initalize()
        {
            #region OoTopWindowObserver initialization
            try
            {
                tpwndo.WindowActivated += new EventHandler <OoEventArgs>(tpwndo_WindowActivated);
                //tpwndo.Disposing += new EventHandler<OoEventArgs>(tpwndo_Disposing);
                tpwndo.WindowClosed += new EventHandler <OoEventArgs>(tpwndo_WindowClosed);
                //tpwndo.WindowClosing += new EventHandler<OoEventArgs>(tpwndo_WindowClosing);
                //tpwndo.WindowDeactivated += new EventHandler<OoEventArgs>(tpwndo_WindowDeactivated);
                tpwndo.WindowMinimized  += new EventHandler <OoEventArgs>(tpwndo_WindowMinimized);
                tpwndo.WindowNormalized += new EventHandler <OoEventArgs>(tpwndo_WindowNormalized);
                tpwndo.WindowOpened     += new EventHandler <OoEventArgs>(tpwndo_WindowOpened);
            }
            catch (System.Exception ex)
            {
                Logger.Instance.Log(LogPriority.ALWAYS, this, "Accessibility Observer TopWindowObserever initialization failed", ex);
            }

            #endregion

            #region TopWindow initialization

            var tpwnds = OoAccessibility.GetAllTopWindows();
            foreach (var item in tpwnds)
            {
                tpwndo_WindowOpened(this, new OoEventArgs(item));
            }

            initalized = true;

            var actTpwnd = OoAccessibility.GetActiveTopWindow();
            if (actTpwnd != null)
            {
                tpwndo_WindowActivated(this, new OoEventArgs(actTpwnd));
            }

            #endregion
        }
Exemplo n.º 2
0
 /// <summary>
 /// Gets all OpenOffice top windows.
 /// </summary>
 /// <returns>List of top windows.</returns>
 public static List <Object> GetAllTopWindows()
 {
     return(OoAccessibility.GetAllTopWindows());
 }