private MapFileEngine FindByMapFileName(string aFileName) { MapFileEngine ret = null; // foreach (MapFileEngine engine in iFiles) { if (engine.MapFileName.ToLower() == aFileName.ToLower()) { ret = engine; break; } } // return(ret); }
public MapFileEngine LoadFromFile(string aMapFileName, TSynchronicity aSynchronicity) { // Check if already exists MapFileEngine engine = null; // lock (this) { engine = FindByMapFileName(aMapFileName); if (engine != null) { iFiles.Remove(engine); } engine = new MapFileEngine(this); engine.Observer += new AsyncReaderBase.Observer(MapEngine_ObserverProxy); engine.LoadFromFile(aMapFileName, aSynchronicity); iFiles.Add(engine); } return(engine); }
public bool Load(CodeSegDefinition aDefinition, TSynchronicity aSynchronicity) { bool ret = false; // if (string.IsNullOrEmpty(aDefinition.MapFileName) || !aDefinition.MapFileExists) { } else { // First pass - try to find map engine that matches the specified // PC file name. string mapFileName = aDefinition.MapFileName; if (aDefinition.MapFileExists) { System.Diagnostics.Debug.WriteLine(" LOAD {M}: " + aDefinition.ToString()); MapFileEngine engine = FindByMapFileName(mapFileName); if (engine != null) { engine.Load(aDefinition); ret = true; } else { // Map file engine doesn't exist for the specified code segment. // Can we load it from file? engine = LoadFromFile(aDefinition.MapFileName, aSynchronicity); if (engine != null) { engine.Load(aDefinition); ret = true; } } } } // return(ret); }
public override bool IsLoaded(string aFileName) { MapFileEngine engine = FindByMapFileName(aFileName); return(engine != null); }