public static bool IndexUnitFile(UnitFile file) { var name = file.UnitName; if (!UnitFiles.ContainsKey(name)) { UnitFiles[name] = new List <UnitFile>(); } if (file is OnDiskUnitFile) { UnitFiles[name].RemoveAll(u => u is OnDiskUnitFile && (u as OnDiskUnitFile).Path == (file as OnDiskUnitFile).Path); } UnitFiles[name].Add(file); if (Units.ContainsKey(name)) { var unit = Units[name]; unit.SetUnitDescriptor(GetUnitDescriptor(name)); } else { AddUnit(CreateUnit(name)); } return(true); }
public override void LoadUnitFile(UnitFile file) { File = file; LoadTime = DateTime.UtcNow; }
public override void LoadUnitFile(string path) { File = UnitParser.Parse <UnitFile>(path); LoadTime = DateTime.UtcNow; }