Ejemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try {
         if (this.openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
             using (var file = File.OpenRead(openFileDialog1.FileName)) {
                 current = new CPKPackage(file);
                 showPackageStructure(current);
             }
         }
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 2
0
        private void showPackageStructure(CPKPackage p)
        {
            treeView.Nodes.Clear();
            var root = treeView.Nodes.Add("Root [" + p.ContentType + ", " + p.Flags + "]");

            foreach (var node in p.Nodes)
                addNode(node.Value, root);

            root.Expand();

            labelFormat.Text = string.Format("CPK Format: {0}, Content Type: {1}", p.FormatVersion, p.ContentType);
        }