/// <summary> /// 获取页面类型 /// </summary> /// <param name="companyCode">公司编号</param> /// <param name="channelID">渠道编号</param> /// <param name="moduleType">模块类型</param> /// <returns>页面类型CodeNamePair列表</returns> public virtual List <CodeNamePair> GetPageType(string companyCode, string channelID, ModuleType moduleType) { List <CodeNamePair> result = null; switch (moduleType) { case ModuleType.NewsAndBulletin: //新闻公告 result = ObjectFactory <INewsDA> .Instance.GetAllNewTypes(companyCode, channelID); break; case ModuleType.Banner: case ModuleType.SEO: result = ObjectFactory <IPageTypeDA> .Instance.GetPageTypes(companyCode, channelID); break; case ModuleType.ProductRecommend: case ModuleType.HotKeywords: result = GetPageTypeFromConfig(companyCode, channelID, moduleType.ToString()); //var sections = ObjectFactory<IHomePageSectionQueryDA>.Instance.GetDomainCodeNames(companyCode, channelID); //result.AddRange(sections); break; case ModuleType.DefaultKeywords: case ModuleType.HotSale: case ModuleType.Poll: default: result = GetPageTypeFromConfig(companyCode, channelID, moduleType.ToString()); break; } return(result); }
/// <summary> /// 标题GUI /// </summary> private void OnTitleGUI() { GUILayout.BeginHorizontal(EditorStyles.toolbar); if (GUILayout.Button(_showModuleType.ToString(), EditorStyles.toolbarDropDown)) { GenericMenu gm = new GenericMenu(); gm.AddItem(new GUIContent("All Module"), _showModuleType == ModuleType.AllModule, () => { _showModuleType = ModuleType.AllModule; CurrentModule = null; _currentEditModule = null; }); gm.AddItem(new GUIContent("In Project"), _showModuleType == ModuleType.InProject, () => { _showModuleType = ModuleType.InProject; CurrentModule = null; _currentEditModule = null; }); gm.ShowAsContext(); } GUILayout.FlexibleSpace(); if (GUILayout.Button("Git Bash", EditorStyles.toolbarButton)) { GitBashWindow.OpenWindow(this); } if (GUILayout.Button("Credentials", EditorStyles.toolbarButton)) { CredentialsProviderWindow.OpenWindow(this, _modulesLibrary.SetCredentials); } if (GUILayout.Button(_helpGC, "IconButton")) { Application.OpenURL("https://wanderer.blog.csdn.net/article/details/109488065"); } GUILayout.EndHorizontal(); }
protected virtual void OnSelectedModuleTypeChanged(ModuleType oldType) { var transitionService = this.GetService <Services.ITransitionService>(); bool effective = (SelectedModuleType != ModuleType.Unknown) && (oldType != ModuleType.Unknown); object waitParameter = !IsModuleLoaded(SelectedModuleType) ? (object)SelectedModuleType : null; using (transitionService.EnterTransition(effective, ((int)SelectedModuleType > (int)oldType), waitParameter)) { var workspaceService = this.GetService <Services.IWorkspaceService>(); var resolver = this.GetService <IModuleTypesResolver>(); if (oldType != ModuleType.Unknown) { workspaceService.SaveWorkspace(resolver.GetName(oldType)); } else { workspaceService.SetupDefaultWorkspace(); } try { SelectedModule = GetModule(SelectedModuleType); RaiseSelectedModuleTypeChanged(); } catch (Exception e) { var entryAsm = System.Reflection.Assembly.GetEntryAssembly(); string msg = "Navigation Error: [" + oldType.ToString() + "=>" + SelectedModuleType.ToString() + Environment.NewLine + (entryAsm != null ? "StartUp:" + entryAsm.Location : string.Empty); throw new ApplicationException(msg, e); } if (SelectedModuleType != ModuleType.Unknown) { workspaceService.RestoreWorkspace(resolver.GetName(SelectedModuleType)); } } }
public bool IsVisible(ModuleType type) { IModule wi; visibles.TryGetValue(type.ToString(), out wi); return(wi != null && !wi.IsDisabled()); }
public static ModuleInfoAttribute GetModuleInfo(this ModuleType moduleType) { var description = moduleType.ToString(); var info = moduleType.GetType().GetField(description); return(Attribute.GetCustomAttribute(info, typeof(ModuleInfoAttribute)) as ModuleInfoAttribute ?? new ModuleInfoAttribute()); }
public string GetName(ModuleType moduleType) { if (moduleType == ModuleType.Unknown) { return null; } return moduleType.ToString(); }
/// <summary> /// 外部调用显示UI /// </summary> /// <param name="type"></param> /// <param name="data"></param> public void Show(ModuleType type, object data = null) { //如果已经加载过则存入map,再次显示时直接show //如果未被加载,则从资源目录加载后,再进行show AppModule baseUI = null; if (uiObjMap.ContainsKey(type)) { baseUI = uiObjMap[type]; ShowModule(baseUI, type, data); } else { StartLoad(AssetType.Module, type.ToString(), (GameObject uiObj, string uiName) => { Type className = uiClassNameMap[type]; uiObj.AddComponent(className); baseUI = uiObj.GetComponent <AppModule>(); ShowModule(baseUI, type, data); uiObjMap.Add(type, baseUI); }); } }
public string GetCaption(ModuleType moduleType) { switch(moduleType) { case ModuleType.Unknown: return null; case ModuleType.EmployeesPeek: case ModuleType.EmployeesFilterPane: return "Employees"; case ModuleType.CustomersPeek: case ModuleType.CustomersFilterPane: return "Customers"; case ModuleType.ProductsPeek: case ModuleType.ProductsFilterPane: return "Products"; case ModuleType.Orders: case ModuleType.OrdersFilterPane: return "Sales"; case ModuleType.Quotes: case ModuleType.QuotesFilterPane: return "Opportunities"; case ModuleType.Dashboards: <<<<<<< HEAD case ModuleType.DashboardsFilterPane: ======= case ModuleType.DashboardsPane: case ModuleType.DashboardsEdit: >>>>>>> 58d5963b05133ab1068392b2084d015cb969dfb8 return "Dashboards"; default: return moduleType.ToString(); } }
public string GetCaption(ModuleType moduleType) { switch (moduleType) { case ModuleType.Unknown: return(null); case ModuleType.EmployeesPeek: case ModuleType.EmployeesFilterPane: return("Employees"); case ModuleType.CustomersPeek: case ModuleType.CustomersFilterPane: return("Customers"); case ModuleType.ProductsPeek: case ModuleType.ProductsFilterPane: return("Products"); case ModuleType.Orders: case ModuleType.OrdersFilterPane: return("Sales"); case ModuleType.Quotes: case ModuleType.QuotesFilterPane: return("Opportunities"); default: return(moduleType.ToString()); } }
public string GetName(ModuleType moduleType) { if (moduleType == ModuleType.None) { return(null); } return(moduleType.ToString()); }
public string GetTypeName(ModuleType moduleType) { if (moduleType == ModuleType.Unknown) { return(null); } return(moduleType.ToString()); }
protected void LogVerboseMessage(string tag, string message, params KeyValuePair <string, string>[] args) { var newArgs = args.ToList(); newArgs.Add(new KeyValuePair <string, string>("pipelineModuleId", Id)); newArgs.Add(new KeyValuePair <string, string>("pipelineModuleName", Configuration.Name)); newArgs.Add(new KeyValuePair <string, string>("pipelineModuleType", ModuleType.ToString())); PEMBus.InstanceLogger.AddCustomEvent(LagoVista.Core.PlatformSupport.LogLevel.Verbose, tag, message, newArgs.ToArray()); }
public Task ExecuteGroupAsync(CommandContext ctx, [Description("desc-module")] ModuleType module) { Command?cmd = ctx.CommandsNext.FindCommand(module.ToString(), out string _); if (cmd is CommandGroup group && group.IsExecutableWithoutSubcommands) { return(this.ExecuteGroupAsync(ctx, module.ToString())); } IReadOnlyList <string> cmds = this.Service.GetCommandsInModule(module); return(ctx.RespondWithLocalizedEmbedAsync(emb => { emb.WithColor(module.ToDiscordColor()); emb.WithLocalizedTitle("h-title-m", module); emb.WithLocalizedDescription(module.ToLocalizedDescriptionKey(), cmds.Select(s => Formatter.InlineCode(s)).JoinWith(", ")); emb.WithLocalizedFooter("h-footer", ctx.Client.CurrentUser.AvatarUrl); })); }
protected void LogException(string tag, Exception ex, params KeyValuePair <string, string>[] args) { Metrics.ErrorCount++; var newArgs = args.ToList(); newArgs.Add(new KeyValuePair <string, string>("pipelineModuleId", Id)); newArgs.Add(new KeyValuePair <string, string>("pipelineModuleName", Configuration.Name)); newArgs.Add(new KeyValuePair <string, string>("pipelineModuleType", ModuleType.ToString())); PEMBus.InstanceLogger.AddException(tag, ex, newArgs.ToArray()); }
public void LogError(ErrorCode err, params KeyValuePair <string, string>[] args) { Metrics.ErrorCount++; var newArgs = args.ToList(); newArgs.Add(new KeyValuePair <string, string>("pipelineModuleId", Id)); newArgs.Add(new KeyValuePair <string, string>("pipelineModuleName", Configuration.Name)); newArgs.Add(new KeyValuePair <string, string>("pipelineModuleType", ModuleType.ToString())); PEMBus.InstanceLogger.AddError(err, newArgs.ToArray()); }
public string GetModulesName(ModuleType type) { var modules = _modules.FirstOrDefault(x => x.Type == type); if (modules == null) { throw new ArgumentException(type.ToString(), "type"); } return(modules.Name); }
public string GetModuleText() { try { return(AuditReportResource.ResourceManager.GetString(ModuleType.ToString() + "Module")); } catch { return(null); } }
public override string ToString() { if (team.OfficerList.Count > 0) { return(team.ToString()); } else if (ModuleType != null) { return(ModuleType.ToString()); } else { return("Empty"); } }
// provide serialization for "STANDARD TYPES" pass on later? hmm... public override void WriteXml(XmlWriter writer) { base.WriteXml(writer); writer.WriteStartElement("MODULE_DATA"); writer.WriteElementString("PORT_TYPE", portType.ToString()); writer.WriteElementString("MODULE_TYPE", moduleType.ToString()); XmlUtils.SerializeBool(writer, operational, "OPERATIONAL"); XmlUtils.SerializeBool(writer, adrift, "ADRIFT"); writer.WriteElementString("ENERGY_CAP", EnergyMax.ToString()); writer.WriteElementString("ENERGY_REGEN", EnergyRegen.ToString()); writer.WriteElementString("DELTA_POSITION_MAX", DeltaPositionMax.ToString()); writer.WriteElementString("DELTA_POSITION_FACTOR", DeltaPositionFactor.ToString()); writer.WriteElementString("DELTA_ROTATION_MAX", DeltaRotationMax.ToString()); writer.WriteElementString("DELTA_ROTATION_ACCELERATION", DeltaRotationAcceleration.ToString()); writer.WriteEndElement(); }
public static void LogError(ModuleType module, Exception ex) { try { using (SqlConnection sqlCon = GetConnection()) { SqlCommand sqlCmd = sqlCon.CreateCommand(); sqlCmd.CommandText = "INSERT INTO ErrorLog(LogDateTime, Module, Description)" + "VALUES(GETDATE(), " + module.ToString() + ", " + ex.Message + ")"; sqlCmd.CommandType = System.Data.CommandType.Text; sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); } } catch { } }
private void Start() { switch (module) { case ModuleType.None: break; case ModuleType.All: Facade.Instance.InitAllModule(); break; default: var moduleResult = Facade.Instance.GetModule(module.ToString()); if (moduleResult != null) { Utility.DebugLog(moduleResult.ModuleMountObject.name); } break; } }
private void Start() { switch (module) { case ModuleType.None: break; case ModuleType.All: Facade.InitAllModule(); break; default: var moduleEnum = Utility.Framework.GetModuleEnum(module.ToString()); var moduleResult = Facade.GetModule(moduleEnum); if (moduleResult != null) { Utility.Debug.LogInfo(moduleResult.MountPoint.name); } break; } }
public string GetCaption(ModuleType moduleType) { switch (moduleType) { case ModuleType.Unknown: return(null); case ModuleType.EmployeesPeek: case ModuleType.EmployeesFilterPane: return("Employees"); case ModuleType.CustomersPeek: case ModuleType.CustomersFilterPane: return("Customers"); case ModuleType.ProductsPeek: case ModuleType.ProductsFilterPane: return("Products"); case ModuleType.Orders: case ModuleType.OrdersFilterPane: return("Sales"); case ModuleType.Quotes: case ModuleType.QuotesFilterPane: return("Opportunities"); case ModuleType.Dashboards: << << << < HEAD case ModuleType.DashboardsFilterPane: == == == = case ModuleType.DashboardsPane: case ModuleType.DashboardsEdit: >> >> >> > 58d 5963b05133ab1068392b2084d015cb969dfb8 return("Dashboards"); default: return(moduleType.ToString()); } }
public void reloadModule(string FileName) { Assembly ModuleAssembly = Assembly.LoadFrom(FileName); int j = 0; foreach (Type ModuleType in ModuleAssembly.GetTypes()) { if (ModuleType.IsPublic) { if (!ModuleType.IsAbstract) { Type typeInterface = ModuleType.GetInterface("RhoInterface.RhoModule", true); if (typeInterface != null) { Types.AvailableModule newModule = new Types.AvailableModule(); newModule.AssemblyPath = FileName; newModule.Instance = (RhoModule)Activator.CreateInstance(ModuleAssembly.GetType(ModuleType.ToString())); newModule.Instance.Host = this; newModule.Instance.Initialize(); newModule.Instance.user_id = Global.usr_id; newModule.Instance.role_set_id = Global.role_set_id; newModule.Instance.org_id = Global.org_id; newModule.Instance.login_number = Global.login_number; newModule.Instance.loadMyRolesNMsgtyps(); this.colAvailableModules.Add(newModule); j += 1; newModule = null; } typeInterface = null; } } } ModuleAssembly = null; }
//public void CreateModulePrvldgs() //{ // foreach (Types.AvailableModule ModuleOn in colAvailableModules) // { // if (ModuleOn.Instance != null) // { // ModuleOn.Instance.loadMyRolesNMsgtyps(); // } // } //} //private void AddAllModules(string FileName) //{ // Assembly ModuleAssembly = Assembly.LoadFrom(FileName); // int j = 0; // foreach (Type ModuleType in ModuleAssembly.GetTypes()) // { // if (ModuleType.IsPublic) // { // if (!ModuleType.IsAbstract) // { // Type typeInterface = ModuleType.GetInterface("RhoInterface.RhoModule", true); // if (typeInterface != null) // { // Types.AvailableModule newModule = new Types.AvailableModule(); // newModule.AssemblyPath = FileName; // newModule.Instance = (RhoModule)Activator.CreateInstance(ModuleAssembly.GetType(ModuleType.ToString())); // newModule.Instance.Initialize(); // newModule.Instance.Host = this; // newModule.Instance.user_id = Global.usr_id; // newModule.Instance.role_set_id = Global.role_set_id; // newModule.Instance.org_id = Global.org_id; // newModule.Instance.login_number = Global.login_number; // newModule.Instance.loadMyRolesNMsgtyps(); // //string vwPrivName = newModule.Instance.vwPrmssnName; // //string appName = newModule.Instance.name; // this.colAvailableModules.Add(newModule); // newModule = null; // } // typeInterface = null; // } // } // } // ModuleAssembly = null; //} public void AddModule(string FileName) { Assembly ModuleAssembly = Assembly.LoadFrom(FileName); int j = 0; foreach (Type ModuleType in ModuleAssembly.GetTypes()) { if (ModuleType.IsPublic) { if (!ModuleType.IsAbstract) { Type typeInterface = ModuleType.GetInterface("RhoInterface.RhoModule", true); if (typeInterface != null) { Types.AvailableModule newModule = new Types.AvailableModule(); newModule.AssemblyPath = FileName; newModule.Instance = (RhoModule)Activator.CreateInstance(ModuleAssembly.GetType(ModuleType.ToString())); newModule.Instance.Initialize(); newModule.Instance.Host = this; newModule.Instance.user_id = Global.usr_id; newModule.Instance.role_set_id = Global.role_set_id; newModule.Instance.org_id = Global.org_id; newModule.Instance.login_number = Global.login_number; newModule.Instance.loadMyRolesNMsgtyps(); string vwPrivName = newModule.Instance.vwPrmssnName; string appName = newModule.Instance.name; this.colAvailableModules.Add(newModule); j += 1; System.Windows.Forms.ToolStripMenuItem item1 = new ToolStripMenuItem(); item1.Name = "mnuItem" + j; item1.Text = newModule.Instance.name; item1.Image = System.Drawing.Image.FromHbitmap(newModule.Instance.mainInterface.Icon.ToBitmap().GetHbitmap()); item1.Click += new System.EventHandler(Global.myNwMainFrm.loadClickedModule); item1.Tag = newModule.Instance.whereToPut.ToString() + "|" + newModule.Instance.vwPrmssnName; if (newModule.Instance.whereToPut == 1) { Global.myNwMainFrm.customModulesToolStripMenuItem.DropDownItems.Add(item1); } else if (newModule.Instance.whereToPut == 2) { Global.myNwMainFrm.customModulesToolStripMenuItem.DropDownItems.Add(item1); } else { Global.myNwMainFrm.customModulesToolStripMenuItem.DropDownItems.Add(item1); } bool shdEnbl = false; Global.myNwMainFrm.cmnCdMn.ModuleName = appName; for (int i = 0; i < Global.role_set_id.Length; i++) { if (Global.myNwMainFrm.cmnCdMn.doesRoleHvThisPrvldg(Global.role_set_id[i], Global.myNwMainFrm.cmnCdMn.getPrvldgID(vwPrivName)) == true) { shdEnbl = true; } } Global.myNwMainFrm.cmnCdMn.ModuleName = null; if (shdEnbl == true) { item1.Enabled = true; item1.Visible = true; } else { item1.Enabled = false; item1.Visible = false; } newModule = null; } typeInterface = null; } } } ModuleAssembly = null; }
private void Initialize() { if (_pipeStream == null) { _pipeStream = new NamedPipeClientStream("PipeTo" + _parentProcessId + _type.ToString()); _pipeStream.Connect(); _streamWriter = new StreamWriter(_pipeStream) { AutoFlush = true }; _streamWriter.WriteLine($"{_module};Connected"); } }
/* CheckAndCreateTag(int size,string style,ModuleType typ) * Créé un tag pour le module en fonction de sa taille, son style, et son type * vérifie aussi si pour une taille X, le style S existe, renvoie le 1er style sinon * */ private string CheckAndCreateTag(int size,string style,ModuleType typ, out string outStyle) { string tag = ""; string outType = typ.ToString(); /*string*/ outStyle = style; if(typ == ModuleType.multiBloc) outType = "bloc"; if(_currentModule != null) { if( (_currentModule.GetModuleType() == ModuleType.facade || _currentModule.GetModuleType() == ModuleType.extremite //|| _currentModule.GetModuleType() == ModuleType.multiBloc //|| _currentModule.GetModuleType() == ModuleType.bloc ) && (typ == ModuleType.bloc || typ == ModuleType.multiBloc)) { outStyle = _dsMdl.GetFirstStyle(ModuleType.bloc,size); } } tag = outType + "_t" + size + "_" + outStyle; return tag; }
protected override void OnValidate() { base.OnValidate(); gameObject.name = type.ToString() + " slot"; }
public string GetPaneName(ModuleType moduleType) { return moduleType.ToString(); }
private void RenderReportViewer(Guid id, RelatedToType relatedType, ModuleType moduleType) { _log.Debug("Rendering [{0}] [{1}] Viewer...", relatedType.GetDescription(), moduleType.GetDescription()); try { var isDraft = false; var reportNumber = string.Empty; var templateQueryService = DependencyContainer.Resolve <ITemplateQueryService>(); Guid agencyId, templateId; if (relatedType != RelatedToType.Summary) { using (var iocService = DependencyContainer.Resolve <IReportQueryService>()) { //get workflow status detail _reportQueryService = iocService.Instance; var reportsInfo = _reportQueryService.GetReportInfo(id); isDraft = reportsInfo.State != ReportState.Complete; agencyId = reportsInfo.Agency.AgencyId; templateId = reportsInfo.TemplateId; if (!reportsInfo.WorkflowRights.CanView && !UserHasAccessRights(reportsInfo.Agency.AgencyId, moduleType)) { ReportViewer1.Visible = false; AccessDisabled.Visible = true; Response.Redirect("~/#/error"); return; } reportNumber = reportsInfo.Number; } } else { //get reportnumber for selected summary record using (var iocSummaryService = DependencyContainer.Resolve <ISummaryQueryService>()) { //get workflow status detail _summaryQueryService = iocSummaryService.Instance; var summaryInfo = _summaryQueryService.GetSummaryInfo(id); agencyId = summaryInfo.Agency.AgencyId; templateId = templateQueryService.Instance.GetDefaultTemplate(summaryInfo.Agency.AgencyId, moduleType).Id; if (!UserHasAccessRights(summaryInfo.Agency.AgencyId, moduleType)) { ReportViewer1.Visible = false; AccessDisabled.Visible = true; Response.Redirect("~/#/error"); return; } reportNumber = summaryInfo.Number; } } AccessDisabled.Visible = false; var reportServerUri = String.Format("http://{0}/ReportServer", ConfigurationManager.AppSettings["ReportServer"]); var reportPath = String.Format("/{0}", ConfigurationManager.AppSettings["ReportRootPath"]); ReportViewer1.ServerReport.ReportPath = reportPath; ReportViewer1.ServerReport.ReportServerUrl = new Uri(reportServerUri); ReportViewer1.ShowParameterPrompts = false; ReportViewer1.ShowFindControls = false; ReportViewer1.ShowExportControls = true; ReportViewer1.ShowToolBar = true; int validity; var result = Int32.TryParse(ConfigurationManager.AppSettings["SSRSTokenTimeout"], out validity); if (!result) { validity = 5; } var headerText = templateQueryService.Instance.GetTemplateHeaderText(moduleType, reportNumber, agencyId, templateId); var svcQuery = String.Format("{0}", ConfigurationManager.AppSettings["SSRSServiceHost"]) + "api/ssrsreports/getreportsdata/" + id.ToString() + "/" + moduleType.ToString() + "/" + relatedType.ToString() + "?wsSignInKey=" + new JwtTokenGenerator(TokenManagerFactory.GetTokenManager()).GenerateJwtToken(System.Web.HttpContext.Current.User.Identity as ClaimsIdentity, validity); var reportParameters = new List <ReportParameter> { new ReportParameter("svcQuery", svcQuery), new ReportParameter("isDraft", isDraft.ToString()), new ReportParameter("imageDataSource", ConfigurationManager.ConnectionStrings["InformRMSMediaSSRS"].ConnectionString), new ReportParameter("headerText", headerText) }; _log.Debug("SSRS URI: {0}", reportServerUri); reportParameters.ForEach(p => { foreach (var value in p.Values) { _log.Debug("SSRS Parameter {0} = {1}", p.Name, value); } }); ReportViewer1.ServerReport.SetParameters(reportParameters); ReportViewer1.ServerReport.Refresh(); } catch (Exception ex) { _log.Error("Failure to render SSRS Report {0}", ex); } }
public static List <Module> GetModules(ModuleType moduleType) { List <Module> list = new List <Module>(); DataRowView[] array = ((ModuleCache) new ModuleCache().GetData()).dvModuleBy_Type.FindRows(moduleType.ToString()); for (int i = 0; i < array.Length; i++) { DataRowView dataRowView = array[i]; Module module = new Module(); Module @object = ModuleUtils.GetObject(dataRowView.Row); list.Add(@object); } return(list); }