コード例 #1
0
        internal object ExecuteCommand(string cmdname, IArgument[] args, StringComparison stringComparison,
                                       string cmdlinestr = null, CommandSegment[] cmdlineSegments = null, CommandSegment[] argsSegments = null)
        {
            object result;

            if (TryExecuteCommandHost(cmdname, args, stringComparison, out result))
            {
                return(result);
            }
            if (CommandInvoker.TryInvoke(methods, cmdAttrs, paramAttrs, instance, cmdname, args, stringComparison, out result))
            {
                return(result);
            }

            CommandUnResolvedEventArgs eArgs = new CommandUnResolvedEventArgs(cmdlinestr, cmdlineSegments, args, cmdname, argsSegments);

            OnCommandUnresolved(eArgs);
            if (!eArgs.Handled)
            {
                throw new CommandEntryPointNotFoundException(cmdname);
            }
            return(null);
        }
コード例 #2
0
 private void OnCommandUnresolved(CommandUnResolvedEventArgs args)
 {
     CommandUnresolved?.Invoke(this, args);
 }