private void Button_Import_Click(object sender, EventArgs e) { if (Browser_ImportPRB.ShowDialog() == DialogResult.OK) { string FileName = Browser_ImportPRB.FileName; PrefabLoader.PrefabStruct NewPrefab = new PrefabLoader.PrefabStruct(); using (BinaryReader reader = new BinaryReader(File.Open(FileName, FileMode.Open))) { string AssignedName = StringHelpers.ReadString16(reader); NewPrefab.ReadFromFile(reader); NewPrefab.AssignedName = AssignedName; } TreeNode node = new TreeNode(); node.Tag = NewPrefab; node.Text = NewPrefab.AssignedName; node.Name = NewPrefab.AssignedName; TreeView_Prefabs.Nodes.Add(node); } }
private void Import() { if (Browser_ImportPRB.ShowDialog() == DialogResult.OK) { string FileName = Browser_ImportPRB.FileName; PrefabLoader.PrefabStruct NewPrefab = new PrefabLoader.PrefabStruct(); using (BinaryReader reader = new BinaryReader(File.Open(FileName, FileMode.Open))) { string AssignedName = StringHelpers.ReadString16(reader); NewPrefab.ReadFromFile(reader); NewPrefab.AssignedName = AssignedName; } TreeNode node = new TreeNode(); node.Tag = NewPrefab; node.Text = NewPrefab.AssignedName; node.Name = NewPrefab.AssignedName; TreeView_Prefabs.Nodes.Add(node); Text = Language.GetString("PREFAB_EDITOR_TITLE") + "*"; bIsFileEdited = true; } }