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

CleanupOrphans() статический приватный Метод

Cleans up the map tables of entries that are orphans. These are forms that don't have a corresponding animatinon file
static private CleanupOrphans ( ) : void
Результат void
        internal static void CleanupOrphans()
        {
            Log.Debug("Cleaning up panelConfigMap entries...");

            var removeList = new List<PanelConfigMapEntry>();
            foreach (var list in _mapTable.Values)
            {
                foreach (var mapEntry in list)
                {
                    Log.Debug("Looking up " + mapEntry.ToString());
                    if (_formsCache.ContainsKey(mapEntry.FormId))
                    {
                        mapEntry.FormType = (Type)_formsCache[mapEntry.FormId];
                    }

                    /*else if (_formsCache.ContainsKey(mapEntry.PanelName) && mapEntry.FormId.Equals(Guid.Empty))
                    {
                        mapEntry.FormType = (Type)_formsCache[mapEntry.PanelName];
                    }
                    */
                    Log.IsNull("mapEntry.FormType ", mapEntry.FormType);

                    if (mapEntry.FormType != null && _configFileLocationMap.ContainsKey(mapEntry.ConfigFileName))
                    {
                        Log.Debug("Yes. _configFileLocationMap has configfile " + mapEntry.ConfigFileName);
                        mapEntry.ConfigFileName = _configFileLocationMap[mapEntry.ConfigFileName];
                    }
                    else
                    {
                        Log.Debug("No. _configFileLocationMap does not have configfile " + mapEntry.ConfigFileName);
                        removeList.Add(mapEntry);
                    }
                }
            }

            foreach (var panelConfigMapEntry in removeList)
            {
                removeMapEntry(panelConfigMapEntry);
            }
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Performs initialization. Walks the extension
        /// dirs and caches the Types of all the scanner/dialogs and menus.
        /// The Type will be used to create an instance using .NET
        /// relection.
        /// </summary>
        /// <param name="extensionDirs">extension dirs to walk</param>
        /// <returns>true on success</returns>
        public bool Init(IEnumerable <String> extensionDirs)
        {
            var retVal = PanelConfigMap.Load(extensionDirs);

            PanelConfigMap.Load(Preferences.ApplicationAssembly);

            if (EvtStartupAddForms != null)
            {
                EvtStartupAddForms(this, new EventArgs());
            }

            PanelConfigMap.CleanupOrphans();

            var configNames = CoreGlobals.AppPreferences.PreferredPanelConfigNames.Split(';');

            PreferredPanelConfigNames = configNames;

            return(retVal);
        }
All Usage Examples Of ACAT.Lib.Core.PanelManagement.PanelConfigMap::CleanupOrphans