• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ICommandConsole类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ICommandConsole的典型用法代码示例。如果您正苦于以下问题:C# ICommandConsole类的具体用法?C# ICommandConsole怎么用?C# ICommandConsole使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ICommandConsole类属于命名空间,在下文中一共展示了ICommandConsole类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: RegisterConsoleCommands

        public static void RegisterConsoleCommands(ICommandConsole console)
        {
            console.Commands.AddCommand(
                "General",
                false,
                "stats show",
                "stats show [list|all|(<category>[.<container>])+",
                "Show statistical information for this server",
                "If no final argument is specified then legacy statistics information is currently shown.\n"
                    + "'list' argument will show statistic categories.\n"
                    + "'all' will show all statistics.\n"
                    + "A <category> name will show statistics from that category.\n"
                    + "A <category>.<container> name will show statistics from that category in that container.\n"
                    + "More than one name can be given separated by spaces.\n"
                    + "THIS STATS FACILITY IS EXPERIMENTAL AND DOES NOT YET CONTAIN ALL STATS",
                HandleShowStatsCommand);

            console.Commands.AddCommand(
                "General",
                false,
                "show stats",
                "show stats [list|all|(<category>[.<container>])+",
                "Alias for 'stats show' command",
                HandleShowStatsCommand);

            StatsLogger.RegisterConsoleCommands(console);
        }
开发者ID:ffoliveira,项目名称:opensimulator,代码行数:27,代码来源:StatsManager.cs


示例2: RegisterHttpConsoleCommands

        public static void RegisterHttpConsoleCommands(ICommandConsole console)
        {
            console.Commands.AddCommand(
                "Comms", false, "show http-handlers",
                "show http-handlers",
                "Show all registered http handlers", HandleShowHttpHandlersCommand);

        }
开发者ID:AkiraSonoda,项目名称:akisim,代码行数:8,代码来源:MainServer.cs


示例3: CheckFileDoesNotExist

        /// <summary>
        /// Check if the given file path exists.
        /// </summary>
        /// <remarks>If not, warning is printed to the given console.</remarks>
        /// <returns>true if the file does not exist, false otherwise.</returns>
        /// <param name='console'></param>
        /// <param name='path'></param>
        public static bool CheckFileDoesNotExist(ICommandConsole console, string path)
        {
            if (File.Exists(path))
            {
                console.OutputFormat("File {0} already exists.  Please move or remove it.", path);
                return false;
            }

            return true;
        }
开发者ID:Barosonix,项目名称:Barosonix-Core,代码行数:17,代码来源:ConsoleUtil.cs


示例4: RegisterConsoleCommands

 public static void RegisterConsoleCommands(ICommandConsole console)
 {
     console.Commands.AddCommand(
         "Debug",
         false,
         "debug stats record",
         "debug stats record start|stop",
         "Control whether stats are being regularly recorded to a separate file.",
         "For debug purposes.  Experimental.",
         HandleStatsRecordCommand);
 }
开发者ID:Michelle-Argus,项目名称:opensim,代码行数:11,代码来源:StatsLogger.cs


示例5: RegisterConsoleCommands

 public static void RegisterConsoleCommands(ICommandConsole console)
 {
     console.Commands.AddCommand(
         "General",
         false,
         "show checks",
         "show checks",
         "Show checks configured for this server",
         "If no argument is specified then info on all checks will be shown.\n"
             + "'list' argument will show check categories.\n"
             + "THIS FACILITY IS EXPERIMENTAL",
         HandleShowchecksCommand);
 }
开发者ID:CassieEllen,项目名称:opensim,代码行数:13,代码来源:ChecksManager.cs


