public async Task <IStandardViewpoint> CreateViewpointAsync(IStandardViewpoint instance)
        {
            var jiraIssue = await _resourceClient.RestClient.Issues.GetIssueAsync(instance.Identifiers[InstanceKeyNames.JIRA_ISSUE].Id);

            using (WebClient client = new WebClient())
            {
                try
                {
                    byte[] img = client.DownloadData(new Uri(instance.Url));


                    UploadAttachmentInfo[] info = new UploadAttachmentInfo[1] {
                        new UploadAttachmentInfo("viewpoint_" + instance.ViewpointId + ".png",
                                                 img)
                    };

                    await jiraIssue.AddAttachmentAsync(info);
                }
                catch (Exception e)
                {
                    Debug.WriteLine("Failed to upload viewpoint attachment.");
                }
            }



            return(instance);
        }
Пример #2
0
        internal static bool OfInterest(IStandardViewpoint message, string machineOrigin)
        {
            if (message.Identifiers.ContainsKey(InstanceKeyNames.JIRA_ISSUE))
            {
                return(true);
            }

            return(false);
        }
 internal static bool OfInterest(IStandardViewpoint message, string machineOrigin)
 {
     return(false);
 }
 public Task <IStandardViewpoint> UpdateViewpointAsync(IStandardViewpoint instance)
 {
     throw new NotImplementedException();
 }
 public void DeleteViewpointAsync(IStandardViewpoint instance)
 {
     throw new NotImplementedException();
 }