Did a few things

This commit is contained in:
2021-07-23 09:45:12 +02:00
parent 3da75e4cc6
commit db537bd7b7
122 changed files with 15101 additions and 619 deletions

View File

@@ -0,0 +1,44 @@
using System.Collections.Generic;
namespace Unity.Cloud.UserReporting
{
/// <summary>
/// Provides extensions for working with attachments.
/// </summary>
public static class AttachmentExtensions
{
#region Static Methods
/// <summary>
/// Adds a JSON attachment.
/// </summary>
/// <param name="instance">The extended instance.</param>
/// <param name="name">The name of the attachment.</param>
/// <param name="fileName">The file name.</param>
/// <param name="contents">The contents.</param>
public static void AddJson(this List<UserReportAttachment> instance, string name, string fileName, string contents)
{
if (instance != null)
{
instance.Add(new UserReportAttachment(name, fileName, "application/json", System.Text.Encoding.UTF8.GetBytes(contents)));
}
}
/// <summary>
/// Adds a text attachment.
/// </summary>
/// <param name="instance">The extended instance.</param>
/// <param name="name">The name of the attachment.</param>
/// <param name="fileName">The file name.</param>
/// <param name="contents">The contents.</param>
public static void AddText(this List<UserReportAttachment> instance, string name, string fileName, string contents)
{
if (instance != null)
{
instance.Add(new UserReportAttachment(name, fileName, "text/plain", System.Text.Encoding.UTF8.GetBytes(contents)));
}
}
#endregion
}
}