public static void ResultHandler(HttpContext context) { var inputFormat = (DocumentFormat)Enum.Parse(typeof(DocumentFormat), context.Request["inputFormat"]); var outputFormat = (DocumentFormat)Enum.Parse(typeof(DocumentFormat), context.Request["outputFormat"]); context.Response.Write("<center>"); if (DocumentConverter.CanConvert(inputFormat, outputFormat)) { context.Response.Write(string.Format( "<span style=\"color: green; font-weight: bold\">Direct conversion from {0} to {1} is possible</span>", inputFormat, outputFormat) ); foreach (var engine in Enum <DocumentEngine> .GetValues()) { if (DocumentConverter.CanConvert(inputFormat, outputFormat, engine)) { context.Response.Write(string.Format( "<br/><span style=\"color: green; font-weight: bold\">Via {0} Engine ✓</span>", engine)); } else { context.Response.Write(string.Format( "<br/><span style=\"color: red; font-weight: bold\">Via {0} Engine ✗</span>", engine)); } } } else { context.Response.Write(string.Format( "<span style=\"color: red; font-weight: bold\">Direct conversion from {0} to {1} is not possible</span>", inputFormat, outputFormat) ); } context.Response.Write("</center>"); }