ACAT.Lib.Core.PanelManagement.PanelConfigMap.GetConfigFileForScreen C# (CSharp) Метод

GetConfigFileForScreen() публичный статический Метод

Returns the config file for the specified Type that represents a scanner
public static GetConfigFileForScreen ( Type type ) : String
type System.Type Type of the scanner
Результат String
        public static String GetConfigFileForScreen(Type type)
        {
            String retVal = String.Empty;
            String xmlFileName;

            Log.Debug("Type: " + type.FullName);
            Guid guid = GetFormId(type);
            if (guid != Guid.Empty)
            {
                Log.Debug(type + " has a guid " + guid);
                xmlFileName = findConfigFileByGuid(guid);
            }
            else
            {
                Log.Debug(type + " does not have a guid. Checking type instead");
                xmlFileName = findConfigFileByType(type);
            }
            
            if (String.IsNullOrEmpty(xmlFileName))
            {
                Log.Debug("Did not find config file for " + type + " in maptable");
                xmlFileName = (type.Name + ".xml").ToLower();
                Log.Debug("Checking for configFile " + xmlFileName + " in _configFileMap");
                if (_configFileLocationMap.ContainsKey(xmlFileName))
                {
                    retVal = _configFileLocationMap[xmlFileName];
                    Log.Debug("Found " + xmlFileName + " location. It is " + retVal);
                }
                else
                {
                    Log.Debug("configFileMap does not have xmlfile " + xmlFileName);
                }
            }
            else
            {
                retVal = xmlFileName;
            }

            Log.Debug("For type " + type.Name + " config file is [" + retVal + "]");
            retVal = FileUtils.GetLocalizedFilePath(retVal);
            Log.Debug("For type " + type.Name + " localized config file is [" + retVal + "]");
            return retVal;
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Performs initialization.  Reads the config file for the form, creates
        /// the animation manager, widget manager, loads in  all the widgets,
        /// subscribes to events
        /// Call this function in the Initialize() function in the scanner.
        /// </summary>
        /// <param name="startupArg"></param>
        /// <returns></returns>
        public bool Initialize(StartupArg startupArg)
        {
            Log.Debug("Entered from Initialize");

            Glass.Enable = CoreGlobals.AppPreferences.EnableGlass;

            Glass.EvtShowGlass += Glass_EvtShowGlass;

            StartupArg = startupArg;

            ScannerForm.AutoScaleMode = AutoScaleMode.None;

            ScannerForm.TopMost = true;

            Windows.ShowWindowBorder(ScannerForm,
                                     CoreGlobals.AppPreferences.ScannerShowBorder,
                                     CoreGlobals.AppPreferences.ScannerShowTitleBar ? ScannerForm.Text : String.Empty);

            Windows.EvtWindowPositionChanged += Windows_EvtWindowPositionChanged;

            ScannerForm.SizeChanged += ScannerForm_SizeChanged;

            subscribeTalkWindowManager();

            ScannerForm.Shown          += form_Shown;
            ScannerForm.VisibleChanged += form_VisibleChanged;

            _dialogMode = startupArg.DialogMode;

            var configFile = startupArg.ConfigFileName;

            if (String.IsNullOrEmpty(configFile))
            {
                configFile = PanelConfigMap.GetConfigFileForScreen(ScannerForm.GetType());
            }

            bool retVal = initWidgetManager(configFile);

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

            if (retVal)
            {
                createIdleTimer();
            }

            PositionSizeController.Initialize();

            PositionSizeController.AutoSetPosition();

            _windowOverlapWatchdog = new WindowOverlapWatchdog(ScannerForm);

            WindowActivityMonitor.EvtWindowMonitorHeartbeat += WindowActivityMonitor_EvtWindowMonitorHeartbeat;

            Log.Debug("Returning from Initialize");
            return(retVal);
        }
All Usage Examples Of ACAT.Lib.Core.PanelManagement.PanelConfigMap::GetConfigFileForScreen