Пример #1
0
        public OicHostDevice(OicConfiguration configuration, IServiceProvider services)
        {
            _configuration = configuration;
            _services      = services;

            _resources.Add("/oic/res", _resourceDirectory);
            _discoverableOicResources.Add(OicResourceLink.FromResource(new OicResourceDirectory()));
        }
Пример #2
0
 public ResourceRepositoryMiddleware(RequestDelegate next, IServiceProvider services, IOptions <ResourceRepositoryOptions> options)
 {
     _next               = next;
     _options            = options.Value;
     _oicConfiguration   = services.GetRequiredService <OicConfiguration>();
     _resourceRepository = _options.ResourceRepository
                           ?? (_options.ResourceRepositoryType != null
                             ? (IOicResourceRepository)ActivatorUtilities.CreateInstance(services, _options.ResourceRepositoryType, _options.ResourceRepositoryArgs)
                             : ActivatorUtilities.CreateInstance <DefaultResourceRepository>(services));
 }
Пример #3
0
 public MyResources(OicConfiguration configuration)
 {
     _configuration = configuration;
     _helloResource = new OicBaseResouece <string>
     {
         Interfaces    = OicResourceInterface.Baseline | OicResourceInterface.ReadOnly,
         ResourceTypes = { "oicnet.hello" },
         RelativeUri   = "/hello",
         Value         = "Hello World"
     };
 }
Пример #4
0
 public void CreateOicConfiguration()
 {
     _configuration = new OicConfiguration(new TestResourceResolver());
 }