Class to provide support for Uri query parameters which uses .Net reflection to identify and set properties.
コード例 #1
0
 /// <summary>
 /// </summary>
 /// <param name="compositData"></param>
 /// <returns></returns>
 public ITransport CreateTransport(URISupport.CompositeData compositData)
 {
     StringDictionary options = compositData.Parameters;
     FailoverTransport transport = CreateTransport(options);
     transport.Add(false, compositData.Components);
     return transport;
 }
コード例 #2
0
        public IProvider CreateProvider(Uri remoteUri)
        {
            URISupport.CompositeData compositeData      = URISupport.ParseComposite(remoteUri);
            StringDictionary         filteredProperties = PropertyUtil.FilterProperties(compositeData.Parameters, FAILOVER_OPTION_PREFIX);
            FailoverProvider         failoverProvider   = new FailoverProvider(compositeData.Components);

            PropertyUtil.SetProperties(failoverProvider, filteredProperties);
            return(failoverProvider);
        }
コード例 #3
0
        public IProvider CreateProvider(Uri remoteUri)
        {
            MockProviderConfiguration configuration = new MockProviderConfiguration();
            MockRemotePeer            remote        = MockRemotePeer.Instance;

            remote?.ContextStats.RecordProviderCreated();
            StringDictionary properties     = URISupport.ParseParameters(remoteUri);
            StringDictionary mockProperties = PropertyUtil.FilterProperties(properties, "mock.");

            PropertyUtil.SetProperties(configuration, mockProperties);
            MockProvider provider = new MockProvider(remoteUri, configuration, remote);

            return(provider);
        }