public void update_input() { // inputs_tab.Clear(); selections_tab.Clear(); //outputs_tab.Clear(); int i = 0; foreach (Terminal terminal in inputStack.Children) { inputs_tab[i] = (false); if (terminal.wires.Count != 0) { Wireclass wire = (Wireclass)terminal.wires[0]; if (!terminal.IsInversed) { inputs_tab[i] = wire.state; } else { inputs_tab[i] = !wire.state; } } else { if (terminal.IsInversed) { inputs_tab[i] = true; } } i++; } foreach (Terminal terminal in selectionStack.Children) { inputs_tab.Add(false); if (terminal.wires.Count != 0) { Wireclass wire = (Wireclass)terminal.wires[0]; if (!terminal.IsInversed) { selections_tab[i] = wire.state; } else { selections_tab[i] = !wire.state; } } else { if (terminal.IsInversed) { selections_tab[i] = true; } } i++; } }
public void relier(object sender, MouseButtonEventArgs e) { Terminal terminal = UserClass.TryFindParent <Terminal>((Ellipse)sender); StandardComponent componentPere = UserClass.TryFindParent <StandardComponent>((Ellipse)sender); Canvas canvas = UserClass.TryFindParent <Canvas>((terminal)); Wireclass wire = new Wireclass(); wire.relier(); }
public void RemoveInputs() { Terminal terminal = null; Wireclass wire = null; foreach (Terminal tmp in inputStack.Children) { terminal = tmp; } foreach (Wireclass tmp in terminal.wires) { wire = tmp; } if (wire != null) { wire.Destroy(); } inputStack.Children.Remove(terminal); inputs_tab.RemoveAt(1); }