// PRIVATES METHODS private void StoreSelection(GameObject mayebSelection) { var placeholder = mayebSelection.GetComponent <InputPlaceholder>(); if (placeholder == null) { return; } if (selectionA == null) { selectionA = placeholder; } else if (selectionB == null) { selectionB = placeholder; } if (selectionA != null && selectionB != null) { simulation.CreateSwapQuery(selectionA.GridPosition, selectionB.GridPosition); selectionA = null; selectionB = null; } }
public MainForm() { machine = new EncryptionMachine.Machine(); if (!machine.Compile(ExampleCode(), out machineContext)) { return; } InitializeComponent(); serviceSelector.Items.AddRange(servicesList); Array.ForEach(new Control[] { masterInput, loginInput, serviceSelector, algoSelector }, (w) => { w.TextChanged += Input_TextChanged; w.GotFocus += InputPlaceholder.GotFocus; w.LostFocus += InputPlaceholder.LostFocus; InputPlaceholder.LostFocus(w, null); }); masterInput.GotFocus += MasterInput_GotFocus; masterInput.LostFocus += MasterInput_LostFocus; //this.Load += MainForm_Load; }