private static Comparison CreateComparisonFromUrls(Comparisons client) { var identifier = Comparisons.GenerateIdentifier(); return(client.Create(Comparisons.Side.FromURL(SampleUrlLeft, Path.GetExtension(SampleUrlLeft)), Comparisons.Side.FromURL(SampleUrlRight, Path.GetExtension(SampleUrlRight)), identifier, expires: TimeSpan.FromMinutes(30))); }
private static Comparison CreateComparisonFromData(Comparisons client) { var identifier = Comparisons.GenerateIdentifier(); return(client.Create(Comparisons.Side.FromFile(SampleFileLeft), Comparisons.Side.FromFile(SampleFileRight), identifier, expires: TimeSpan.FromMinutes(30))); }
// ReSharper restore AssignNullToNotNullAttribute private static void Main(string[] args) { using (var comparisons = new Comparisons(AccountId, AuthToken)) { var identifier = Comparisons.GenerateIdentifier(); Process.Start(comparisons.SignedViewerURL(identifier, validFor: TimeSpan.FromMinutes(30), wait: true)); var comparison = comparisons.Create( Comparisons.Side.FromURL("https://api.draftable.com/static/test-documents/paper/left.pdf", "pdf"), Comparisons.Side.FromURL("https://api.draftable.com/static/test-documents/paper/right.pdf", "pdf"), identifier: identifier, expires: TimeSpan.FromMinutes(30) ); Console.WriteLine(comparison); } Console.ReadLine(); }