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

            // Parse the environment name portion
            DatacenterName dcName;
            string         shPart;

            if (!DatacenterName.TryParseCore(input, out dcName, out shPart) || String.IsNullOrEmpty(shPart))
            {
                return(false);
            }

            var match = Parser.Match(shPart);

            if (!match.Success)
            {
                return(false);
            }
            else
            {
                result = new ServiceHostName(
                    dcName,
                    match.Groups["host"].Value);
                if (match.Groups["rest"].Success)
                {
                    remainder = match.Groups["rest"].Value;
                }
                return(true);
            }
        }
        public ServiceHostName(DatacenterName datacenter, string name)
            : this()
        {
            Guard.NotNullOrEmpty(name, "name");

            Datacenter = datacenter;
            Name       = name.ToLowerInvariant();
        }