private void LoadSC(string fileName) { m_vStorageObject = new Decoder(fileName); m_vStorageObject.Decode(); treeView1.Nodes.Clear(); pictureBox1.Image = null; label1.Text = null; RefreshMenu(); treeView1.Populate(m_vStorageObject.GetExports()); //treeView1.Populate(m_vStorageObject.GetShapes()); treeView1.Populate(m_vStorageObject.GetTextures()); //treeView1.Populate(m_vStorageObject.GetMovieClips()); }
private void duplicateToolStripMenuItem1_Click(object sender, EventArgs e) { if (treeView1.SelectedNode != null) { if (treeView1.SelectedNode.Tag != null) { Export data = (Export)treeView1.SelectedNode.Tag; CloneExport form = new CloneExport(); ((TextBox)form.Controls["textBox1"]).Text = data.GetName(); if (form.ShowDialog() == DialogResult.OK) { string result = ((TextBox)form.Controls["textBox1"]).Text; if (result != "" && m_vStorageObject.GetExports().FindIndex(exp => exp.GetName() == result) == -1) { MovieClip mv = new MovieClip((MovieClip)data.GetDataObject()); m_vStorageObject.AddMovieClip(mv); m_vStorageObject.AddChange(mv); Export ex = new Export(m_vStorageObject); ex.SetId(mv.GetId()); ex.SetExportName(result); ex.SetDataObject(mv); m_vStorageObject.AddExport(ex); m_vStorageObject.AddChange(ex); treeView1.Populate(new List <ScObject>() { ex }); } else { MessageBox.Show("Cloning failed. Invalid ExportName."); } } form.Dispose(); } } }