示例6: SetUp

        public void SetUp()
        {
            inputLine = new InputLine();
            stubCommandConsole = MockRepository.GenerateStub<ICommandConsole>();
            stubMessageConsole = MockRepository.GenerateStub<IMessageConsole>();
            stubInputView = MockRepository.GenerateStub<IOverlayView>();
            stubCommandConsoleView = MockRepository.GenerateStub<IOverlayView>();
            stubMessageConsoleView = MockRepository.GenerateStub<IOverlayView>();
            stubPossibleCommandsView = MockRepository.GenerateStub<IOverlayView>();
            stubKeyboard = MockRepository.GenerateStub<IKeyboard>();

            consoleController = new ConsoleController(inputLine, stubCommandConsole, stubMessageConsole, stubInputView, stubCommandConsoleView, stubMessageConsoleView, stubPossibleCommandsView, stubKeyboard);
        }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:13,代码来源:ConsoleControllerTests.cs


示例7: ConsoleController

        public ConsoleController(InputLine inputLine, ICommandConsole commandConsole, IMessageConsole messageConsole, 
            IOverlayView inputView, IOverlayView commandConsoleView, IOverlayView messageConsoleView, IOverlayView possibleCommandsView, IKeyboard keyboard)
        {
            this.InputLine = inputLine;
            _commandConsole = commandConsole;
            _messageConsole = messageConsole;
            _inputView = inputView;
            _commandConsoleView = commandConsoleView;
            _messageConsoleView = messageConsoleView;
            _possibleCommandsView = possibleCommandsView;
            _keyboard = keyboard;

            this.InputLine.CurrentInput = "";
        }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:14,代码来源:ConsoleController.cs


示例8: RegisterConsoleCommands

 public static void RegisterConsoleCommands(ICommandConsole console)
 {
     console.Commands.AddCommand(
         "General",
         false,
         "show stats",
         "show stats [list|all|<category>]",
         "Show statistical information for this server",
         "If no final argument is specified then legacy statistics information is currently shown.\n"
             + "If list is specified then statistic categories are shown.\n"
             + "If all is specified then all registered statistics are shown.\n"
             + "If a category name is specified then only statistics from that category are shown.\n"
             + "THIS STATS FACILITY IS EXPERIMENTAL AND DOES NOT YET CONTAIN ALL STATS",
         HandleShowStatsCommand);
 }
开发者ID:rryk,项目名称:omp-server,代码行数:15,代码来源:StatsManager.cs


