mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 04:34:56 +00:00
Try catch on some Fusion usage bugs; Fixed press-hold on TriListExtensions
This commit is contained in:
@@ -66,18 +66,6 @@ namespace PepperDash.Essentials
|
||||
DeviceManager.ActivateAll();
|
||||
Debug.Console(0, "Essentials load complete\r" +
|
||||
"-------------------------------------------------------------");
|
||||
|
||||
//********************************************************************
|
||||
#warning Remove these test things:
|
||||
|
||||
var cdt = new SecondsCountdownTimer("timer") { SecondsToCount = 20 };
|
||||
cdt.WasCancelled += (o,a) => Debug.Console(0, "TIMER CANCELLED FOOLS!");
|
||||
cdt.IsRunningFeedback.OutputChange += (o, a) => Debug.Console(0, "TIMER Running={0}", cdt.IsRunningFeedback);
|
||||
cdt.PercentFeedback.OutputChange += (o, a) => Debug.Console(0, "TIMER {0}%", cdt.PercentFeedback);
|
||||
cdt.TimeRemainingFeedback.OutputChange += (o,a) => Debug.Console(0, "TIMER time: {0}", cdt.TimeRemainingFeedback);
|
||||
DeviceManager.AddDevice(cdt);
|
||||
|
||||
//********************************************************************
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -880,7 +880,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void UsageTracker_DeviceUsageEnded(object sender, DeviceUsageEventArgs e)
|
||||
{
|
||||
{
|
||||
var device = sender as Device;
|
||||
|
||||
var configDevice = ConfigReader.ConfigObject.Devices.Where(d => d.Key.Equals(device.Key));
|
||||
|
||||
@@ -246,8 +246,16 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
var lastSource = dict[LastSourceKey].SourceDevice;
|
||||
|
||||
if (lastSource != null && lastSource is IUsageTracking)
|
||||
(lastSource as IUsageTracking).UsageTracker.EndDeviceUsage();
|
||||
try
|
||||
{
|
||||
if (lastSource != null && lastSource is IUsageTracking)
|
||||
(lastSource as IUsageTracking).UsageTracker.EndDeviceUsage();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, this, "EXCEPTION in end usage tracking (257):\r{0}", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Let's run it
|
||||
|
||||
Reference in New Issue
Block a user