예제 #1
0
        internal FluxAnalysisEditorDialog(FluxAnalysisData fluxAnalysis)
        {
            InitializeComponent();
            DialogResult = DialogResult.Cancel;

            Text                       = Language.FluxAnalysisEditorDialog.Text;
            labelName.Text             = Language.FluxAnalysisEditorDialog.LabelName;
            labelCenterWavelength.Text = Language.FluxAnalysisEditorDialog.LabelCenterWavelength;
            labelWavelengthSpan.Text   = Language.FluxAnalysisEditorDialog.LabelWavelengthSpan;
            labelPointNum.Text         = Language.FluxAnalysisEditorDialog.LabelPointNum;
            labelFluxDirection.Text    = Language.FluxAnalysisEditorDialog.LabelFluxDirection;
            labelCenter.Text           = Language.FluxAnalysisEditorDialog.LabelCenter;
            labelSize.Text             = Language.FluxAnalysisEditorDialog.LabelSize;
            buttonOK.Text              = Language.DialogGeneral.ButtonOK;
            buttonCancel.Text          = Language.DialogGeneral.ButtonCancel;

            comboBoxFluxDirection.DataSource = Enum.GetValues(typeof(Direction));
            FluxAnalysis = new FluxAnalysisData(fluxAnalysis);
            textBoxName.DataBindings.Add("Text", FluxAnalysis, "Name");
            numericUpDownCenterWavelength.DataBindings.Add("Value", this, "CenterWavelength");
            numericUpDownWavelengthSpan.DataBindings.Add("Value", this, "WavelengthSpan");
            numericUpDownPointNum.DataBindings.Add("Value", this, "PointNum");
            comboBoxFluxDirection.DataBindings.Add("SelectedItem", FluxAnalysis, "FluxDirection");
            vectorEditorCenter.DataBindings.Add("Value", FluxAnalysis, "Center");
            vectorEditorSize.DataBindings.Add("Value", FluxAnalysis, "Size");
        }
        private void toolStripButtonAdd_Click(object sender, EventArgs e)
        {
            ListBox         box  = (sender as ToolStripButton).Tag as ListBox;
            ProjectDataBase data = null;

            if (box == listBoxSrc)
            {
                data = new SourceData();
            }
            else if (box == listBoxFlx)
            {
                data = new FluxAnalysisData();
            }
            else if (box == listBoxVis)
            {
                data = new VisualizationOutputData();
            }
            else
            {
                return;
            }
            box.Items.Add(data);
        }