public void InitializeSonicBoomView() { SonicBoomWeatherParametersContainer = new WeatherParametersContainer( textBox24, textBox22, textBox23, AddSonicBoomWeatherParameterButton, ModifySonicBoomWeatherParameterButton, DeleteSonicBoomWeatherParameterButton, ApplySonicBoomWeatherParametersButton, SonicBoomWeatherParametersListBox, x => SonicBoomWeatherParameters = x); foreach (var grid in GetControls(SonicBoomTabPage, typeof(DataGridView)).Cast <DataGridView>()) { grid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None; for (int i = 0; i < grid.Columns.Count; i++) { grid.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.None; } } VehicleSonicBoomBallisticsForm = new SonicBoomBallisticsForm(Part.Vehicle); RocketSonicBoomBallisticsForm = new SonicBoomBallisticsForm(Part.Rocket); Dictionary <Button, Control> DropDownControls = new Dictionary <Button, Control>() { { RocketSonicBoomParametersButton, RocketSonicBoomParametersPanel }, { VehicleSonicBoomParametersButton, VehicleSonicBoomParametersPanel }, { SonicBoomWeatherParametersButton, SonicBoomWeatherParametersPanel } }; foreach (var b in DropDownControls.Keys) { b.ImageList = ButtonsImageList; b.ImageIndex = 0; b.ImageAlign = ContentAlignment.MiddleRight; b.Click += (sender, e) => { DropDownControls[b].Visible = !DropDownControls[b].Visible; b.ImageIndex = DropDownControls[b].Visible ? 1 : 0; }; } ; }
public void InitializeFireTestNoiseView() { FireTestGraphPane = zedGraphControl2.GraphPane; FireTestGraphPane.IsFontsScaled = false; FireTestGraphPane.Title.IsVisible = false; FireTestGraphPane.XAxis.Title.Text = "X, м"; FireTestGraphPane.XAxis.MajorGrid.IsVisible = true; FireTestGraphPane.XAxis.MinorGrid.IsVisible = true; FireTestGraphPane.XAxis.MajorGrid.DashOff = 1; FireTestGraphPane.XAxis.MinorGrid.DashOff = 1; FireTestGraphPane.YAxis.Title.Text = "Y, м"; FireTestGraphPane.YAxis.MajorGrid.IsVisible = true; FireTestGraphPane.YAxis.MinorGrid.IsVisible = true; FireTestGraphPane.YAxis.MajorGrid.DashOff = 1; FireTestGraphPane.YAxis.MinorGrid.DashOff = 1; FireTestNoiseWeatherParametersContainer = new WeatherParametersContainer( textBox16, textBox14, textBox15, AddFireTestNoiseWeatherParameterButton, ModifyFireTestNoiseWeatherParameterButton, DeleteFireTestNoiseWeatherParameterButton, ApplyFireTestNoiseWeatherParametersButton, FireTestNoiseWeatherParametersListBox, ApplyFireTestNoiseWeatherParameters); FireTestNoiseFlowParametersContainer = new FlowParametersContainer( FireTestNoiseMassFlowTextBox, FireTestNoiseNozzleDiameterTextBox, FireTestNoiseNozzleMachNumberTextBox, FireTestNoiseNozzleFlowVelocityTextBox, FireTestNoiseChamberSoundVelocityTextBox, FireTestNoiseNozzleAdiabaticIndexTextBox); FireTestNoiseSoundLevelContainer = new SoundLevelContainer( textBox9, textBox10, textBox11, textBox12, textBox13, AddFireTestNoiseSoundLevelButton, ModifyFireTestNoiseSoundLevelButton, DeleteFireTestNoiseSoundLevelButton, ApplyFireTestNoiseSoundLevelsButton, SetFireTestNoiseSoundLevelColorButton, FireTestNoiseSoundLevelsListBox, ApplyFireTestNoiseSoundLevels); foreach (var grid in GetControls(FlightNoiseTabPage, typeof(DataGridView)).Cast <DataGridView>()) { grid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None; for (int i = 0; i < grid.Columns.Count; i++) { grid.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.None; } } Dictionary <Button, Control> DropDownControls = new Dictionary <Button, Control>() { { FireTestNoiseEngineParametersButton, FireTestNoiseEngineParametersPanel }, { FireTestFrequencyBandButton, FireTestFrequencyBandPanel }, { FireTestCalculationAreaButton, FireTestCalculationAreaPanel }, { FireTestNoiseWeatherParametersButton, FireTestNoiseWeatherParametersPanel }, { FireTestNoiseLevelsButton, FireTestNoiseLevelsPanel } }; foreach (var b in DropDownControls.Keys) { b.ImageList = ButtonsImageList; b.ImageIndex = 0; b.ImageAlign = ContentAlignment.MiddleRight; b.Click += (sender, e) => { DropDownControls[b].Visible = !DropDownControls[b].Visible; b.ImageIndex = DropDownControls[b].Visible ? 1 : 0; }; } ; }