public void Delete(IUserCategory category, TaskContext context) { category.Dispatcher.Invoke(() => { if (category.Parent == null) { return; } if (Verify() == false) { return; } category.Delete(context.Authentication); context.Complete(category); }); bool Verify() { if (context.AllowException == true) { return(true); } if (category.Parent == null) { return(false); } if (EnumerableUtility.Descendants <IUserItem, IUser>(category as IUserItem, item => item.Childs).Any() == true) { return(false); } return(true); } }
public void Delete() { category.Delete(authentication); }