Пример #1
0
 public MockProvider(Uri remoteUri, MockProviderConfiguration configuration, MockRemotePeer context)
 {
     RemoteUri     = remoteUri;
     Stats         = new MockProviderStats(context?.ContextStats);
     Configuration = configuration;
     this.context  = context;
 }
        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);
        }