Esempio n. 1
0
        private void treeMain_AfterSelect(object sender, TreeViewEventArgs e)
        {
            ResetGUI();

            if (e.Node.Level == 0)
            {
                boxGeneralButtons.Enabled = true;
                boxDataButtons.Enabled    = true;

                selectedPackage = loadedGpkPackages[Convert.ToInt32(e.Node.Name)];
                boxInfo.Text    = selectedPackage.ToString();
            }
            else if (e.Node.Level == 1 && Settings.Default.ViewMode == "class")
            {
                selectedPackage = loadedGpkPackages[Convert.ToInt32(e.Node.Parent.Name)];
                selectedClass   = e.Node.Text;

                boxDataButtons.Enabled = true;
            }
            else if (e.Node.Level == 2)
            {
                GpkPackage package  = loadedGpkPackages[Convert.ToInt32(e.Node.Parent.Parent.Name)];
                Object     selected = package.GetObjectByUID(e.Node.Name);

                if (selected is GpkImport)
                {
                    GpkImport imp = (GpkImport)selected;
                    boxInfo.Text = imp.ToString();
                }
                else if (selected is GpkExport)
                {
                    GpkExport exp = (GpkExport)selected;
                    boxInfo.Text = exp.ToString();


                    boxGeneralButtons.Enabled  = true;
                    boxDataButtons.Enabled     = true;
                    boxPropertyButtons.Enabled = true;
                    selectedExport             = exp;
                    selectedPackage            = package;

                    DrawGrid(package, exp);
                }
            }
        }