public void Delete(string host, string path, string json, Action <string, FizzException> callback) { if (OnDelete != null) { OnDelete.Invoke(host, path, json); } }
private void DeleteProgram(object sender) { if (OnDelete != null) { OnDelete.Invoke(sender as TV_Card); } }
public static void DeleteMessage(string[] splited) { if (splited.Length < 4) { return; } if (!int.TryParse(splited[1], out var sessionId) || !int.TryParse(splited[2], out var senderId) || !int.TryParse(splited[3], out var messageId)) { return; } var fromMe = Id == senderId; Message mess = null; if (fromMe) { int idx = Contacts[sessionId].Messages.FindIndex((item) => item.Id == messageId); Contacts[sessionId].Messages.RemoveAt(idx); } else { int idx = Contacts[senderId].Messages.FindIndex((item) => item.Id == messageId); Contacts[senderId].Messages.RemoveAt(idx); } OnDelete?.Invoke(messageId, senderId, sessionId); }
private void ContextDelete_Click(object sender, RoutedEventArgs e) { if (OnDelete != null) { OnDelete.Invoke(this); } }
public void Saved() { var deleteAction = new NotificationAction { Icon = _icons.Delete, Name = _loc.Delete, Color = "LightPink" }; deleteAction.Click += () => { if (File.Exists(_recentItem.FileName)) { var platformServices = ServiceProvider.Get <IPlatformServices>(); if (!platformServices.DeleteFile(_recentItem.FileName)) { return; } } Remove(); OnDelete?.Invoke(); }; _notificationActions.Add(deleteAction); PrimaryText = _recentItem.FileType == RecentFileType.Video ? _loc.VideoSaved : _loc.AudioSaved; Finished = true; }
private void DeleteButton_Click(object sender, RoutedEventArgs e) { if (ThingWrapper.CurrentThingsManager.DeleteThingWrapper(ThingWrapper)) { OnDelete?.Invoke(this, new EventArgs()); } }
protected async Task DeleteAsync() { await CardSectionRepository.DeleteAsync(CardSection.Id); OnDelete?.Invoke(); Control.ClearScope(); }
public void Saved() { var deleteAction = new NotificationAction { Icon = _icons.Delete, Name = _loc.Delete, Color = "LightPink" }; deleteAction.Click += () => { if (File.Exists(_recentItem.FileName)) { if (Shell32.FileOperation(_recentItem.FileName, FileOperationType.Delete, 0) != 0) { return; } } Remove(); OnDelete?.Invoke(); }; _notificationActions.Add(deleteAction); PrimaryText = _recentItem.FileType == RecentFileType.Video ? _loc.VideoSaved : _loc.AudioSaved; Finished = true; }
public FileSavedNotification(string FileName, string Message) { _fileName = FileName; PrimaryText = Message; SecondaryText = Path.GetFileName(FileName); var loc = ServiceProvider.Get<LanguageManager>(); var icons = ServiceProvider.Get<IIconSet>(); var deleteAction = new NotificationAction { Icon = icons.Delete, Name = loc.Delete, Color = "LightPink" }; deleteAction.Click += () => { if (File.Exists(_fileName)) { if (Shell32.FileOperation(_fileName, FileOperationType.Delete, 0) != 0) return; } Remove(); OnDelete?.Invoke(); }; Actions = new[] { deleteAction }; }
/// <summary> /// This event is called every time that the user clicks on some cell in the grid. /// The Img Mouse Down is called first, determining what action caused the event. /// If it was caused by a click on some information, no action should be taken. /// </summary> private void BasicGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (action != Action.None) { if (CurrentItem != null) { switch (action) { case Action.Edit: OnEdit?.Invoke(CurrentItem); break; case Action.Delete: OnDelete?.Invoke(CurrentItem); break; default: break; } } } action = Action.None; SelectedItem = null; }
public async void Start() { client = new HttpClient(); client.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken); var stream = await client.GetStreamAsync(url); var reader = new StreamReader(stream); string eventName = null; string data = null; while (client != null) { var line = reader.ReadLine(); if (string.IsNullOrEmpty(line) || line.StartsWith(":")) { eventName = data = null; continue; } if (line.StartsWith("event: ")) { eventName = line.Substring("event: ".Length).Trim(); } else if (line.StartsWith("data: ")) { data = line.Substring("data: ".Length); switch (eventName) { case "update": var status = JsonConvert.DeserializeObject <Status>(data); OnUpdate?.Invoke(this, new StreamUpdateEventArgs() { Status = status }); break; case "notification": var notification = JsonConvert.DeserializeObject <Notification>(data); OnNotification?.Invoke(this, new StreamNotificationEventArgs() { Notification = notification }); break; case "delete": var statusId = int.Parse(data); OnDelete?.Invoke(this, new StreamDeleteEventArgs() { StatusId = statusId }); break; } } } }
private void ViewHolder_Click(object sender, EventArgs e) { if (!adpt.trimmode) { OnDelete?.Invoke(currentitem); } }
protected void SendEvent(string eventName, string data) { switch (eventName) { case "update": var status = JsonConvert.DeserializeObject <Status>(data); OnUpdate?.Invoke(this, new StreamUpdateEventArgs(status)); break; case "notification": var notification = JsonConvert.DeserializeObject <Notification>(data); OnNotification?.Invoke(this, new StreamNotificationEventArgs(notification)); break; case "delete": var statusId = (data); OnDelete?.Invoke(this, new StreamDeleteEventArgs(statusId)); break; case "filters_changed": OnFiltersChanged?.Invoke(this, new StreamFiltersChangedEventArgs()); break; case "conversation": var conversation = JsonConvert.DeserializeObject <Conversation>(data); OnConversation?.Invoke(this, new StreamConversationEvenTargs(conversation)); break; } }
private void invokeDelete() { if (OnDelete != null) { OnDelete.Invoke(this, data); } }
public void SellBack(UIElement button) { if (Holding == null || !Roommate) { return; } if (Holding.IsBought) { if (Holding.CanDelete) { vm.SendCommand(new VMNetDeleteObjectCmd { ObjectID = Holding.MoveTarget, CleanupAll = true }); HITVM.Get().PlaySoundEvent(UISounds.MoneyBack); } else { ShowErrorAtMouse(LastState, VMPlacementError.CannotDeleteObject); return; } } OnDelete?.Invoke(Holding, null); //TODO: cleanup callbacks which don't need updatestate into another delegate. ClearSelected(); }
public new void Remove(T item) { int index = IndexOf(item); base.Remove(item); OnDelete?.Invoke(this, item, index); }
public void Delete() { rootEntity.OnShapeUpdated -= OnShapeUpdate; rootEntity.OnNameChange -= OnNameUpdate; Deselect(); DestroyColliders(); if (isNFT) { foreach (KeyValuePair <Type, ISharedComponent> kvp in rootEntity.sharedComponents) { if (kvp.Value.GetClassId() == (int)CLASS_ID.NFT_SHAPE) { BuilderInWorldNFTController.i.StopUsingNFT(((NFTShape.Model)kvp.Value.GetModel()).assetId); break; } } } associatedCatalogItem = null; DCL.Environment.i.world.sceneBoundsChecker.EvaluateEntityPosition(rootEntity); DCL.Environment.i.world.sceneBoundsChecker.RemoveEntityToBeChecked(rootEntity); OnDelete?.Invoke(this); }
public new void RemoveAt(int index) { T item = base[index]; base.RemoveAt(index); OnDelete?.Invoke(this, item, index); }
public void Menu() { bool exit = false; while (!exit) { Console.WriteLine($"\n\t\t\t {typeof(T).Name} Menu" + $"\n\t1.Create {typeof(T).Name}" + $"\n\t2.Read {typeof(T).Name}" + $"\n\t3.Update {typeof(T).Name}" + $"\n\t4.Delete {typeof(T).Name}" + $"\n\t5.GetCollection of {typeof(T).Name}" + $"\n\t6.ReadFromFile" + $"\n\t7.WriteInFile" + $"\n\tanother.Exit\n"); ConsoleKeyInfo consoleKey = Console.ReadKey(); Console.WriteLine(); switch (consoleKey.Key) { case ConsoleKey.D1: OnCreate?.Invoke(this, EventArgs.Empty); break; case ConsoleKey.D2: OnRead?.Invoke(this, EventArgs.Empty); break; case ConsoleKey.D3: OnUpdate?.Invoke(this, EventArgs.Empty); break; case ConsoleKey.D4: OnDelete?.Invoke(this, EventArgs.Empty); break; case ConsoleKey.D5: OnReadCollection?.Invoke(this, EventArgs.Empty); break; case ConsoleKey.D6: OnReadFromFile?.Invoke(this, EventArgs.Empty); break; case ConsoleKey.D7: OnWriteInFile?.Invoke(this, EventArgs.Empty); break; default: exit = true; break; } Console.ReadKey(); Console.Clear(); } }
private void Vh_OnDelete(MediaItem obj) { var index = allitems.IndexOf(obj); allitems.RemoveAt(index); NotifyItemRemoved(index); OnDelete?.Invoke(obj, index); }
public void Delete(BacktraceDatabaseRecord record) { if (OnDelete != null) { OnDelete.Invoke(record); } return; }
private static void GameObjectOnDelete(GameObject sender, EventArgs args) { var obj = sender as T; if (obj != null) { OnDelete?.Invoke(null, obj); } }
private void bunifuFlatButton1_Click(object sender, EventArgs e) { flowLayoutPanel1.BackColor = Color.Tomato; pictureBox7.Visible = false; notlab.Text = @"Deleted"; datelab.Text = ""; bunifuFlatButton1.Enabled = false; OnDelete?.Invoke(this, new EventArgs()); }
public new void Remove(T item) { Int32 index = base.IndexOf(item); base.Remove(item); if (OnDelete != null) { OnDelete.Invoke(this, new NListEventArgs<T>(item, index)); } }
public new void RemoveAt(Int32 index) { T item = base[index]; base.RemoveAt(index); if (OnDelete != null) { OnDelete.Invoke(this, new NListEventArgs<T>(item, index)); } }
public bool Remove(string modelId) { if (_models.TryRemove(modelId, out var removedModel)) { OnDelete?.Invoke(removedModel.Item); return(true); } return(false); }
public async Task Delete(Guid Id) { var resource = await Read(Id); await DeleteItem(Id); if (ResourceHasEvent(ResourceEventType.Deleted)) { await SendEvent(() => OnDelete?.Invoke(this, resource), async() => await CreateItem(resource), resource); } }
private void InitItems() { foreach (ToolStripItem toolStripItem in Items) { toolStripItem.ForeColor = SystemColors.ButtonHighlight; } deleteItem.Click += (s, e) => OnDelete?.Invoke(item); downloadItem.Click += DownloadItem_Click; renameItem.Click += RenameItem_Click; newNameBox.KeyPress += NewNameBox_KeyPress; }
/// <summary> /// Delete file from local path /// </summary> private void DeleteFromLocal() { if (CanDeleteFromLocal()) { //删除 var info = BuildInfo(); var args = new TrainDeleteEventArgs() { Train = info }; OnDelete?.Invoke(this, args); } }
private void DelBtn_Click(object sender, EventArgs e) { if (Edit) { OnDelete?.Invoke(ReplaceModel); Edit = false; ClearFields(); } else { MessageBox.Show("Нечего удалять", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information); } }