public SignallController(int size) { Internal = new SignalsModel(size); View = new SignalViewState(Internal); ViewChanged = () => { }; SignChanged = () => { }; }
private Panel GetSignalFrame(SignalsModel manager, SinSignal signal, int i) { var frame = new Panel { BorderStyle = BorderStyle.FixedSingle, Height = frameHeight, Width = Width - 20 }; var delButton = new Button { Dock = DockStyle.Bottom, Text = "Удалить" }; delButton.Click += (sender, ev) => { new SignalDeleteConfirm(manager, signal).ShowDialog(); }; var formula = new Label { Dock = DockStyle.Top, Text = manager.Signals[i].Options.GetTextFormula(), Font = new Font("Arial", 10) }; frame.Controls.Add(formula); frame.Controls.Add(delButton); Controls.Add(frame); return(frame); }
public SignalViewState(SignalsModel manager, SignalViewType current) { views = new Dictionary <SignalViewType, ISignalsVisualizer>(); SetView(new AloneVisualizer(manager.Sum), SignalViewType.Summarized); SetView(new ManagerVisualizer(manager), SignalViewType.Divided); var divided = new List <SignalViewOptions>(); CurrentType = current; }
public ManagerVisualizer(SignalsModel manager) { options = new List <SignalViewOptions>(); options.AddRange(manager.Signals.Select((s) => new SignalViewOptions(s))); //manager.AddedSignal += (signal) => { options.Add(new SignalViewOptions(signal)); }; //manager.DeletedSignal += (signal) => { // for (var i = 0; i < options.Count; i++) // if (options[i].Signal.Equals(signal)) // { // options.RemoveAt(i); // break; // } //}; }
public SumSignal(SignalsModel main) { manager = main; }
public SignalViewState(SignalsModel manager) : this(manager, DEFAULT_VIEW) { }