Ejemplo n.º 1
0
        private static void ParseCore(string str, out string kind, out string args)
        {
            kind = args = null;
            if (string.IsNullOrWhiteSpace(str))
            {
                return;
            }
            str = str.Trim();
            int ich = str.IndexOf('{');

            if (ich < 0)
            {
                kind = str;
                return;
            }
            if (ich == 0 || str[str.Length - 1] != '}')
            {
                throw Contracts.Except("Invalid SubComponent string: mismatched braces, or empty component name.");
            }

            kind = str.Substring(0, ich);
            args = CmdLexer.UnquoteValue(str.Substring(ich));
        }