コード例 #1
0
        public static RegionEndpoint GetBySystemName(string systemName)
        {
            RegionEndpoint value = null;

            if (_hashBySystemName.TryGetValue(systemName, out value))
            {
                return(value);
            }
            IRegionEndpoint regionEndpoint = RegionEndpointProvider.GetRegionEndpoint(systemName);

            return(NewEndpoint(systemName, regionEndpoint.DisplayName));
        }
コード例 #2
0
        /// <summary>
        /// Gets the region based on its system name like "us-west-1"
        /// </summary>
        /// <param name="systemName">The system name of the service like "us-west-1"</param>
        /// <returns></returns>
        public static RegionEndpoint GetBySystemName(string systemName)
        {
            RegionEndpoint region = null;

            if (_hashBySystemName.TryGetValue(systemName, out region))
            {
                return(region);
            }

            IRegionEndpoint regionEndpointFromProvider = RegionEndpointProvider.GetRegionEndpoint(systemName);

            // We received an instance of IRegionEndpoint from a provider,
            // now we should wrap it in RegionEndpoint before returning the data back to the client code.
            // GetRegionEndpoint will always return a non-null value. If the the region(systemName) is unknown,
            // the providers will create a fallback instance that will generate an endpoint to the best
            // of its knowledge.
            return(NewEndpoint(systemName, regionEndpointFromProvider.DisplayName));
        }