/// <remarks/> public void GetAttachmentAsync(GetAttachmentType GetAttachment1, object userState) { if ((this.GetAttachmentOperationCompleted == null)) { this.GetAttachmentOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAttachmentOperationCompleted); } this.InvokeAsync("GetAttachment", new object[] { GetAttachment1}, this.GetAttachmentOperationCompleted, userState); }
/// <remarks/> public System.IAsyncResult BeginGetAttachment(GetAttachmentType GetAttachment1, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetAttachment", new object[] { GetAttachment1}, callback, asyncState); }
/// <remarks/> public void GetAttachmentAsync(GetAttachmentType GetAttachment1) { this.GetAttachmentAsync(GetAttachment1, null); }
/// <summary> /// Gets a specific attachment from exchange by id. /// </summary> /// <param name="id"></param> /// <returns></returns> public FileAttachmentType GetAttachment(string id) { var binding = ChannelHelper.BuildChannel(hostname, username, password); var getAttachmentRequest = new GetAttachmentType(); var attachmentIdArray = new RequestAttachmentIdType[1]; attachmentIdArray[0] = new RequestAttachmentIdType { Id = id }; getAttachmentRequest.AttachmentIds = attachmentIdArray; GetAttachmentResponseType getAttachmentResponse = binding.GetAttachment(getAttachmentRequest); if (getAttachmentResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) throw new Exception(getAttachmentResponse.ResponseMessages.Items[0].MessageText); var attachmentResponseMessage = (AttachmentInfoResponseMessageType)getAttachmentResponse.ResponseMessages.Items[0]; if (attachmentResponseMessage.Attachments == null || attachmentResponseMessage.Attachments.Length == 0) throw new ApplicationException("Error in GetAttachment, empty AttachmentInfoResponseMessageType"); return (FileAttachmentType)attachmentResponseMessage.Attachments[0]; }