public static Mailbox BuildTree(MatchedNameCollection folderPathCollection) { List<KeyValuePair<string[], Mailbox>> paths = BuildPathsList(folderPathCollection); IComparer<KeyValuePair<string[], Mailbox>> comparer = new PathComparer(); paths.Sort(comparer); return AssembleTree(paths); }
protected override CompletionResponse Behaviour() { this.matches = new MatchedNameCollection(); uint commandId = base._dispatcher.SendCommand(string.Format("{0} \"{1}\" \"{2}\"", this.cmd, this.referenceName, this.mailboxName), this.filter); IMAP4Response response = base._dispatcher.GetResponse(commandId); while (!response.IsCompletionResponse()) { if ((response.Name != this.cmd) || (response.Type != EIMAP4ResponseType.Untagged)) { throw new UnexpectedResponseException("Unexpected response"); } this.matches.Add(new MatchedName(response)); response = base._dispatcher.GetResponse(commandId); } return(new CompletionResponse(response.Response)); }