/// <summary> /// Raises event 'RemoveItem' /// </summary> protected virtual void OnRemoveItem() { if (RemoveItem != null) { RemoveItem.Invoke(this, System.EventArgs.Empty); } }
/// <summary> /// Instructs the parent legend item to remove this item from the list of legend items. /// </summary> protected virtual void OnRemoveItem() { RemoveItem?.Invoke(this, EventArgs.Empty); // Maybe we don't need RemoveItem event. We could just invoke a method on the parent. // One less thing to wire. But we currently need to wire parents. }
private void EhRemoveItem(object sender, RoutedEventArgs e) { var node = ((FrameworkElement)sender).Tag as NGTreeNode; if (node != null) { RemoveItem?.Invoke(node.Tag as IFitFunctionInformation); } }
private void OnItemDroppedOut(ItemDroppedEventData data) { if (this.slots.Any(s => s == data.InventorySlot)) { return; } // Note: to prevent Empty item dropping into inventory slot Timer.Instance.WaitForFixedUpdate(() => RemoveItem?.Invoke(data.InventoryItem.Item)); }
public void ChangeItem(object objDr) { DataRow dr = (DataRow)objDr; string fileId = dr["fileId"].ToString(); ItemUploadFile item = (ItemUploadFile)dr["item"]; UploadFileDelegate ufd = UploadFile; ufd.BeginInvoke(dr, this.Complete, dr); while (true) { if (dr != null && dr.RowState != DataRowState.Detached && dr.RowState != DataRowState.Deleted) { long fileSize = 0; long currentSize = 0; try { fileSize = Convert.ToInt64(dr["FileSize"]); currentSize = Convert.ToInt64(dr["UploadSize"]); } catch (Exception ex) { Thread.Sleep(50); fileSize = Convert.ToInt64(dr["FileSize"]); currentSize = Convert.ToInt64(dr["UploadSize"]); } int value = (int)((currentSize * 100) / fileSize); item.Invoke(new Action(() => { item.value = value; item.Invalidate(); //item.Invalidate(); })); if (value >= 100) { this.sendMessage.Invoke(item.File); RemoveItem.Invoke(item.File); this.addFileMessage(item.File); lock (dtMission) { dtMission.Rows.Remove(dr); } break; } } else { break; } Thread.Sleep(500); } }
/// <summary> /// Remove an item and put it into the removed items list /// </summary> /// <param name="item">Item to remove</param> /// <returns>True if the item was removed, false if not</returns> public bool Remove(T item) { if (newItems.Contains(item)) { var args = new RemoveItemEventArgs { Item = item, RemoveFromNewItems = true }; RemoveItem?.Invoke(this, args); if (!args.Cancel) { // Remove from new items and do nothing else newItems.Remove(item); var itemRemovedArgs = new ItemRemovedEventArgs { Item = item }; ItemRemoved?.Invoke(this, itemRemovedArgs); return(!args.Cancel); } } else if (items.Contains(item)) { var args = new RemoveItemEventArgs { Item = item }; RemoveItem?.Invoke(this, args); if (!args.Cancel) { // Remove from existing items and add to removed items list items.Remove(item); removedItems.Add(item); var itemRemovedArgs = new ItemRemovedEventArgs { Item = item }; ItemRemoved?.Invoke(this, itemRemovedArgs); return(!args.Cancel); } } return(false); }
protected override void OnExternalObjectsDropped(GoInputEventArgs evt) { if (Selection.Primary is KanbanItem node && node.Document is GoDocument doc) { RemoveItem?.Invoke(node.Item); AddNode(node); ItemDropped?.Invoke(node.Item); node.Container = ContainerId; RefreshNodes(); } }
private void OnSlotItemRightClicked(InventoryItem inventoryItem) { RemoveItem?.Invoke(inventoryItem.Item); }
/// <summary> /// This is either a layer collection or a colorbreak collection, and so /// this won't be called by us, but someone might want to override this for their own reasons. /// </summary> protected virtual void OnRemoveItem() { RemoveItem?.Invoke(this, EventArgs.Empty); }
private void removeButton_Click(object sender, EventArgs e) { RemoveItem?.Invoke(this, new RemoveItemEventArgs(_filepair)); }
private void RemoveClick(object sender, RoutedEventArgs e) { RemoveItem?.Invoke(); }
private void RemoveItemBtn_Click(object sender, EventArgs e) { RemoveItem?.Invoke(this, EventArgs.Empty); }
protected virtual void OnRemoveItem(RemoveManagerItem obj) { RemoveItem?.Invoke(obj); }
protected virtual void OnRemoveItem(IGameObject obj) { RemoveItem?.Invoke(obj); }