Exemple #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);
        }
 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));
     }
 }