public LocalPackageInfo[] ListPackages(Context ctx) { SwitchToDatabase(); return(Database.currentDatabase.InstalledRoutes .Concat(Database.currentDatabase.InstalledTrains) .Concat(Database.currentDatabase.InstalledOther) .Select(pack => PackageStructHelper.ToPWPackage(pack)) .ToArray()); }
public LocalPackageInfo QueryExternalPackage(Context ctx, string path) { var obPackage = Manipulation.ReadPackage(path); if (obPackage == null) { throw new InvalidDataException(); } return(PackageStructHelper.ToPWPackage(obPackage)); }