Ejemplo n.º 1
0
        public DeviceManager(GlobalContext globalContext, IDevice device)
        {
            _globalContext = globalContext;
            _globalContext.LayoutRemoved += OnLayoutRemoved;

            _layouts        = new Stack <ILayout>();
            _pressedButtons = new LazyDictionary <Location, ITimerToken>();

            device.ButtonEvent += DeviceOnKeyEvent;

            device.Init();
            _drawingEngine = new DrawingEngine(device, _globalContext.Options.Theme, globalContext.Services.ModulesService.GetModules <IVisualTransitionFactory>().First());
            _layoutContext = new LayoutContext(device, globalContext, SetLayout, () => SetPreviousLayout(), () => _drawingEngine.PauseDrawing(), GetAvailableLayouts);
        }
Ejemplo n.º 2
0
 public Token(DrawingEngine drawingEngine)
 {
     _drawingEngine = drawingEngine;
     Interlocked.Increment(ref _drawingEngine._counter);
 }