public EditorWindow(AbstractPackage pkg) { InitializeComponent(); _pkg = pkg; Resize += (o, e) => discUsageGraphic.Invalidate(); LoadPackage(); }
/// <summary> /// Closes the currently opened package. /// </summary> private void ClosePackage() { _pkg = null; listView1.Items.Clear(); _allFiles?.Clear(); discUsageGraphic.Invalidate(); discUsageBar.Value = 0; }
static int SumVersion(AbstractPackage package) { if (package is OperatorPackage operatorPackage) { return(package.Version + operatorPackage.SubPackages.Select(SumVersion).Sum()); } return(package.Version); }
public PackageView(AbstractPackage pkg) { InitializeComponent(); pm = PackageManager.GetInstance(); children = new List <PackageView>(0); currentPackage = pkg; currentDirectory = currentPackage.RootDirectory; ResetBreadcrumbs(); FillFileView(); }
public PackageView(AbstractPackage pkg, PackageManager pm) { InitializeComponent(); InitCustomComponents(); this.pm = pm; children = new List <PackageView>(0); currentPackage = pkg; currentDirectory = currentPackage.RootDirectory; filePropertyGrid.SelectedObject = currentPackage; ResetBreadcrumbs(); FillFileView(); }
public FarArchive(string path) { path = Path.GetFullPath(path); // Workaround for GameArchives parsing directory name _archivePath = path; try { AbstractPackage pkg = PackageReader.ReadPackageFromFile(path); _archive = pkg as FSARPackage; } catch (Exception ex) { throw ex; } }
public void Unload() { parent?.RemoveChildPackage(this); var childrenFixed = children.ToArray(); foreach (var pkg in childrenFixed) { pkg.Unload(); } currentPackage?.Dispose(); currentPackage = null; currentDirectory = null; FillFileView(); ResetBreadcrumbs(); (this.FindForm() as ArchiveExplorer).RemoveTab(this.Tag as TabPage); }
public void Unload() { parent?.RemoveChildPackage(this); ew?.Close(); var childrenFixed = children.ToArray(); foreach (var pkg in childrenFixed) { pkg.Unload(); } currentPackage?.Dispose(); currentPackage = null; currentDirectory = null; FillFileView(); ResetBreadcrumbs(); OnRemoveTab?.Invoke(Tag as TabPage); }
public FarArchive(string path) { _archivePath = path; try { AbstractPackage pkg = PackageReader.ReadPackageFromFile(path); if (pkg is FSARPackage) { _archive = pkg as FSARPackage; } } catch (Exception ex) { throw ex; } }
private void button1_Click(object sender, EventArgs e) { try { var ekpfs = new string(Crypto.ComputeKeys(pkg.Header.content_id, passcodeTextBox.Text, 1) .Select(b => (char)b).ToArray()); package = PackageReader.ReadPackageFromFile(pkgFile, ekpfs); innerPfs = PackageReader.ReadPackageFromFile(package.GetFile("/pfs_image.dat")); var view = new PackageView(innerPfs, PackageManager.GetInstance()); view.Dock = DockStyle.Fill; filesTab.Controls.Clear(); filesTab.Controls.Add(view); passcode = passcodeTextBox.Text; } catch (Exception) { MessageBox.Show("Invalid passcode!"); } }
public static Tuple <long, long> GetLargestFreeBlock(this AbstractPackage pkg) { return(new Tuple <long, long>(0, 0)); }
static bool IsLiteral(AbstractPackage header) => header.TypeId == TypeLiteral;