コード例 #1
0
        public void Initialize()
        {
            _commandsSet.Initialize(_dataStore.GetEntities <CustomCommand>());

            _menuItemsSet.MenuItems.Add(new CommandsViewModel(_commandsSet));       // TODO: Move to Enable()

            _commandsSet.CustomCommands.ListChanged += CustomCommandsOnListChanged; // TODO: Move to Enable()
        }
コード例 #2
0
        public GetCommandsToRun_Should()
        {
            var services = new ServiceCollection();

            services.AddSimpleCommandsPlugin();

            _commandsSet   = services.BuildServiceProvider().GetService <ICommandsSet>();
            _customCommand = new CustomCommand
            {
                CommandWord = "!ping",
                Response    = "PONG",
                Enabled     = true,
                Access      = Access.Everyone,
            };
            _commandsSet.Initialize(new List <CustomCommand> {
                _customCommand
            });
        }