public void GetBingSourceList(ParamBingSourceList param) { MReader reader = new MReader(Config.CONN_BING, "BEST_AVAILABLE", debugMode, 0, 0, 50); resultAsString = reader.GetBingSourceListJson(param.z, param.top, param.right, param.bottom, param.left); logString = reader.logString; }
protected void Page_Load(object sender, EventArgs e) { SafeRunPrintError(delegate { try { ParamBingSourceList param = new ParamBingSourceList(Request); Reader reader = new Reader(param.debug); reader.GetBingSourceList(param); if (!param.debug) { OutputJson(reader.resultAsString); } else { OutputText(reader.logString); } } catch (Exception ex) { if (!(Request["debug"] != null && Request["debug"].ToLower() == "true")) { OutputJson("{\"success\":false, \"error_message\":\"internal error: " + ex.Message + "\", \"sources\":[]}"); } else { OutputText(ex.Message); } Log("bing_sourcelist", ex); } }); }