Example #1
0
        private static bool TryDeserializeInput(string input, out PdfRequest output)
        {
            var retVal = true;

            try
            {
                output = JsonConvert.DeserializeObject <PdfRequest>(input);
            }
            catch (JsonReaderException)
            {
                output = null;
                retVal = false;
            }

            return(retVal);
        }
Example #2
0
        private static bool ValidRequest(PdfRequest request)
        {
            bool retVal = true;

            if (request == null)
            {
                retVal = false;
            }
            else if (request.Name == PdfCommandName.None)
            {
                retVal = false;
            }
            else if (request.Options == null || string.IsNullOrWhiteSpace(request.Options.Source))
            {
                retVal = false;
            }

            return(retVal);
        }