public void Method2() { int a = 1; int b = 2; AddEvent?.Invoke(a, b); }
public void AddNewTask(object sender, RoutedEventArgs e) { MyFrame.BackStack.Clear(); MyFrame.Navigate(typeof(CreateOrModifyTaskPage), this, new SuppressNavigationTransitionInfo()); ShowSlideInPane(); AddEvent?.Invoke(); //CollapseSlideInPane(); }
private void FixButton_Click(object sender, RoutedEventArgs e) { image.Source = videoPlayer.MakeScreenShot(); AddEvent.Invoke(image.Source); int n = Convert.ToInt32(TextBox1.Text); n++; TextBox1.Text = n.ToString(); }
public static async Task <bool> Add(IHubUserModel user) { if (user == null) { throw new ArgumentNullException(nameof(user)); } var addNewUser = false; while (_lock) { Thread.Sleep(100); } _lock = true; try { var connectedId = user.ConnectionId.First(); var findUser = _store.FirstOrDefault(i => i.Id == user.Id); if (findUser != null) { findUser.ConnectionId.Add(connectedId); } else { addNewUser = true; _store.Add(user); } var findId = _store_connectedIds.FirstOrDefault(i => i.ConnectionId == connectedId); if (findId == null) { _store_connectedIds.Add(new HubConnectedIdModel { UserId = user.Id, ConnectionId = connectedId }); } AddEvent?.Invoke(user); _lock = false; } catch (Exception) { Thread.Sleep(100); return(await Add(user).ConfigureAwait(false)); } return(addNewUser); }
private void btnAdd_Click(object sender, RoutedEventArgs e) { if (AddEvent != null) { bool?result = AddEvent.Invoke(); if (result != null && result.Value) { if (RefreshEvent != null) { RefreshEvent.Invoke(); } } } }
private void Insert(Node <T> node) { if (node is null) { throw new TreeException("Node can't be null", new ArgumentNullException()); } Count++; AddEvent?.Invoke(node.Value); var currentNode = Root; while (!currentNode.AddChild(node)) { currentNode = currentNode > node ? currentNode.Left : currentNode.Right; } }
public void Add(long position, byte[] bytes) { if (bytes == null) { throw new ArgumentNullException(nameof(bytes)); } if (position < 0) { throw new ArgumentOutOfRangeException(nameof(position)); } lock (_parts) { _parts.Add(position, bytes); AddEvent?.Invoke(this, EventArgs.Empty); } }
private void Add_Click(object sender, EventArgs e) { try { price = double.Parse(richTextBox3.Text); info = richTextBox2.Text; chance = double.Parse(richTextBox1.Text); AddEvent?.Invoke(this, null); ChangeEvent?.Invoke(this, null); AddSquare?.Invoke(this, null); AddTriangle?.Invoke(this, null); Close(); } catch { MessageBox.Show("Введите корректные данные"); } }
private void buttonAdd_Click(object sender, EventArgs e) { try { _path = personName.Text + personSurname.Text + personPatronymic.Text + ".jpeg"; if (personPhoto.Image != null) { personPhoto.Image.Save(_path, System.Drawing.Imaging.ImageFormat.Jpeg); } AddEvent?.Invoke(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); this.Close(); } }
public void AddFirst(T data) { if (data == null) { throw new ArgumentNullException(); } Node <T> node = new Node <T>(data); if (head == null) { head = node; tail = node; tail.Next = head; } else { node.Next = head; tail.Next = node; head = node; } AddEvent?.Invoke(this, node.Data); count++; }
private void addButton_Click(object sender, EventArgs e) { AddEvent?.Invoke(); this.Close(); }
private void AddButton_OnClick(object sender, RoutedEventArgs e) { AddEvent?.Invoke(sender, e); }
/// <summary> /// Adds an item to the end of the ObservableList. /// </summary> /// <param name="item">The item to be added to the end of the ObservableList.</param> /// <returns>void</returns> public void Add(T item) { _items.Add(item); AddEvent?.Invoke(item); }
//---------------------------------- // id管理(dlib) //---------------------------------- #region id管理 private void AddId() { //print("a: " + blobPosList.Count + " " + userNumPre); if (blobPosList.Count <= blobNumPre) { return; } int addIdNum = blobPosList.Count - blobNumPre; for (int k = 0; k < addIdNum; k++) { // id, x, y追加 List <float> thisIdList = new List <float>(); thisIdList.Add(idCounter); // ID string debugStr = "Add Id: " + idCounter; bool added = false; for (int i = 0; i < blobPosList.Count; i++) { bool exist = false; for (int j = 0; j < idList.Count; j++) { if (idList[j].Count > 1) { float distance = Vector2.Distance(new Vector2(blobPosList[i].x, blobPosList[i].y), new Vector2(idList[j][1], idList[j][2])); if (distance < sameLimitDistance) { exist = true; break; } } } if (!exist) { thisIdList.Add(blobPosList[i].x); // X thisIdList.Add(blobPosList[i].y); // Y thisIdList.Add(blobPosList[i].width); // width thisIdList.Add(blobPosList[i].height); // height List <Rect> smooth = new List <Rect>(); smooth.Add(new Rect(blobPosList[i].x, blobPosList[i].y, blobPosList[i].width, blobPosList[i].height)); blobSmoothList.Add(smooth); debugStr += " (" + blobPosList[i].x + ", " + blobPosList[i].y + ")"; added = true; break; } } if (added) { idList.Add(thisIdList); print(debugStr); addEvent.Invoke(idCounter); idCounter++; } } }
public void Method1(int a, int b) { AddEvent?.Invoke(a, b); }
private void AddButton_OnClick(object Sender, RoutedEventArgs E) { AddEvent?.Invoke(Sender, E); }
//Method gebruikt om een portefeuille toe te voegen en de textbox leeg te maken private void AddPortefeuille() { repo.AddPortefeuille(idGebruiker, NaamPortfeuille); NaamPortfeuille = ""; AddEvent?.Invoke(); }
public void Add(ITransaction transaction) { transactions.Add(transaction); AddEvent?.Invoke(this, new TransactionEventArgs(transaction)); }
private void AddElementButton_Click(object sender, EventArgs e) { AddEvent?.Invoke(true); }
public void AddNotification(object o, EventArgs args) { Console.WriteLine("Add event"); AddEvent?.Invoke(o, args); }
private void AddAssetButton_Click(object sender, RoutedEventArgs e) { AddEvent?.Invoke(this, new EventArgs()); }
private void OnAddEvent(EventArgs e) { AddEvent?.Invoke(this, e); }
public void CargarFigura(UMLGraph.Grupos.Grupo3.Figuras.Figura tmp) { ControlCanvas.Figuras.Figuras.Add(tmp); AddEvent?.Invoke(); }
public void Invoke() => OnEvent?.Invoke();
public void RaiseAddEvent(AddEventArgs e) => AddEvent?.Invoke(this, e);
protected void OnAddEvent(WindowInfoWithHandle windowInfo) { AddEvent?.Invoke(this, new OriginalWinEventArg(windowInfo)); }
public void Load() { AddEvent?.Invoke(fridgeComboBox, buyerComboBox, sellerComboBox); }
/// <summary> /// Inserts an item into the ObservableList at the specified index. /// </summary> /// <param name="index">The zero-based index at which item should be inserted.</param> /// <param name="item">The item to insert.</param> /// <returns>void</returns> public void Insert(int index, T item) { _items.Insert(index, item); AddEvent?.Invoke(item); }