private void ModelTreeNodeClick(object sender, EventArgs e) { ModelChooserDialog mcd = new ModelChooserDialog(_projectType); //if (Program.MainWindow.CurrentWizard != null) // Program.MainWindow.CurrentWizard.DialogOpened(mcd); DialogResult result = mcd.ShowDialog(); if (result == DialogResult.OK) { this._description.model = AvailableAssemblies.getModel(mcd.Selection.plugin.className); ((ButtonTreeNode)this.Nodes[1]).Value = this._description.model; ((Button)sender).Text = ButtonTreeNode.getButtonString(this._description.model); this.ProjectType = this._description.model.ProjectType; } //if (Program.MainWindow.CurrentWizard != null) // Program.MainWindow.CurrentWizard.DialogClosed(); mcd.Dispose(); this.TreeView.Invalidate(); }
//private void GroupsTreeNodeClick(object sender, EventArgs e) { // GroupsDialog groupsDialog = new GroupsDialog(this.GroupsDefinition, this._description.model.GroupsDefinition); // if (groupsDialog.ShowDialog() == DialogResult.OK) { // this._description.groupsDefinition = groupsDialog.GroupsDefinition; // ((ButtonTreeNode)this.Nodes[2]).Value = this._description.groupsDefinition; // ((Button)sender).Text = ButtonTreeNode.getButtonString(this._description.groupsDefinition); // } // groupsDialog.Dispose(); // this.TreeView.Invalidate(); //} //private bool GroupsValidation(ButtonTreeNode node) { // bool result = node.Value != null; // if (result) { // int zeroCount = 0; // foreach (GroupDefinition gd in (GroupDefinition[])node.Value) { // if (gd.kind == 1) zeroCount++; //sample // } // result = zeroCount > 0; // } // if (result) // node.ButtonControl.BackColor = Color.White; // else // node.ButtonControl.BackColor = SystemColors.Control; // return result; //} private void SpectraTreeNodeClick(object sender, EventArgs e) { SpectraDialog sd; //if (this._description.spectraPaths != null) { sd = new SpectraDialog(this._description.spectraPaths); //} if (sd.ShowDialog() == DialogResult.OK) { this._description.spectraPaths = new string[sd.spectraList.Items.Count]; for (int i = 0; i < sd.spectraList.Items.Count; i++) { this._description.spectraPaths[i] = (string)sd.spectraList.Items[i]; } //this._description.spectraPaths = sd.SpectraFiles; ButtonTreeNode treeNode = (ButtonTreeNode)(this.Nodes.Find("Spectra", false)[0]); treeNode.Value = this._description.spectraPaths; ((Button)sender).Text = ButtonTreeNode.getButtonString(this._description.spectraPaths); } sd.Dispose(); this.TreeView.Invalidate(); }