internal static bool TryParseCore(string input, out ServiceHostInstanceName result, out string remainder)
        {
            result    = ServiceHostInstanceName.Empty;
            remainder = null;

            // Parse the environment name portion
            ServiceHostName shName;
            string          shiPart;

            if (!ServiceHostName.TryParseCore(input, out shName, out shiPart) || String.IsNullOrEmpty(shiPart))
            {
                return(false);
            }

            var match = Parser.Match(shiPart);

            if (!match.Success)
            {
                return(false);
            }
            else
            {
                result = new ServiceHostInstanceName(
                    shName,
                    Int32.Parse(match.Groups["id"].Value));
                if (match.Groups["rest"].Success)
                {
                    remainder = match.Groups["rest"].Value;
                }
                return(true);
            }
        }
        public ServiceHostInstanceName(ServiceHostName host, int id)
            : this()
        {
            Guard.NonNegative(id, "id");

            Host = host;
            Id   = id;
        }