Esempio n. 1
0
        /// <summary>
        /// Create a new TccCommand spec, defining all options available. When this method is used,
        /// the parser can automatically resolve paths starting with a forward slash.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="winApiCmd"></param>
        /// <param name="options"></param>
        public TccCommand(string name, TccLib.TCAction winApiCmd, IEnumerable <TccArg> options)
        {
            Name = name.ToUpper();
            var defaultOpts = EnumerableHelper.Enumerate(new TccArg("?"));

            _Options  = new HashSet <TccArg>((options ?? defaultOpts).Concat(defaultOpts));
            WinApiCmd = winApiCmd;
        }
Esempio n. 2
0
        /// <summary>
        /// Execute the specificied TCC commmand.
        /// </summary>
        /// <param name="action"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public uint Execute(TccLib.TCAction action, string text)
        {
            uint result;

            fixed(char *textPtr = TccCommands.GetBuffer(text))
            {
                result = action(textPtr);
            }

            return(result);
        }
Esempio n. 3
0
 public TccCommand(string name, TccLib.TCAction winApiCmd) : this(name, winApiCmd, null)
 {
     CreatedWithoutOptions = true;
 }