/*** Constructor ***/ public CrcTestForm(ref RCH2Container rch2) { InitializeComponent(); this.rch2 = rch2; backgroundWorker1.RunWorkerAsync(); timer.Start(); }
private void LoadFile(string fileName) { RCH2Container c; Status = String.Format("Loading {0}...", fileName); try { c = FurcadiaInstaller.GetFileContainer(fileName); if (c == null) { MessageBox.Show("Unable to load data - make sure it is a Furcadia installer!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } rch2 = c; txtDragDrop.Visible = false; txtInstallerName.Text = System.IO.Path.GetFileName(fileName); UpdateList(); UpdateToolStrip(rch2 != null); Status = String.Format("Imported {0} files.", rch2.Count); }
/// <summary> /// Find an RCH2File instance that represents a specific path. /// </summary> /// <param name="rch2">RCH2 container instance to look in</param> /// <param name="filePath">File path to look for</param> /// <returns>An RCH2File instance representing a specific path, or null if not found</returns> public static RCH2File FindFileByPath(RCH2Container rch2, string filePath) { foreach (RCH2File file in rch2.Files) { if (file.Path == filePath) { return(file); } } return(null); }