using EnvelopeGenerator.Domain.Constants; using EnvelopeGenerator.Domain.Exceptions; #if NETFRAMEWORK using System; using System.Linq; #endif namespace EnvelopeGenerator.Domain.Interfaces { public interface IEnvelope { #if NET public EnvelopeType? Type { get; set; } #elif NETFRAMEWORK int EnvelopeTypeId { get; set; } #endif byte[] #if nullable ? #endif DocResult { get; } } public static class EnvelopeExtensions { public static bool IsReadAndConfirm(this IEnvelope envelope) { #if NET return envelope.Type == EnvelopeType.ReadAndConfirm; #elif NETFRAMEWORK return envelope.EnvelopeTypeId == (int)EnvelopeType.ReadAndConfirm; #endif } public static bool IsReadAndSign(this IEnvelope envelope) { #if NET return envelope.Type != EnvelopeType.ReadAndConfirm; #elif NETFRAMEWORK return envelope.EnvelopeTypeId != (int)EnvelopeType.ReadAndConfirm; #endif } public static bool IsBurned(this IEnvelope envelope) { return envelope.DocResult != null; } } }