protected override object OnExecute(CommandContext context)
        {
            var listener = ListenerCommand.GetListener(context.CommandNode);

            if (listener == null)
            {
                throw new CommandException(string.Format(Properties.Resources.Text_CannotObtainCommandTarget, "Server"));
            }

            if (listener.IsListening)
            {
                listener.Stop();
            }

            if (listener.IsListening)
            {
                context.Output.WriteLine(CommandOutletColor.Red, Properties.Resources.Text_CommandExecuteFailed);
            }
            else
            {
                context.Output.WriteLine(CommandOutletColor.Green, Properties.Resources.Text_CommandExecuteSucceed);
            }

            return(!listener.IsListening);
        }
        protected override object OnExecute(CommandContext context)
        {
            var listener = ListenerCommand.GetListener(context.CommandNode);

            if (listener == null)
            {
                throw new CommandException(ResourceUtility.GetString("Text.CannotObtainCommandTarget", "Server"));
            }

            if (listener.IsListening)
            {
                listener.Stop();
            }

            if (listener.IsListening)
            {
                context.Output.WriteLine(CommandOutletColor.Red, ResourceUtility.GetString("Text.CommandExecuteFailed"));
            }
            else
            {
                context.Output.WriteLine(CommandOutletColor.Green, ResourceUtility.GetString("Text.CommandExecuteSucceed"));
            }

            return(!listener.IsListening);
        }