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); }
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); }