Ejemplo n.º 1
0
        public Task SetTabletDebug(bool enabled)
        {
            void onDeviceReport(object _, IDeviceReport report)
            {
                if (report is ITabletReport tabletReport)
                {
                    TabletReport?.Invoke(this, new DebugTabletReport(tabletReport));
                }
                if (report is IAuxReport auxReport)
                {
                    AuxReport?.Invoke(this, new DebugAuxReport(auxReport));
                }
            }

            if (enabled)
            {
                Driver.TabletReader.Report += onDeviceReport;
                Driver.AuxReader.Report    += onDeviceReport;
            }
            else
            {
                Driver.TabletReader.Report -= onDeviceReport;
                Driver.AuxReader.Report    -= onDeviceReport;
            }
            return(Task.CompletedTask);
        }
Ejemplo n.º 2
0
 private void DebugReportHandler(object _, IDeviceReport report)
 {
     if (report is ITabletReport tabletReport)
     {
         TabletReport?.Invoke(this, new DebugTabletReport(tabletReport));
     }
     if (report is IAuxReport auxReport)
     {
         AuxReport?.Invoke(this, new DebugAuxReport(auxReport));
     }
 }