public void LoadFiles(string[] files) { Wait.Start(files.Length); foreach (Downloads.IPackageInfo nfo in cb.Items) { nfo.Dispose(); } this.cb.Items.Clear(); Cleanup(); int ct = 0; foreach (string file in files) { Wait.Progress = ct++; Downloads.IPackageHandler hnd = Downloads.HandlerRegistry.Global.LoadFileHandler(file); if (hnd != null) { foreach (Downloads.IPackageInfo nfo in hnd.Objects) { cb.Items.Add(nfo); } } hnd.FreeResources(); } if (cb.Items.Count > 0) { cb.SelectedIndex = 0; } Wait.Stop(); }
private void LoadFiles(SimPe.StringArrayList files) { int nr = 0; foreach (string file in files) { Wait.Progress = nr++; Wait.Message = System.IO.Path.GetFileName(file); if (!FileTable.FileIndex.Contains(file)) { SimPe.Plugin.DownloadsToolFactory.TeleportFileIndex.AddIndexFromPackage(file); } Downloads.IPackageHandler hnd = HandlerRegistry.Global.LoadFileHandler(file); if (hnd != null) { nfos.AddRange(hnd.Objects); } SimPe.Packages.StreamFactory.CloseStream(file); } }