public static string RemoveList(params string[] input) { if (input.Length != 1) { throw GetListManagerException(ListErrorMessage.WrongFormat); } CustomList l = GetList(input[0]); l.Delete(); lists.Remove(l); WriteContents(); return($"Removed list '{input[0]}'"); }
public ListOutput RemoveList(UserInfo userInfo, params string[] input) { if (input.Length != 1) { throw GetListManagerException(ListErrorMessage.General.WrongFormat); } CustomList list = GetList(input[0]); ThrowIfMissingWritePermission(userInfo, list); list.Delete(); Lists.Remove(list); WriteContents(); string output = $"Removed list '{input[0]}'"; return(GetListOutput(output)); }