Example #1
0
 private void addCollection_Click(object sender, RoutedEventArgs e)
 {
     if (OnAddEvent != null)
     {
         OnAddEvent.Invoke(this, e);
     }
 }
Example #2
0
        private void DialogAdd_mAddEvent(object sender, OnAddEvent e)
        {
            Vehicle v = e.Vehicle;

            if (v == null)
            {
                return;
            }
            AddVehicle(v);
        }
Example #3
0
        private void _Add(Queue <T> launchers, List <T> boots)
        {
            while (launchers.Count > 0)
            {
                var launcher = launchers.Dequeue();
                boots.Add(launcher);
                launcher.Launch();

                OnAddEvent?.Invoke(launcher);
            }
        }
Example #4
0
        private void btnChange_Click(object sender, EventArgs e)
        {
            var name = tbName.Text;
            var cost = tbCount.Text;

            if (!(name != "" & cost != ""))
            {
                return;
            }
            OnAddEvent?.Invoke(name, _date, Convert.ToDouble(tbCount.Text));
            Close();
        }
        public bool Add(EventModel ev)
        {
            if (ev.ID == 0)
            {
                ev.ID = _events.Count + 1;
            }
            //检查重复ID
            if (_events.ContainsKey(ev.ID))
            {
                return(false);
            }
            //检查条件输入是否无误
            if (ev.Condition != null && !ev.Condition.Check().IsValid)
            {
                Debug.WriteLine("条件输入验证不通过");
                return(false);
            }
            _events.Add(ev.ID, ev);

            OnAddEvent?.Invoke(ev);
            return(true);
        }