/// <summary> /// Create a new folder /// </summary> /// <param name="folderName"></param> /// <param name="folderDescription"></param> /// <returns></returns> public async Task <YouMailFolder> CreateFolderAsync(string folderName, string folderDescription) { try { YouMailFolder newFolder = null; AddPendingOp(); if (await LoginWaitAsync()) { var folder = new YouMailFolder { Name = folderName, Description = folderDescription }; using (var response = await YouMailApiAsync(YMST.c_createFolder, SerializeObjectToHttpContent(folder, "folder"), HttpMethod.Post)) { newFolder = DeserializeObject <YouMailFolder>(response.GetResponseStream(), YMST.c_folder); } } return(newFolder); } finally { RemovePendingOp(); } }
private static int CompareFolderIdPairs(YouMailFolder a, YouMailFolder b) { return(a.Id - b.Id); }