private string GetAppIcon(BasicAppInfo info) { string strReturn = string.Empty; try { var session = CurrentApp.Session; if (session == null) { return(strReturn); } var appServerInfo = CurrentApp.Session.AppServerInfo; if (appServerInfo == null) { return(strReturn); } string url = string.Format("{0}://{1}:{2}/Themes/{3}/{4}", appServerInfo.Protocol, appServerInfo.Address, appServerInfo.Port, session.ThemeName, info.Icon); strReturn = url; } catch (Exception ex) { CurrentApp.WriteLog("GetAppIcon", string.Format("Fail.\t{0}", ex.Message)); } return(strReturn); }
private void LoadModuleInfos() { try { mListModuleInfos.Clear(); WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)S1200Codes.GetAppBasicInfoList; webRequest.ListData.Add(CurrentApp.Session.RoleID.ToString()); webRequest.ListData.Add("0"); Service12001Client client = new Service12001Client( WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service12001")); WebReturn webReturn = client.DoOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } if (webReturn.ListData == null) { return; } for (int i = 0; i < webReturn.ListData.Count; i++) { string strInfo = webReturn.ListData[i]; OperationReturn optReturn = XMLHelper.DeserializeObject <BasicAppInfo>(strInfo); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } BasicAppInfo info = optReturn.Data as BasicAppInfo; if (info == null) { continue; } mListModuleInfos.Add(info); } CurrentApp.WriteLog("LoadModules", string.Format("Load end.\t{0}", mListModuleInfos.Count)); } catch (Exception ex) { ShowException(ex.Message); } }
private string GetAppIcon(BasicAppInfo info) { try { return(string.Format("{0}://{1}:{2}/Themes/{3}/{4}", CurrentApp.Session.AppServerInfo.Protocol, CurrentApp.Session.AppServerInfo.Address, CurrentApp.Session.AppServerInfo.Port, CurrentApp.Session.ThemeName, info.Icon)); } catch { return(string.Empty); } }