/// <remarks/>
 public void CreateManagedFolderAsync(CreateManagedFolderRequestType CreateManagedFolder1, object userState)
 {
     if ((this.CreateManagedFolderOperationCompleted == null))
     {
         this.CreateManagedFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateManagedFolderOperationCompleted);
     }
     this.InvokeAsync("CreateManagedFolder", new object[] {
             CreateManagedFolder1}, this.CreateManagedFolderOperationCompleted, userState);
 }
 /// <remarks/>
 public void CreateManagedFolderAsync(CreateManagedFolderRequestType CreateManagedFolder1)
 {
     this.CreateManagedFolderAsync(CreateManagedFolder1, null);
 }
        /// <summary>
        /// Create a managed folder in server, the folder should be added in mailbox by server administrator in advance.
        /// </summary>
        /// <param name="request">Request of CreateManagedFolder operation.</param>
        /// <returns>Response of CreateManagedFolder operation.</returns>
        public CreateManagedFolderResponseType CreateManagedFolder(CreateManagedFolderRequestType request)
        {
            // Send the request and get the response.
            CreateManagedFolderResponseType response = this.exchangeServiceBinding.CreateManagedFolder(request);
            Site.Assert.IsNotNull(response, "If the operation is successful, the response should not be null.");

            if (ResponseClassType.Success == response.ResponseMessages.Items[0].ResponseClass)
            {
                this.VerifyCreateManagedFolderResponse(this.exchangeServiceBinding.IsSchemaValidated);
                this.VerifyAllRelatedRequirements(this.exchangeServiceBinding.IsSchemaValidated, response);
            }

            // Verify transport type related requirement.
            this.VerifyTransportType();

            // Verify soap version.
            this.VerifySoapVersion();

            return response;
        }
 /// <remarks/>
 public System.IAsyncResult BeginCreateManagedFolder(CreateManagedFolderRequestType CreateManagedFolder1, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("CreateManagedFolder", new object[] {
             CreateManagedFolder1}, callback, asyncState);
 }
        /// <summary>
        /// Generate the request message for operation "CreateManagedFolder".
        /// </summary>
        /// <param name="folderNames">An array of names of managed folder.</param>
        /// <returns>Create managed folder request instance that will send to server.</returns>
        protected CreateManagedFolderRequestType GetCreateManagedFolderRequest(params string[] folderNames)
        {
            Site.Assert.IsNotNull(folderNames, "Folder names should not be null!");
            Site.Assert.AreNotEqual<int>(0, folderNames.Length, "Folder names should contains at least one name!");
            CreateManagedFolderRequestType createManagedFolderRequest = new CreateManagedFolderRequestType();
            int folderCount = folderNames.Length;

            // Set the new managed folder's name.
            createManagedFolderRequest.FolderNames = new string[folderCount];
            for (int folderNameIndex = 0; folderNameIndex < folderCount; folderNameIndex++)
            {
                createManagedFolderRequest.FolderNames[folderNameIndex] = folderNames[folderNameIndex];
            }

            return createManagedFolderRequest;
        }