Beispiel #1
0
        /// <summary>
        /// Creates the PanelClassConfig entry for this application and for the
        /// PhraseSpeakScanner.
        /// </summary>
        /// <returns>true if successful</returns>
        private static bool createPanelClassConfig()
        {
            var panelClassConfigFilePath = PanelConfigMap.GetDefaultPanelClassConfigFileName();

            if (!File.Exists(panelClassConfigFilePath))
            {
                MessageBox.Show("Could not find PanelClassConfig file " + panelClassConfigFilePath);
                return(false);
            }

            var appPanelClassConfig = AppPanelClassConfig.Load <AppPanelClassConfig>(panelClassConfigFilePath);
            var panelClassConfig    = appPanelClassConfig.Find(Common.AppPreferences.AppId);

            if (panelClassConfig == null)
            {
                panelClassConfig = appPanelClassConfig.Add(Common.AppPreferences.AppId,
                                                           "ACAT Phrases Application",
                                                           "Displays a list of phrases that can be converted to speech");

                var panelClassConfigMap = panelClassConfig.Add(_panelConfigClassName,
                                                               "Phrases Speak scanner without the search button",
                                                               true);

                panelClassConfigMap.Add(_phraseSpeakScannerName, new Guid("2BE12ADA-88A2-4029-B8F7-8E74209B585B"));
            }

            AppPanelClassConfig.Save(appPanelClassConfig, panelClassConfigFilePath);

            return(true);
        }
Beispiel #2
0
        public bool OnQueryPanelChange(PanelRequestEventArgs arg)
        {
            Log.Debug("Query change for " + arg.PanelClass);
            if (arg.MonitorInfo.FgHwnd == _startupArg.HWnd)// && panelClass == PanelClasses.WindowsExplorerContextMenu)
            {
                if (PanelConfigMap.AreEqual(arg.PanelClass, PanelClasses.MenuDockContextMenu))
                {
                    return(true);
                }
                Log.Debug("Refuse Query change for " + arg.PanelClass);
                return(false);
            }

            return(true);
        }
Beispiel #3
0
        /// <summary>
        /// Loads all animations
        /// </summary>
        private bool initAnimationManager()
        {
            _animationManager = new AnimationManager();
            var configFile = PanelConfigMap.GetConfigFileForScreen(GetType());

            var retVal = _animationManager.Init(configFile);

            if (!retVal)
            {
                Log.Error("Error initializing animation manager");
                retVal = false;
            }

            return(retVal);
        }
Beispiel #4
0
        /// <summary>
        /// Initialize the widget manager
        /// </summary>
        private bool initWidgetManager()
        {
            _widgetManager = new WidgetManager(this);

            var configFile = PanelConfigMap.GetConfigFileForScreen(this.GetType());
            var retVal     = _widgetManager.Initialize(configFile);

            if (!retVal)
            {
                Log.Error("Unable to initialize widget manager");
            }
            else
            {
                _rootWidget = _widgetManager.RootWidget;
            }

            return(retVal);
        }
Beispiel #5
0
        /// <summary>
        /// Intitializes the class
        /// </summary>
        /// <param name="startupArg">startup param</param>
        /// <returns>true on success</returns>
        public bool Initialize(StartupArg startupArg)
        {
            var panelConfigMapEntry = PanelConfigMap.GetPanelConfigMapEntry(startupArg.PanelClass);

            if (panelConfigMapEntry == null)
            {
                return(false);
            }

            var retVal = initWidgetManager(panelConfigMapEntry);

            if (retVal)
            {
                retVal = initAnimationManager(panelConfigMapEntry);
            }

            return(retVal);
        }
Beispiel #6
0
        public override void OnPanelClosed(String panelClass, WindowActivityMonitorInfo monitorInfo)
        {
#if AUTO_SWITCH_SCANNER
            if (PanelConfigMap.AreEqual(panelClass, WindowsExplorerContextMenu))
            {
                return;
            }
            AutomationElement windowElement = getWindowElement(monitorInfo.FgHwnd);
            if (isStartMenu(windowElement) && PanelConfigMap.AreEqual(panelClass, "DialogAutoScanContextMenu"))//PanelClasses.DialogDockContextMenu))
            {
                AgentManager.Instance.Keyboard.Send(Keys.Escape);
            }
            else if (isFileExplorer(windowElement))// && PanelConfigMap.AreEqual(panelClass, "WindowsExplorerDialogContextMenu"))
            {
                AgentManager.Instance.Keyboard.Send(Keys.F6);
            }
#endif
        }