private async Task OnDeleteVideoConfirmedAsync() { var deleteTask = OnDelete.InvokeAsync(this.VideoModel); this.ShowDeleteConfirm = false; await deleteTask; }
public override string GetForeignKeySql(string fkName, string table, string column, string referencingTable, string referencingColumn, OnDelete onDelete) { string onDeleteSql; switch (onDelete) { case OnDelete.Cascade: onDeleteSql = "on delete cascade"; break; case OnDelete.SetNull: onDeleteSql = "on delete set null"; break; default: onDeleteSql = ""; break; } return(String.Format("alter table {0} add constraint {1} foreign key ({2}) references {3} ({4}) {5}", table, fkName, column, referencingTable, referencingColumn, onDeleteSql)); }
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; }
protected async Task DeleteAsync() { await CardSectionRepository.DeleteAsync(CardSection.Id); OnDelete?.Invoke(); Control.ClearScope(); }
public virtual void AddForeignKey(string fkName, string table, string column, string referencingTable, string referencingColumn, OnDelete onDelete) { string sql = Dialect.GetForeignKeySql(fkName, table, column, referencingTable, referencingColumn, onDelete); Database.ExecuteSql(sql); }
/// <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); } }
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 }; }
private void ContextDelete_Click(object sender, RoutedEventArgs e) { if (OnDelete != null) { OnDelete.Invoke(this); } }
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 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 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; }
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); }
public void Delete(string host, string path, string json, Action <string, FizzException> callback) { if (OnDelete != null) { OnDelete.Invoke(host, path, json); } }
public new void Remove(T item) { int index = IndexOf(item); base.Remove(item); OnDelete?.Invoke(this, item, index); }
private void DeleteProgram(object sender) { if (OnDelete != null) { OnDelete.Invoke(sender as TV_Card); } }
public new void RemoveAt(int index) { T item = base[index]; base.RemoveAt(index); OnDelete?.Invoke(this, item, index); }
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); } }
private void DeleteButton_Click(object sender, RoutedEventArgs e) { if (ThingWrapper.CurrentThingsManager.DeleteThingWrapper(ThingWrapper)) { OnDelete?.Invoke(this, new EventArgs()); } }
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 async Task DeleteCustomer() { _confirmation.Hide(); await OnDelete.InvokeAsync(_customerToDelete); await CustomerRepo.Delete(Endpoints.CustomersEndpoint, _customerToDelete); await LoadCustomers(1, 10); }
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()); }
private static void GameObjectOnDelete(GameObject sender, EventArgs args) { var obj = sender as T; if (obj != null) { OnDelete?.Invoke(null, obj); } }
public static EntityTypeBuilder <TEntity> InterleaveInParent <TEntity>( this EntityTypeBuilder <TEntity> builder, Type parentEntity, OnDelete onDelete = OnDelete.NoAction) where TEntity : class { builder.Metadata.AddAnnotation(SpannerAnnotationNames.InterleaveInParent, parentEntity.FullName); builder.Metadata.AddAnnotation(SpannerAnnotationNames.InterleaveInParentOnDelete, onDelete); return(builder); }
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 string GetForeignKeySql(string fkName, string table, string column, string referencingTable, string referencingColumn, OnDelete onDelete) { string onDeleteSql; switch (onDelete) { case OnDelete.Cascade: onDeleteSql = "ON DELETE CASCADE"; break; case OnDelete.SetNull: onDeleteSql = "ON DELETE SET NULL"; break; default: onDeleteSql = ""; break; } return String.Format("ALTER TABLE {0} ADD CONSTRAINT {1} FOREIGN KEY ({2}) REFERENCES {3} ({4}) {5}", table, fkName, column, referencingTable, referencingColumn, onDeleteSql); }
public override string GetForeignKeySql(string fkName, string table, string column, string referencingTable, string referencingColumn, OnDelete onDelete) { string onDeleteSql; switch (onDelete) { case OnDelete.Cascade: onDeleteSql = "on delete cascade"; break; case OnDelete.SetNull: onDeleteSql = "on delete set null"; break; default: onDeleteSql = ""; break; } return String.Format("alter table {0} add constraint {1} foreign key ({2}) references {3} ({4}) {5}", table, fkName, column, referencingTable, referencingColumn, onDeleteSql); }
public abstract string GetForeignKeySql(string fkName, string table, string column, string referencingTable, string referencingColumn, OnDelete onDelete);
public void OnDeleteSetNull() { OnDelete = OnDelete.SetNull; Execute(); }
public override string GetForeignKeySql(string fkName, string table, string column, string referencingTable, string referencingColumn, OnDelete onDelete) { throw new NotImplementedException(); }
public void OnDeleteNoAction() { OnDelete = OnDelete.NoAction; Execute(); }
public void OnDeleteCascade() { OnDelete = OnDelete.Cascade; Execute(); }
public bool Equals(OnDelete other) { return Equals(other.value, value); }
public override string GetForeignKeySql(string fkName, string table, string column, string referencingTable, string referencingColumn, OnDelete onDelete) { throw new NotSupportedByDialect("ForeignKeys not supported by SqlLite", "GetForeignKeySql", GetDialectName()); }
public void AddForeignKey(string fkName, string table, string column, string referencingTable, string referencingColumn, OnDelete onDelete) { }
public override string GetForeignKeySql(string fkName, string table, string column, string referencingTable, string referencingColumn, OnDelete onDelete) { return _postgreSqlConstraintsDialect.GetForeignKeySql(fkName, table, column, referencingTable, referencingColumn, onDelete); }