public Task SetImageAsync(Image image, string context, SDKTarget target) { using (MemoryStream memoryStream = new MemoryStream()) { image.Save(memoryStream, ImageFormat.Png); byte[] imageBytes = memoryStream.ToArray(); // Convert byte[] to Base64 String string base64String = $"data:image/png;base64,{Convert.ToBase64String(imageBytes)}"; return(SetImageAsync(base64String, context, target)); } }
public PayloadClass(string title, SDKTarget target) { this.Title = title; this.Target = target; }
public SetTitleMessage(string title, string context, SDKTarget target) { this.Context = context; this.Payload = new PayloadClass(title, target); }
public Task SetTitleAsync(string title, string context, SDKTarget target) { return(SendAsync(new SetTitleMessage(title, context, target))); }
public Task SetImageAsync(string base64Image, string context, SDKTarget target) { return(SendAsync(new SetImageMessage(base64Image, context, target))); }
public PayloadClass(string title, SDKTarget target, int?state) { this.Title = title; this.Target = target; this.State = state; }
public PayloadClass(string image, SDKTarget target) { this.Image = image; this.Target = target; }
public SetImageMessage(string base64Image, string context, SDKTarget target) { this.Context = context; this.Payload = new PayloadClass(base64Image, target); }
public PayloadClass(string image, SDKTarget target, int?state) { this.Image = image; this.Target = target; this.State = state; }