Esempio n. 1
0
        private void button5_Click(object sender, EventArgs e)
        {
            Form2 form = new Form2();

            form.Location      = this.Location;
            form.StartPosition = FormStartPosition.Manual;
            form.FormClosing  += delegate { this.Show(); };
            form.Show();
            this.Hide();

            OnAdd?.Invoke(sender, e);

            foreach (Ticket ticket in bought.GetTickets())
            {
                form.listBox1.Items.Add(ticket.Numb + " \" " + ticket.Name + "\" " + ". " + ticket.Date + " " + ticket.Row + "-ый ряд " + ticket.Seat + "-ое место, " + ticket.Place);
            }

            if (tag == true)
            {
                ShowTickets(sender, e);
            }
            else
            {
                listBox1.Items.Clear();
                foreach (Ticket ticket in tickets.GetTickets())
                {
                    listBox1.Items.Add(ticket.Numb + " \" " + ticket.Name + "\" " + ". " + ticket.Cost + "руб. " + ticket.Date + " " + ticket.Row + "-ый ряд " + ticket.Seat + "-ое место, " + ticket.Place + ", сейчас " + ticket.Vacant);
                }
            }
        }
Esempio n. 2
0
        private void RegisterCallbacks()
        {
            duplicateButton.onClick.AddListener(() => OnDuplicate?.Invoke());
            addButton.onClick.AddListener(() => OnAdd?.Invoke());
            removeButton.onClick.AddListener(() => OnRemove?.Invoke());
            moveUpButton.onClick.AddListener(() => OnMoveUp?.Invoke());
            moveDownButton.onClick.AddListener(() => OnMoveDown?.Invoke());

            RegisterSegmentedControlCallbacks(eventTypeSelect);
            RegisterSegmentedControlCallbacks(qualRankSelect);
            RegisterSegmentedControlCallbacks(inLimitSelect);
            RegisterSegmentedControlCallbacks(preQualLimitSelect);
            RegisterSegmentedControlCallbacks(preQualRankSelect);
            RegisterSegmentedControlCallbacks(ordRankSelect);
            RegisterSegmentedControlCallbacks(hillSurfaceSelect);

            presetsDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke());
            hillsDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke());
            hillsDropdown.onValueChanged.AddListener(arg => ShowInfo());
            inLimitInput.onEndEdit.AddListener(arg => OnCurrentEventChanged?.Invoke());
            qualRankDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke());
            preQualLimitInput.onEndEdit.AddListener(arg => OnCurrentEventChanged?.Invoke());
            preQualRankDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke());
            ordRankDropdown.onValueChanged.AddListener(arg => OnCurrentEventChanged?.Invoke());

            hillsSearch.OnValueChanged += data => { OnCurrentEventChanged?.Invoke(); };
        }
Esempio n. 3
0
        public override bool Add(Key key, Element element)
        {
            bool success = base.Add(key, element);

            OnAdd?.Invoke(key, element);
            return(success);
        }
Esempio n. 4
0
        protected void add(string key, T item)
        {
            this._entries.Add(key, item);
            item.Owner = this;

            OnAdd?.Invoke(this, new ReferenceChangedEventArgs(item));
        }
Esempio n. 5
0
 public new void Add(TKey key, TValue value)
 {
     base.Add(key, value);
     OnAdd?.Invoke(key, value);
     OnSet?.Invoke(key, value);
     ItemsChanged?.Invoke();
 }
Esempio n. 6
0
        public new TValue this[TKey key]
        {
            get
            {
                return(base[key]);
            }
            set
            {
                Boolean succesfull = TryGetValue(key, out TValue val);

                if (succesfull && val?.Equals(value) == true)
                {
                    return;
                }

                base[key] = value;

                if (succesfull)
                {
                    OnChange?.Invoke(key, value);
                }
                else
                {
                    OnAdd?.Invoke(key, value);
                }

                OnSet?.Invoke(key, value);
                ItemsChanged?.Invoke();
            }
        }
Esempio n. 7
0
    /// <summary>
    /// Add item to the list
    /// </summary>
    public void Add(T value)
    {
        lock (syncRoot)
            list.Add(value);

        OnAdd?.Invoke(state, value);
    }
Esempio n. 8
0
 public new void Insert(Int32 index, T item)
 {
     base.Insert(index, item);
     OnAdd?.Invoke(ref item);
     OnInsert?.Invoke(index, ref item);
     ItemsChanged?.Invoke();
 }
Esempio n. 9
0
        public void Add(Viewport item)
        {
            this._entries.Add(item.Handle, item);
            item.Owner = this.Owner;

            OnAdd?.Invoke(this, new ReferenceChangedEventArgs(item));
        }
Esempio n. 10
0
        public void OnDeserializeAll(NetworkReader reader)
        {
            // This list can now only be modified by synchronization
            IsReadOnly = true;

            // if init,  write the full list content
            int count = (int)reader.ReadPackedUInt32();

            objects.Clear();
            changes.Clear();
            OnClear?.Invoke();

            for (int i = 0; i < count; i++)
            {
                T obj = reader.Read <T>();
                objects.Add(obj);
                OnAdd?.Invoke(obj);
            }

            // We will need to skip all these changes
            // the next time the list is synchronized
            // because they have already been applied
            changesAhead = (int)reader.ReadPackedUInt32();
            OnChange?.Invoke();
        }
