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); } } }
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(); }; }
public override bool Add(Key key, Element element) { bool success = base.Add(key, element); OnAdd?.Invoke(key, element); return(success); }
protected void add(string key, T item) { this._entries.Add(key, item); item.Owner = this; OnAdd?.Invoke(this, new ReferenceChangedEventArgs(item)); }
public new void Add(TKey key, TValue value) { base.Add(key, value); OnAdd?.Invoke(key, value); OnSet?.Invoke(key, value); ItemsChanged?.Invoke(); }
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(); } }
/// <summary> /// Add item to the list /// </summary> public void Add(T value) { lock (syncRoot) list.Add(value); OnAdd?.Invoke(state, value); }
public new void Insert(Int32 index, T item) { base.Insert(index, item); OnAdd?.Invoke(ref item); OnInsert?.Invoke(index, ref item); ItemsChanged?.Invoke(); }
public void Add(Viewport item) { this._entries.Add(item.Handle, item); item.Owner = this.Owner; OnAdd?.Invoke(this, new ReferenceChangedEventArgs(item)); }
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(); }
public void Add(StatefulObject o, int id) { o.ID = id; statefulObjects[id] = o; OnAdd?.Invoke(o); }
public void InvokeOnAdd(object item, object index) { if (OnAdd != null) { OnAdd.Invoke(this, new KeyValueEventArgs <T, string>((T)item, (string)index)); } }
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(); } }
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); }
public void Add(Item item, int amount) { int currentAmount = _items.GetValueOrDefault(item, 0); _items[item] = currentAmount + amount; OnAdd?.Invoke(item); }
/// <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); }
public new void Add(T item) { if (Contains(item) is false) { OnAdd?.Invoke(item); base.Add(item); } }
public void Add(RuntimeItem <T> item) { if (!Items.Contains(item)) { Items.Add(item); OnAdd?.Invoke(item); } }
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); }
public void Add(StatefulObject o) { int id = statefulObjects.Count + 1; o.ID = id; statefulObjects[id] = o; OnAdd?.Invoke(o); }
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); }
/// <summary> /// 新建按钮方法 /// </summary> public void Add() { if (OnAdd != null) { EditModel = OnAdd.Invoke() ?? new TItem(); } SelectedItems.Clear(); EditModalTitleString = AddModalTitle; EditModal?.Toggle(); }
public bool Add(T item) { if (objects.Add(item)) { OnAdd?.Invoke(item); AddOperation(Operation.OP_ADD, item); return(true); } return(false); }
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); }
public override bool Add(Element element) { if (base.Add(element)) { OnAdd?.Invoke(element); return(true); } return(false); }
public bool Add(T item) { bool successful = currentSet.Add(item); if (successful) { OnAdd?.Invoke(item); } return(successful); }
internal new void Add(T item) { OnAdd?.Invoke(item, null); /*if (null != OnAdd) * { * OnAdd(item, null); * }*/ base.Add(item); }