コード例 #1
0
        /// <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();
            }
        }
コード例 #2
0
 private static int CompareFolderIdPairs(YouMailFolder a, YouMailFolder b)
 {
     return(a.Id - b.Id);
 }