示例9: RegisterConsoleCommands

        public static void RegisterConsoleCommands(ICommandConsole console)
        {
            console.Commands.AddCommand(
                "General",
                false,
                "stats record",
                "stats record start|stop",
                "Control whether stats are being regularly recorded to a separate file.",
                "For debug purposes.  Experimental.",
                HandleStatsRecordCommand);

            console.Commands.AddCommand(
                "General",
                false,
                "stats save",
                "stats save <path>",
                "Save stats snapshot to a file.  If the file already exists, then the report is appended.",
                "For debug purposes.  Experimental.",
                HandleStatsSaveCommand);
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:20,代码来源:StatsLogger.cs


示例10: SetUpConsole

        private void SetUpConsole()
        {
            List<ICommandConsole> Plugins = AuroraModuleLoader.PickupModules<ICommandConsole>();
            foreach (ICommandConsole plugin in Plugins)
            {
                plugin.Initialize("Region", ConfigSource, this);
            }

            m_console = m_applicationRegistry.Get<ICommandConsole>();
            if (m_console == null)
                m_console = new LocalConsole();
            ILoggerRepository repository = LogManager.GetRepository();
            IAppender[] appenders = repository.GetAppenders();
            OpenSimAppender m_consoleAppender = null;
            foreach (IAppender appender in appenders)
            {
                if (appender.Name == "Console")
                {
                    m_consoleAppender = (OpenSimAppender)appender;
                    break;
                }
            }

            foreach (IAppender appender in appenders)
            {
                if (appender.Name == "LogFileAppender")
                {
                    m_logFileAppender = appender;
                }
            }

            if (null != m_consoleAppender)
            {
                m_consoleAppender.Console = m_console;
                // If there is no threshold set then the threshold is effectively everything.
                if (null == m_consoleAppender.Threshold)
                    m_consoleAppender.Threshold = Level.All;
                m_console.Output(String.Format("Console log level is {0}", m_consoleAppender.Threshold));
            }
            if (m_console == null)
                m_console = new LocalConsole();
            MainConsole.Instance = m_console;
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:43,代码来源:OpenSimBase.cs


示例11: RegisterHttpConsoleCommands

        public static void RegisterHttpConsoleCommands(ICommandConsole console)
        {
            console.Commands.AddCommand(
                "Comms", false, "show http-handlers",
                "show http-handlers",
                "Show all registered http handlers", HandleShowHttpHandlersCommand);

            console.Commands.AddCommand(
                "Debug", false, "debug http", "debug http <in|out|all> [<level>]",
                "Turn on http request logging.",
                "If in or all and\n"
                    + "  level <= 0 then no extra logging is done.\n"
                    + "  level >= 1 then short warnings are logged when receiving bad input data.\n"
                    + "  level >= 2 then long warnings are logged when receiving bad input data.\n"
                    + "  level >= 3 then short notices about all incoming non-poll HTTP requests are logged.\n"
                    + "  level >= 4 then the time taken to fulfill the request is logged.\n"
                    + "  level >= 5 then a sample from the beginning of the incoming data is logged.\n"
                    + "  level >= 6 then the entire incoming data is logged.\n"
                    + "  no level is specified then the current level is returned.\n\n"
                    + "If out or all and\n"
                    + "  level >= 3 then short notices about all outgoing requests going through WebUtil are logged.\n"
                    + "  level >= 4 then the time taken to fulfill the request is logged.\n",
                HandleDebugHttpCommand);
        }
开发者ID:rryk,项目名称:omp-server,代码行数:24,代码来源:MainServer.cs


示例12: OutputContainerStatsToConsole

 private static void OutputContainerStatsToConsole(
     ICommandConsole con, SortedDictionary<string, Stat> container)
 {
     foreach (string report in GetContainerStatsReports(container))
         con.Output(report);
 }
开发者ID:ffoliveira,项目名称:opensimulator,代码行数:6,代码来源:StatsManager.cs


示例13: TryParseConsoleUuid

        /// <summary>
        /// Try to parse a console UUID from the console.
        /// </summary>
        /// <remarks>
        /// Will complain to the console if parsing fails.
        /// </remarks>
        /// <returns></returns>
        /// <param name='console'>If null then no complaint is printed.</param>
        /// <param name='rawUuid'></param>
        /// <param name='uuid'></param>
        public static bool TryParseConsoleUuid(ICommandConsole console, string rawUuid, out UUID uuid)
        {
            if (!UUID.TryParse(rawUuid, out uuid))
            {
                if (console != null)
                    console.OutputFormat("ERROR: {0} is not a valid uuid", rawUuid);

                return false;
            }
    
            return true;
        }
开发者ID:Barosonix,项目名称:Barosonix-Core,代码行数:22,代码来源:ConsoleUtil.cs


示例14: TryParseConsoleInt

        /// <summary>
        /// Convert a console integer to an int, automatically complaining if a console is given.
        /// </summary>
        /// <param name='console'>Can be null if no console is available.</param>
        /// <param name='rawConsoleInt'>/param>
        /// <param name='i'></param>
        /// <returns></returns>
        public static bool TryParseConsoleInt(ICommandConsole console, string rawConsoleInt, out int i)
        {
            if (!int.TryParse(rawConsoleInt, out i))
            {
                if (console != null)
                    console.OutputFormat("ERROR: {0} is not a valid integer", rawConsoleInt);

                return false;
            }

            return true;
        }
开发者ID:Barosonix,项目名称:Barosonix-Core,代码行数:19,代码来源:ConsoleUtil.cs


示例15: TryParseConsoleNaturalInt

        /// <summary>
        /// Convert a console integer to a natural int, automatically complaining if a console is given.
        /// </summary>
        /// <param name='console'>Can be null if no console is available.</param>
        /// <param name='rawConsoleInt'>/param>
        /// <param name='i'></param>
        /// <returns></returns>
        public static bool TryParseConsoleNaturalInt(ICommandConsole console, string rawConsoleInt, out int i)
        {
            if (TryParseConsoleInt(console, rawConsoleInt, out i))
            {
                if (i < 0)
                {
                    if (console != null)
                        console.OutputFormat("ERROR: {0} is not a positive integer", rawConsoleInt);

                    return false;
                }

                return true;
            }

            return false;
        }
开发者ID:Barosonix,项目名称:Barosonix-Core,代码行数:24,代码来源:ConsoleUtil.cs


示例16: TryParseConsoleId

        /// <summary>
        /// Tries to parse the input as either a UUID or a local ID.
        /// </summary>
        /// <returns>true if parsing succeeded, false otherwise.</returns>
        /// <param name='console'></param>
        /// <param name='rawId'></param>
        /// <param name='uuid'></param>
        /// <param name='localId'>
        /// Will be set to ConsoleUtil.LocalIdNotFound if parsing result was a UUID or no parse succeeded.
        /// </param>
        public static bool TryParseConsoleId(ICommandConsole console, string rawId, out UUID uuid, out uint localId)
        {
            if (TryParseConsoleUuid(null, rawId, out uuid))
            {
                localId = LocalIdNotFound;
                return true;
            }

            if (TryParseConsoleLocalId(null, rawId, out localId))
            {
                return true;
            }

            if (console != null)
                console.OutputFormat("ERROR: {0} is not a valid UUID or local id", rawId);

            return false;
        }
开发者ID:Barosonix,项目名称:Barosonix-Core,代码行数:28,代码来源:ConsoleUtil.cs


示例17: TryParseConsoleBool

        /// <summary>
        /// Convert a console integer to an int, automatically complaining if a console is given.
        /// </summary>
        /// <param name='console'>Can be null if no console is available.</param>
        /// <param name='rawConsoleVector'>/param>
        /// <param name='vector'></param>
        /// <returns></returns>
        public static bool TryParseConsoleBool(ICommandConsole console, string rawConsoleString, out bool b)
        {
            if (!bool.TryParse(rawConsoleString, out b))
            {
                if (console != null)
                    console.OutputFormat("ERROR: {0} is not a true or false value", rawConsoleString);

                return false;
            }

            return true;
        }
开发者ID:Barosonix,项目名称:Barosonix-Core,代码行数:19,代码来源:ConsoleUtil.cs


示例18: OutputStatToConsole

 private static void OutputStatToConsole(ICommandConsole con, Stat stat)
 {
     con.Output(stat.ToConsoleString());
 }
开发者ID:ffoliveira,项目名称:opensimulator,代码行数:4,代码来源:StatsManager.cs


示例19: TryParseConsoleLocalId

        public static bool TryParseConsoleLocalId(ICommandConsole console, string rawLocalId, out uint localId)
        {
            if (!uint.TryParse(rawLocalId, out localId))
            {
                if (console != null)
                    console.OutputFormat("ERROR: {0} is not a valid local id", localId);

                return false;
            }

            if (localId == 0)
            {
                if (console != null)
                    console.OutputFormat("ERROR: {0} is not a valid local id - it must be greater than 0", localId);

                return false;
            }

            return true;
        }
开发者ID:Barosonix,项目名称:Barosonix-Core,代码行数:20,代码来源:ConsoleUtil.cs


示例20: OutputContainerChecksToConsole

 private static void OutputContainerChecksToConsole(ICommandConsole con, SortedDictionary<string, Check> container)
 {
     foreach (Check check in container.Values)
     {
         con.Output(check.ToConsoleString());
     }
 }
开发者ID:CassieEllen,项目名称:opensim,代码行数:7,代码来源:ChecksManager.cs



注:本文中的ICommandConsole类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ICommandContext类代码示例发布时间:2022-05-24
下一篇:
C# ICommandBus类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap