Пример #1
0
        /// <summary>
        /// Called automatically when .Command launches, you can add your own Registrations here.
        /// Don't forget to match your DevelopmentCommands.Register call with a DevelopmentCommands.Unregister call
        /// by calling DevelopmentCommands.Unregister in CommandRegistration.UnRegisterCommandsOnConsoleExit
        ///
        /// Note: You can Register Commands from anywhere you like, if you do it here however, you'll be able to keep the
        /// registration / unregistration tidy, this method will be called automatically for you at a sensible time.
        ///
        /// </summary>
        public static void RegisterCommandsOnConsoleStartup(bool clearConsoleCommandEnabled, bool deviceIdCommandEnabled, bool inspectCommandEnabled, bool autoScrollCommandEnabled)
        {
            // Register Commands by type
            if (deviceIdCommandEnabled)
            {
                DevelopmentCommands.Register(typeof(DeviceIdSampleCommands));
            }

            if (clearConsoleCommandEnabled)
            {
                DevelopmentCommands.Register(typeof(ClearConsoleSampleCommands));
            }

            if (autoScrollCommandEnabled)
            {
                DevelopmentCommands.Register(typeof(AutoScrollCommands));
            }

            if (inspectCommandEnabled)
            {
                DevelopmentCommands.Register(typeof(Inspect));
            }

            // Register Commands by object
            if (DevelopmentConsole.Instance)
            {
                DevelopmentCommands.Register(DevelopmentConsole.Instance);
            }
        }
Пример #2
0
    /// <summary>
    /// This class is here to provide users with a single easy location to register all command objects with the Development Console.
    /// It is for illustration purposes only, you can do something similar to this in your own code.
    ///
    /// Note: You can Register Commands from anywhere in runtime code.
    ///
    /// </summary>
    public static void RegisterCommandsOnConsoleStartup()
    {
        // Register Commands by type
        DevelopmentCommands.Register(typeof(DeviceIdSampleCommands));
        DevelopmentCommands.Register(typeof(ClearConsoleSampleCommands));
        DevelopmentCommands.Register(typeof(AutoScrollCommands));
        DevelopmentCommands.Register(typeof(Inspect));

        // Register Commands by object
        DevelopmentCommands.Register(DevelopmentConsole.Instance);
    }