当前位置: 首页>>代码示例>>C#>>正文


C# ICommandConsole类代码示例

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


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


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