BesAsm.Swsp.PacSizingTool.Form1.ToggleUIParameters C# (CSharp) Метод

ToggleUIParameters() приватный Метод

private ToggleUIParameters ( Facility facility ) : void
facility Facility
Результат void
        private void ToggleUIParameters(Facility facility)
        {
            bool sloped = facility.Type == FacilityType.PlanterSloped ||
            facility.Type == FacilityType.Swale;

              txtRockStorageDepth.Enabled = facility.HasRockStorage;
              txtRockVoidRatio.Enabled = facility.HasRockStorage;

              txtRockStorageBottomArea.Enabled = facility.HasCustomRockStorageBottomArea;
              if (facility.HasCustomRockStorageBottomArea)
            txtRockStorageBottomArea.Text = facility.RockStorageBottomAreaSqFt.ToString();

              txtFreeboardDepth.Enabled = facility.SpecifyFreeboard;

              txtStorageDepth1.Enabled = !sloped; //Added per conversation with Richard Davies 10/2/14

              txtStorageDepth2.Enabled = facility.HasSecondaryOverflow;

              if (facility.HasRockStorage)
              {
              txtStorageDepth3.Enabled = !facility.HasRockInfluencedSurfaceStorage ||
            (sloped && facility.Configuration == FacilityConfiguration.C); //Added per conversation with Richard Davies 10/2/14
              }
              else
              txtStorageDepth3.Enabled = false;

              txtSideSlope.Enabled = facility.SpecifySideSlope;

              cmbFacilityShape.Enabled = facility.AllowShapeSelection;

              txtSurfaceAreaAtDepth1.Enabled = facility.Shape == FacilityShape.UserDefined;
              txtBottomPerimeterLength.Enabled = facility.Shape == FacilityShape.Amoeba;
              txtSurfaceAreaAtDepth2.Enabled = facility.Shape == FacilityShape.UserDefined && facility.Configuration == FacilityConfiguration.E;

              btnShowSFWS.Enabled = sloped;
              txtRockStorageBottomArea.Enabled = !sloped && facility.HasCustomRockStorageBottomArea;
              txtBottomArea.Enabled = !sloped;

              txtBottomWidth.Enabled = !sloped && facility.Shape != FacilityShape.Amoeba && facility.Shape != FacilityShape.UserDefined;

              btnCalculate.Enabled = true;
              textBox1.ForeColor = SystemColors.WindowText;
              textBox1.Font = new Font(textBox1.Font, FontStyle.Regular);

              textBox1.Text = "Valid facility configuration";
        }