private static NntpMultilineResponse ExecuteArticleCommand(INntpConnection connection, string command, int? articleNo, int validCode) { var articleCommand = CommandBuilder.Build(command, builder => { if (articleNo.HasValue) builder.AddParameter(articleNo.Value); }); return connection.ExecuteMultilineCommand(articleCommand, validCode); }
public static NntpMultilineResponse ListGroup(this INntpConnection connection, string group = null, Range range = null) { var command = CommandBuilder.Build("LISTGROUP", builder => { if (string.IsNullOrWhiteSpace(group)) { return; } builder.AddParameter(group); if (range != null) { builder.AddParameter(range); } }); return(connection.ExecuteMultilineCommand(command, 211)); }
public static NntpMultilineResponse List(this INntpConnection connection, ListKeyword?keyword = null, string wildmatOrArgument = null) { var command = CommandBuilder.Build("LIST", builder => { if (!keyword.HasValue) { return; } builder.AddParameter(keyword.Value.GetDescription()); if (!string.IsNullOrWhiteSpace(wildmatOrArgument)) { builder.AddParameter(wildmatOrArgument); } }); return(connection.ExecuteMultilineCommand(command, 215)); }
private static NntpMultilineResponse ExecuteArticleCommand(INntpConnection connection, string command, string messageId, int validCode) { return(connection.ExecuteMultilineCommand(string.Join(" ", command, messageId.WithBrackets()), validCode)); }
public static NntpMultilineResponse Hdr(this INntpConnection connection, string field, string messageId) { var command = string.Format("HDR {0} {1}", field, messageId.WithBrackets()); return(connection.ExecuteMultilineCommand(command, 225)); }
public static NntpMultilineResponse Over(this INntpConnection connection, Range range) { var command = string.Format("OVER {0}", range); return(connection.ExecuteMultilineCommand(command, 224)); }
public static NntpMultilineResponse Over(this INntpConnection connection, string messageId) { var command = string.Format("OVER {0}", messageId.WithBrackets()); return(connection.ExecuteMultilineCommand(command, 224)); }
public static NntpMultilineResponse Hdr(this INntpConnection connection, string field, Range range) { var command = string.Format("HDR {0} {1}", field, range); return(connection.ExecuteMultilineCommand(command, 225)); }
public static NntpMultilineResponse Help(this INntpConnection connection) { return(connection.ExecuteMultilineCommand("HELP", 100)); }
private static NntpMultilineResponse ExecuteArticleCommand(INntpConnection connection, string command, string messageId, int validCode) { return connection.ExecuteMultilineCommand(string.Join(" ", command, messageId.WithBrackets()), validCode); }
public static NntpMultilineResponse ListGroup(this INntpConnection connection, string group, int articleNo) { var command = string.Format("LISTGROUP {0} {1}", group, articleNo); return(connection.ExecuteMultilineCommand(command, 211)); }