Esempio n. 1
0
 public void AddSignal(SinSignal sinSignal)
 {
     Internal.AddSignal(sinSignal);
     View.AddSignal(sinSignal, SignalViewType.Divided);
     ViewChanged();
     SignChanged();
 }
Esempio n. 2
0
        public SignalDeleteConfirm(SignalManager manager, SinSignal signal)
        {
            MaximumSize = new Size(400, 300);
            MinimumSize = new Size(400, 300);

            var message = new Label
            {
                Width    = 250,
                Text     = "Вы уверены что хотите удалить сигнал " + signal.Options.GetTextFormula() + " из списка сигналов.",
                Location = new Point(50, 100)
            };

            var okButton = new Button
            {
                Location = new Point(100, 150),
                Text     = "Да"
            };

            okButton.Click += (sender, ev) => {
                manager.DeleteSignal(signal);
                Close();
            };

            var cancelButton = new Button()
            {
                Location = new Point(200, 150),
                Text     = "Нет"
            };

            cancelButton.Click += (sender, ev) => { Close(); };

            Controls.Add(message);
            Controls.Add(okButton);
            Controls.Add(cancelButton);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        public void AddSignal(SinSignal signal)
        {
            Signals.Add(signal);

            if (AddedSignal != null)
            {
                AddedSignal(signal);
            }
        }
Esempio n. 5
0
        //public SinSignal GetSignalById(int id)
        //{
        //    return Signals.Where(s => s.ID == id).First();
        //}

        //public void DeleteSignalById(int id)
        //{
        //    var index = Signals.Where(s => s.ID == id).First().ID;
        //    Signals.RemoveAt(id);
        //}

        public void DeleteSignal(SinSignal signal)
        {
            var i = Signals.IndexOf(signal);

            if (i >= 0)
            {
                Signals.RemoveAt(i);
            }

            //if (AddedSignal != null)
            //    DeletedSignal(signal);
        }
Esempio n. 6
0
 //не будет никакого эффекта, т.к. в одиночный сигнал нельзя добавлять сигналы
 public void AddSignal(SinSignal signal)
 {
     return;
 }
Esempio n. 7
0
 public void AddSignal(SinSignal signal, SignalViewType type)
 {
     views[type].AddSignal(signal);
 }
Esempio n. 8
0
 public void AddSignal(SinSignal signal)
 {
     options.Add(new SignalViewOptions(signal));
 }