public void LoadEle(EleCylinder newEle) { if (newEle != null) { EleName = newEle.Name; EleDescription = newEle.Description; EleType = newEle.Type; CurEle = newEle; label1.BackColor = Color.Lime; } else { label1.BackColor = Color.LightGray; } }
private void labelName_Click(object sender, EventArgs e) { if (CurEle == null) { return; } var configControl = new EleCylinderConfigControl(); configControl.StartPosition = FormStartPosition.CenterParent; configControl.LoadCylinder(CurEle); configControl.ShowDialog(); EleType = CurEle.Type; }
private void viewToolStripMenuItem_Click(object sender, EventArgs e) { var ele = new ElePropsForm() { Element = CurEle }; if (ele.ShowDialog() == DialogResult.OK) { var axis = ele.Element as EleCylinder; var props = typeof(EleCylinder).GetProperties(); foreach (var p in props) { p.SetValue(CurEle, p.GetValue(axis)); } EleType = CurEle.Type; } }