public static GetPanelConfigMapEntry ( String panel ) : ACAT.Lib.Core.PanelManagement.PanelConfigMapEntry | ||
panel | String | Name of the scanner |
return | ACAT.Lib.Core.PanelManagement.PanelConfigMapEntry |
public static PanelConfigMapEntry GetPanelConfigMapEntry(String panel)
{
PanelConfigMapEntry retVal = null;
List<PanelConfigMapEntry> list = null;
_mapTable.TryGetValue(panel, out list);
if (list == null || list.Count <= 0)
{
return null;
}
var configName = _preferredPanelConfig.GetConfigName(panel);
if (!String.IsNullOrEmpty(configName))
{
retVal = findMapEntryInList(configName, list);
}
if (retVal == null)
{
retVal = findMapEntryInMapTable(configName);
}
if (retVal == null)
{
retVal = list[0];
}
return retVal;
}
/// <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); }