private Dictionary <string, MxeEntryType> DiscoverTypes(FileStream stream) { Dictionary <string, List <string> > discoveredTypes = new Dictionary <string, List <string> >(); foreach (MxeIndexEntry mie in _indexes.Values) { if (mie.Block.Type == MxeEntryType.Other) { string key = mie.GetVmTitle(); List <string> currTypes = mie.SuggestTypes(stream); if (!discoveredTypes.ContainsKey(key)) { discoveredTypes[key] = currTypes; } else { MergeTypeLists(discoveredTypes[key], currTypes); } } } Dictionary <string, MxeEntryType> dts = new Dictionary <string, MxeEntryType>(); foreach (KeyValuePair <string, List <string> > entry in discoveredTypes) { MxeEntryType newType = new MxeEntryType(entry.Key, entry.Value); MxeEntryType.KnownTypes.Add(entry.Key, newType); dts.Add(entry.Key, newType); ConfigDiscovery.AddNewMxeType(newType); } return(dts); }
public static void AddNewMxeType(MxeEntryType newType) { Console.Out.WriteLine(String.Format(ADDITIONAL_FORMAT, newType.Type1, newType.ToString())); _mxeTypes.Add(newType); }