private void InstructionPicker_SelectedIndexChanged(object sender, EventArgs e) { if (InstructionPicker.Text == @"Single Address") { OneAddressInstruction oneaddress = new OneAddressInstruction(ScopeVariable, Variable) { Dock = DockStyle.Fill }; InstructionPanel.Controls.Clear(); InstructionPanel.Controls.Add(oneaddress); Instruction = oneaddress.SingleInstruction; Instruction.InstructionType = Enums.InstructionType.SingleAddress; } else if (InstructionPicker.Text == @"Three Address") { ThreeAddressInstructionControl threeAddress = new ThreeAddressInstructionControl(ScopeVariable, Variable) { Dock = DockStyle.Fill }; InstructionPanel.Controls.Clear(); InstructionPanel.Controls.Add(threeAddress); Instruction = threeAddress.ThreeAddressInstruction; Instruction.InstructionType = Enums.InstructionType.ThreeAddress; } }
public InstructionControl(List <Variable> scopeVariable, Variable selectedVariable) { InitializeComponent(); Variable = selectedVariable; ScopeVariable = scopeVariable; OneAddressInstruction oneaddress = new OneAddressInstruction(ScopeVariable, Variable) { Dock = DockStyle.Fill }; InstructionPanel.Controls.Clear(); InstructionPanel.Controls.Add(oneaddress); Instruction = oneaddress.SingleInstruction; Instruction.InstructionType = Enums.InstructionType.SingleAddress; }