Beispiel #1
0
        private void menuItemRating_Click(object sender, EventArgs e)
        {
            if (this.HeatExchangerCtrl.HeatExchanger.CurrentRatingModel != null)
            {
                this.comboBoxCalculationType.Enabled = false;
                this.comboBoxExchangerType.Enabled   = false;

                if (this.ratingEditor == null)
                {
                    if (this.HeatExchangerCtrl.HeatExchanger.ExchangerType == ExchangerType.SimpleGeneric)
                    {
                        this.ratingEditor = new HXRatingSimpleGenericEditor(this.HeatExchangerCtrl);
                    }
                    else if (this.HeatExchangerCtrl.HeatExchanger.ExchangerType == ExchangerType.PlateAndFrame)
                    {
                        this.ratingEditor = new HXRatingPlateAndFrameEditor(this.HeatExchangerCtrl);
                    }
                    else if (this.HeatExchangerCtrl.HeatExchanger.ExchangerType == ExchangerType.ShellAndTube)
                    {
                        this.ratingEditor = new HXRatingShellAndTubeEditor(this.HeatExchangerCtrl);
                    }
                    else
                    {
                        this.ratingEditor = new HeatExchangerRatingEditor(this.HeatExchangerCtrl);
                    }
                    this.ratingEditor.Owner   = this;
                    this.ratingEditor.Closed += new EventHandler(ratingEditor_Closed);
                    this.ratingEditor.Show();
                }
                else
                {
                    if (this.ratingEditor.WindowState.Equals(FormWindowState.Minimized))
                    {
                        this.ratingEditor.WindowState = FormWindowState.Normal;
                    }
                    this.ratingEditor.Activate();
                }
            }
        }
Beispiel #2
0
 private void ratingEditor_Closed(object sender, EventArgs e)
 {
     this.ratingEditor = null;
     this.comboBoxCalculationType.Enabled = true;
     this.comboBoxExchangerType.Enabled   = true;
 }