Esempio n. 11
0
        public void Add(StatefulObject o, int id)
        {
            o.ID = id;
            statefulObjects[id] = o;

            OnAdd?.Invoke(o);
        }
Esempio n. 12
0
 public void InvokeOnAdd(object item, object index)
 {
     if (OnAdd != null)
     {
         OnAdd.Invoke(this, new KeyValueEventArgs <T, string>((T)item, (string)index));
     }
 }
Esempio n. 13
0
        public void Add(string value)
        {
            (ValidationResult, MarkupString)? validation = _validator?.Invoke(value);
            if (validation?.Item1 == ValidationResult.Invalid)
            {
                return;
            }

            string?transformed = _transformer?.Invoke(value);

            if (transformed != null)
            {
                value = transformed;
            }

            if (_preventDuplicates && _values.Contains(value))
            {
                if (_moveDuplicatesToEnd)
                {
                    _values.Remove(value);
                    _values.Add(value);
                }

                return;
            }

            _values.Add(value);
            OnAdd?.Invoke(value);
            OnUpdate?.Invoke(_values);
        }
 public void Add(IStock stock)
 {
     if (Stocks.Where(a => a.ID == stock.ID).Count() == 0)
     {
         Stocks.Add(stock);
         OnAdd?.Invoke();
     }
 }
Esempio n. 15
0
 private void Start()
 {
     AddButton.onClick.AddListener(() => OnAdd?.Invoke(Index));
     RemoveButton.onClick.AddListener(() => OnRemove?.Invoke(Index));
     MoveDownButton.onClick.AddListener(() => OnMoveDown?.Invoke(Index));
     MoveUpButton.onClick.AddListener(() => OnMoveUp?.Invoke(Index));
     TypeDropdown.onValueChanged.AddListener(FireTypeChangedEvent);
 }
Esempio n. 16
0
        public void Add(Item item, int amount)
        {
            int currentAmount = _items.GetValueOrDefault(item, 0);

            _items[item] = currentAmount + amount;

            OnAdd?.Invoke(item);
        }
Esempio n. 17
0
 /// <summary>
 /// Adds a child to this container
 /// </summary>
 /// <param name="container">Container</param>
 public virtual void AddChild(BaseContainer container)
 {
     container.ParentContainer = this;
     Children.Add(container);
     Controls.Add(container);
     container.BringToFront();
     OnAdd?.Invoke(container);
 }
Esempio n. 18
0
 public new void Add(T item)
 {
     if (Contains(item) is false)
     {
         OnAdd?.Invoke(item);
         base.Add(item);
     }
 }
Esempio n. 19
0
 public void Add(RuntimeItem <T> item)
 {
     if (!Items.Contains(item))
     {
         Items.Add(item);
         OnAdd?.Invoke(item);
     }
 }
Esempio n. 20
0
 public bool Add(T item)
 {
     if (_set.Add(item))
     {
         OnAdd?.Invoke(this, item);
         return(true);
     }
     return(false);
 }
        new public void Add(TKey key, TValue value)
        {
            base.Add(key, value);
            Dictionary <TKey, TValue> add = new Dictionary <TKey, TValue>();

            add.Add(key, value);
            OnAdd?.Invoke(this, add);
            OnDictionaryChanged?.Invoke(this);
        }
Esempio n. 22
0
        public void Add(StatefulObject o)
        {
            int id = statefulObjects.Count + 1;

            o.ID = id;
            statefulObjects[id] = o;

            OnAdd?.Invoke(o);
        }
Esempio n. 23
0
        public new TValue AddOrUpdate(TKey key, TValue addValue, Func <TKey, TValue, TValue> updateValueFactory)
        {
            if (!ContainsKey(key))
            {
                OnAdd.Invoke(this, new KeyValuePair <TKey, TValue>(key, addValue));
            }
            var res = base.AddOrUpdate(key, addValue, updateValueFactory);

            return(res);
        }
Esempio n. 24
0
 /// <summary>
 /// 新建按钮方法
 /// </summary>
 public void Add()
 {
     if (OnAdd != null)
     {
         EditModel = OnAdd.Invoke() ?? new TItem();
     }
     SelectedItems.Clear();
     EditModalTitleString = AddModalTitle;
     EditModal?.Toggle();
 }
Esempio n. 25
0
 public bool Add(T item)
 {
     if (objects.Add(item))
     {
         OnAdd?.Invoke(item);
         AddOperation(Operation.OP_ADD, item);
         return(true);
     }
     return(false);
 }
Esempio n. 26
0
        private void DeserializeAdd(NetworkReader reader, bool apply)
        {
            T item = reader.Read <T>();

            if (apply)
            {
                objects.Add(item);
                OnAdd?.Invoke(item);
            }
        }
    MagicalSpell Add()
    {
        var instance = Create();

        Elements.Add(instance);

        OnAdd?.Invoke(instance);

        return(instance);
    }
Esempio n. 28
0
        public override bool Add(Element element)
        {
            if (base.Add(element))
            {
                OnAdd?.Invoke(element);
                return(true);
            }

            return(false);
        }
Esempio n. 29
0
        public bool Add(T item)
        {
            bool successful = currentSet.Add(item);

            if (successful)
            {
                OnAdd?.Invoke(item);
            }
            return(successful);
        }
Esempio n. 30
0
        internal new void Add(T item)
        {
            OnAdd?.Invoke(item, null);

            /*if (null != OnAdd)
             * {
             *  OnAdd(item, null);
             * }*/
            base.Add(item);
        }