private void bind_BindingComplete(object sender, BindingCompleteEventArgs e) { if (e.Binding.BindingMemberInfo.BindingField.Equals("Name", StringComparison.OrdinalIgnoreCase)) { AntennaEntity current = this.m_myCurrency.Current as AntennaEntity; this.dgv_HGain.DataSource = current.HoriAtt; this.dgv_VGain.DataSource = current.VertAtt; Rectangle rectangle = new Rectangle(this.panel_HGain.Location, this.panel_HGain.Size); DrawGain gain = new DrawGain(current.HoriAttData, current.Gain, rectangle.Width, rectangle.Height); this.panel_HGain.BackgroundImageLayout = ImageLayout.Zoom; this.panel_HGain.BackgroundImage = gain.DrawGains(); rectangle = new Rectangle(this.panel_VGain.Location, this.panel_VGain.Size); gain = new DrawGain(current.VertAttData, current.Gain, rectangle.Width, rectangle.Height); this.panel_VGain.BackgroundImageLayout = ImageLayout.Zoom; this.panel_VGain.BackgroundImage = gain.DrawGains(); this.btn_App.Enabled = false; } if (e.Binding.PropertyName.Equals("Value", StringComparison.OrdinalIgnoreCase)) { this.btn_App.Enabled = false; } }
private void GainDataBindingCompleted(object sender, DataGridViewBindingCompleteEventArgs e) { if (!this.m_BatchUpdate) { Panel panel; float[] horiAttData; AntennaEntity antenna = this.m_AnttenaProperty.Data.Antenna; if (sender == this.dgv_HGain) { panel = this.panel_HGain; this.GetGainTableFromGridView(antenna.HoriAttData, this.dgv_HGain); horiAttData = antenna.HoriAttData; } else { panel = this.panel_VGain; this.GetGainTableFromGridView(antenna.VertAttData, this.dgv_VGain); horiAttData = antenna.VertAttData; } Rectangle rectangle = new Rectangle(panel.Location, panel.Size); DrawGain gain = new DrawGain(horiAttData, antenna.Gain, rectangle.Width, rectangle.Height); panel.BackgroundImageLayout = ImageLayout.Zoom; panel.BackgroundImage = gain.DrawGains(); } }