public string Execute(Arguments arg, Stream stream) { var repository = new RepositoryXML(stream); var activities = repository.List(); foreach(var activity in activities) { repository.Delete(activity.List()["id"]); } return "Clear all activities"; }
private static string StreamList(RepositoryXML text) { var listContent = new StringBuilder(); foreach (var activity in text.List()) { foreach (var value in activity.List().Values) listContent.Append(value); } return listContent.ToString(); }
private static IEnumerable<string> ActivitysField(MemoryStream stream, string field) { var repository = new RepositoryXML(stream); foreach (var activity in repository.List()) { yield return activity.List()[field]; } }