/// <remarks/> public void addAttachment1Async(string in0, RemoteAttachment in1, byte[] in2, object userState) { if ((this.addAttachment1OperationCompleted == null)) { this.addAttachment1OperationCompleted = new System.Threading.SendOrPostCallback(this.OnaddAttachment1OperationCompleted); } this.InvokeAsync("addAttachment1", new object[] { in0, in1, in2}, this.addAttachment1OperationCompleted, userState); }
/// <remarks/> public void addAttachment1Async(string in0, RemoteAttachment in1, byte[] in2) { this.addAttachment1Async(in0, in1, in2, null); }
/// <remarks/> public System.IAsyncResult BeginaddAttachment1(string in0, RemoteAttachment in1, byte[] in2, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("addAttachment1", new object[] { in0, in1, in2}, callback, asyncState); }
public RemoteAttachment addAttachment(string in0, RemoteAttachment in1, [SoapElement(DataType="base64Binary")] byte[] in2) { object[] results = this.Invoke("addAttachment1", new object[] { in0, in1, in2}); return ((RemoteAttachment)(results[0])); }
/// <remarks/> public void addAttachmentAsync(string in0, long in1, RemoteAttachment in2, byte[] in3) { this.addAttachmentAsync(in0, in1, in2, in3, null); }
public void AttachFileToPage(long pageId, string title, string fileName, string filePath, string fileContentType, string attachedFileName = null) { this.ExecuteLoggedIn( (confluence, token) => { var file = new FileInfo(Path.Combine(filePath, fileName)); using (var fileStream = file.OpenRead()) using (var reader = new StreamReader(fileStream, Encoding.UTF8)) { var str = reader.ReadToEnd(); var attachmentData = new byte[str.Length * sizeof(char)]; Buffer.BlockCopy(str.ToCharArray(), 0, attachmentData, 0, attachmentData.Length); if (attachmentData.Length > 0) { var attachment = new RemoteAttachment { pageId = pageId, title = title, fileName = attachedFileName ?? fileName, contentType = fileContentType, created = DateTime.Now, creator = this.UserName, fileSize = attachmentData.Length }; confluence.addAttachment(token, attachment, attachmentData); } } }); }