Example #1
0
 protected override void RegisterServices(IVLFactory factory)
 {
     if (!factory.HasService <NodeContext, IResourceProvider <Device> >())
     {
         factory.RegisterService <NodeContext, IResourceProvider <Device> >(nodeContext =>
         {
             // One per entry point
             return(ResourceProvider.NewPooledPerApp(nodeContext, () => new Device(DriverType.Hardware, DeviceCreationFlags.BgraSupport | DeviceCreationFlags.VideoSupport)));
         });
     }
 }
Example #2
0
 protected override void RegisterServices(IVLFactory factory)
 {
     if (!factory.HasService <NodeContext, IResourceProvider <Device> >())
     {
         factory.RegisterService <NodeContext, IResourceProvider <Device> >(nodeContext =>
         {
             // One per entry point
             var key = nodeContext.Path.Stack.Last();
             return(ResourceProvider.NewPooledSystemWide(key, _ => new Device(DriverType.Hardware, DeviceCreationFlags.BgraSupport | DeviceCreationFlags.VideoSupport)));
         });
     }
 }