private void FormModelSelect_Load(object sender, EventArgs e) { for (int i = 0; i < m_lstDebugModel.Count; i++) { dgvFunction.Rows.Add( DebugOperate.GetProperty(m_lstDebugModel[i], "ModelName"), DebugOperate.GetProperty(m_lstDebugModel[i], "ModelDesc") ); } lblModelCount.Text = $"模块数量: {m_lstDebugModel.Count}"; btnSelect.Enabled = m_lstDebugModel.Count != 0; }
private void BtnRefresh_Click(object sender, EventArgs e) { //刷新控件信息 for (int i = 0; i < dgvControl.Rows.Count; i++) { dgvControl.Rows[i].Cells["Text"].Value = (dgvControl.Rows[i].Cells["Object"].Value as Control).Text; } //刷新变量属性数值 for (int i = 0; i < dgvFP.Rows.Count; i++) { string type = (dgvFP.Rows[i].Cells["类型"].Value as string).Substring(0, 2); string name = dgvFP.Rows[i].Cells["Name"].Value as string; if (type == "变量") { dgvFP.Rows[i].Cells["Value"].Value = DebugOperate.GetField(m_projectObject, name); } else { dgvFP.Rows[i].Cells["Value"].Value = DebugOperate.GetProperty(m_projectObject, name); } } }