protected override void InitEnvironment() { //如果在初始化时发生异常,则会引发再次启动。这时应该保证之前的所有的初始化工作归零。 RafyEnvironment.Location.IsWebUI = true; RafyEnvironment.Location.IsWPFUI = false; RafyEnvironment.Location.DataPortalMode = DataPortalMode.ConnectDirectly; base.InitEnvironment(); if (RafyEnvironment.Location.IsWebUI) { JsonServiceRepository.LoadAllServices(); } }
protected override void InitEnvironment() { //如果在初始化时发生异常,则会引发再次启动。这时应该保证之前的所有的初始化工作归零。 var isWcfServer = ConfigurationHelper.GetAppSettingOrDefault("Rafy_IsWCFServer", false); RafyEnvironment.Location.IsWebUI = !isWcfServer; RafyEnvironment.Location.IsWPFUI = false; RafyEnvironment.Location.DataPortalMode = DataPortalMode.ConnectDirectly; base.InitEnvironment(); if (RafyEnvironment.Location.IsWebUI) { JsonServiceRepository.LoadAllServices(); } }
protected override string ResponseScript(HttpContext context) { var svc = context.Request.GetQueryStringOrDefault("svc", string.Empty); if (!string.IsNullOrWhiteSpace(svc)) { var input = context.Request.Form["svcInput"]; var res = JsonServiceRepository.Invoke(svc, input); return(res); } return(new ClientResult { Success = true }.ToJsonString()); }
protected override void PrepareToStartup() { base.PrepareToStartup(); JsonServiceRepository.Clear(); }