コード例 #1
0
        public void OnExecute(IBootstrapStageManager manager)
        {
            var container   = manager.GetBootstrapComponent <Cireson.Core.Interfaces.Containers.IPlatformContainer>().CommonContainer;
            var dataContext = container.Resolve <IDataContext>();

            var localizations = new List <Localization>
            {
                // Set Action Name Value
                // This will be the displayed name for your custom action
                // Replace default value with your action name
                new Localization {
                    Key = "HelloWorld", Value = "Hello World", Description = "Custom Action Name"
                },
                // Set Icon Value
                // This will be the actual icon to be displayed in your custom action button
                // Replace default value with the desired icon name
                new Localization {
                    Key = "HelloWorldIcon", Value = "attention", Description = "Custom Action Icon"
                },
                // Set Category Title
                // This is used for templating purposes and it is displayed under remote actions flyout
                // Default: Custom Actions
                // Currently only displayed for Remote Actions
                new Localization {
                    Key = "RCA", Value = "Custom Actions", Description = "Category Title"
                }
            };

            dataContext.Set <Localization>().UpsertSmartDefaults(localizations,
                                                                 (l1, l2) => l1.Key == l2.Key && l1.Culture == l2.Culture,
                                                                 l => l.Description,
                                                                 l => l.Value);
            dataContext.SaveChanges();
        }
コード例 #2
0
        public void OnExecute(IBootstrapStageManager manager)
        {
            var container   = manager.GetBootstrapComponent <Cireson.Core.Interfaces.Containers.IPlatformContainer>().CommonContainer;
            var dataContext = container.Resolve <IDataContext>();

            var localizations = new List <Localization>
            {
                // Set Action Name Value
                // This will be the displayed name for your custom action
                // Replace default value with your action name
                new Localization {
                    Key = "GetEventLog", Value = "Get-EventLog", Description = "Custom Action Name"
                },
                // Set Icon Value
                // This will be the actual icon to be displayed in your custom action button
                // Replace default value with the desired icon name
                new Localization {
                    Key = "GetEventLogIcon", Value = "scripts-default", Description = "Custom Action Icon"
                },
                // Set Category Title
                // This is used for templating purposes and it is displayed under remote actions flyout
                // Default: Custom Actions
                // Currently only displayed for Remote Actions
                new Localization {
                    Key = "RCA", Value = "Custom Actions", Description = "Category Title"
                },

                // Dialog
                new Localization {
                    Key = "LogName", Value = "Select a Log", Description = "Parameter Label"
                },
                new Localization {
                    Key = "Run", Value = "Run", Description = "Button Text"
                },

                // Grid
                new Localization {
                    Key = "Index", Value = "Index", Description = "Column Name"
                },
                new Localization {
                    Key = "Source", Value = "Source", Description = "Column Name"
                },
                new Localization {
                    Key = "EntryType", Value = "Entry Type", Description = "Column Name"
                },
                new Localization {
                    Key = "Message", Value = "Message", Description = "Column Name"
                },
                new Localization {
                    Key = "NoLogsAvailable", Value = "There are no available logs to display.", Description = "Text"
                },
            };

            dataContext.Set <Localization>().UpsertSmartDefaults(localizations,
                                                                 (l1, l2) => l1.Key == l2.Key && l1.Culture == l2.Culture,
                                                                 l => l.Description,
                                                                 l => l.Value);
            dataContext.SaveChanges();
        }