This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.UI.Xaml; | |
using Windows.ApplicationModel.DataTransfer; | |
namespace App1.Helpers; | |
// based on https://stackoverflow.com/a/65266427/1200847 | |
public interface IFilesDropped | |
{ | |
void OnFilesDropped(string[] files); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Net.Mail; | |
using System.Runtime.Caching; | |
using System.Threading.Tasks; | |
using HtmlAgilityPack; | |
using NewsletterStudio.Core.Rendering; | |
using NewsletterStudio.Core.Rendering.Tasks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// slightly updated version of https://stackoverflow.com/a/30351313/1200847 | |
// uses .Net 4.0 function XmlConvert.IsXmlChar | |
// supports Async | |
public class InvalidXmlCharacterReplacingStreamReader : StreamReader | |
{ | |
private readonly char _replacementCharacter; | |
public InvalidXmlCharacterReplacingStreamReader(string fileName, char replacementCharacter) : base(fileName) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Text; | |
using System.Threading.Tasks; | |
// based on https://gist.github.com/AlexMAS/276eed492bc989e13dcce7c78b9e179d | |
public static class ProcessAsyncHelper | |
{ | |
public static async Task<ProcessResult> RunProcessAsync(string command, string arguments, int timeout) | |
{ |