GetPanelConfigMapEntry() public static method

Returns the config map for the specified scanner. Looks up the preferred config map first to see if there is a config entry that has been specifically configured for the scanner. If not, it looks up the map talbe
public static GetPanelConfigMapEntry ( String panel ) : ACAT.Lib.Core.PanelManagement.PanelConfigMapEntry
panel String Name of the scanner
return ACAT.Lib.Core.PanelManagement.PanelConfigMapEntry
示例#1
0
        /// <summary>
        /// If the form doesn't have a panel name, call this in the
        /// constructor of the form
        /// </summary>
        /// <returns>true on success</returns>
        public bool Initialize(StartupArg startupArg)
        {
            _panelName = startupArg.PanelClass;

            var panelConfigMapEntry = PanelConfigMap.GetPanelConfigMapEntry(startupArg.PanelClass);

            if (panelConfigMapEntry == null) // did not find the panel
            {
                return(false);
            }

            bool retVal = initWidgetManager(panelConfigMapEntry);

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

            Windows.SetTopMost(_form);

            PanelManager.Instance.EvtScannerShow += Instance_EvtScannerShow;
            Windows.EvtWindowPositionChanged     += Windows_EvtWindowPositionChanged;

            Windows.SetWindowPositionAndNotify(_form, Windows.WindowPosition.CenterScreen);

            _windowOverlapWatchdog = new WindowOverlapWatchdog(_form);

            return(retVal);
        }
示例#2
0
        /// <summary>
        /// Initialzies the specified scanner panel
        /// </summary>
        /// <param name="scannerPanel">panel to initialize</param>
        /// <param name="arg">panel arguments</param>
        /// <returns>true on success</returns>
        private bool initializePanel(IScannerPanel scannerPanel, PanelRequestEventArgs arg)
        {
            var startupArg = new StartupArg
            {
                FocusedElement = arg.MonitorInfo.FocusedElement,
                PanelClass     = arg.PanelClass,
                Arg            = arg.RequestArg
            };

            var panelConfigMapEntry = PanelConfigMap.GetPanelConfigMapEntry(arg.PanelClass);

            Log.Debug("panelClass:  " + arg.PanelClass + ", ConfigFIle: " + ((panelConfigMapEntry != null) ? panelConfigMapEntry.ConfigFileName : String.Empty));
            return(scannerPanel.Initialize(startupArg));
        }
示例#3
0
        /// <summary>
        /// Creates the panel with the specified panel class
        /// </summary>
        /// <param name="panelClass">the panel class</param>
        /// <param name="panelTitle">panel title</param>
        /// <param name="winHandle">target window handle</param>
        /// <param name="focusedElement">currently focused element</param>
        /// <returns>the form for the panel</returns>
        public Form CreatePanel(
            ref String panelClass,
            String panelTitle,
            IntPtr winHandle,
            AutomationElement focusedElement)
        {
            Log.Debug("panelClass: " + panelClass);
            var panelConfigMapEntry = PanelConfigMap.GetPanelConfigMapEntry(panelClass);

            if (panelConfigMapEntry == null)
            {
                Log.Debug("Could not find panel for " + panelClass + ". Using default ");
                panelClass          = PanelClasses.Alphabet;
                panelConfigMapEntry = PanelConfigMap.GetPanelConfigMapEntry(PanelClasses.Alphabet);
                Log.Debug("Could not find panel for " + panelClass + ". Using default " + panelConfigMapEntry.FormType.Name);
            }

            Log.Debug("panel: " + panelConfigMapEntry.FormType.Name);
            return(createPanel(panelClass, panelTitle, panelConfigMapEntry.FormType, winHandle, focusedElement));
        }