public static async Task UploadImages(Issue issue, string name, CaptureResult result) { // Add the attachments to the attachment array // timestamp-name-image.png UploadAttachmentInfo[] attachments = { new UploadAttachmentInfo(String.Format("{0}-original.png", name), result.Original.ToByteArray(ImageMagick.MagickFormat.Png)), new UploadAttachmentInfo(String.Format("{0}-updated.png", name), result.Updated.ToByteArray(ImageMagick.MagickFormat.Png)), new UploadAttachmentInfo(String.Format("{0}-diff.png", name), result.Diff.ToByteArray(ImageMagick.MagickFormat.Png)) }; await issue.AddAttachmentAsync(attachments); }
private static async void AddAttachmentsAsync(Issue issue, string path) { byte[] data = File.ReadAllBytes("files\\" + path); UploadAttachmentInfo info = new UploadAttachmentInfo(path, data); await issue.AddAttachmentAsync(new UploadAttachmentInfo [] { info }); }