/// <remarks/>
 public void DeleteItemAsync(DeleteItemType DeleteItem1, object userState)
 {
     if ((this.DeleteItemOperationCompleted == null))
     {
         this.DeleteItemOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteItemOperationCompleted);
     }
     this.InvokeAsync("DeleteItem", new object[] {
             DeleteItem1}, this.DeleteItemOperationCompleted, userState);
 }
 /// <remarks/>
 public System.IAsyncResult BeginDeleteItem(DeleteItemType DeleteItem1, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("DeleteItem", new object[] {
             DeleteItem1}, callback, asyncState);
 }
 /// <remarks/>
 public void DeleteItemAsync(DeleteItemType DeleteItem1)
 {
     this.DeleteItemAsync(DeleteItem1, null);
 }
Example #4
0
        /// <summary>
        /// Delete the given message permanatly.
        /// </summary>
        /// <param name="messageId"></param>
        public void DeleteMessage(ItemIdType messageId)
        {
            var binding = ChannelHelper.BuildChannel(hostname, username, password);

            var deleteItemRequest = new DeleteItemType
              	{
              		ItemIds = new BaseItemIdType[] {messageId},
              		DeleteType = DisposalType.HardDelete
              	};

            DeleteItemResponseType deleteResponse = binding.DeleteItem(deleteItemRequest);

            if (deleteResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error)
                throw new Exception(deleteResponse.ResponseMessages.Items[0].MessageText);
        }