-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added server health indicator - Green: Scanned within the last 24 hours - Orange: Scanned between 24-36 hours ago - Red: Last scan was over 36 hours ago - Moved all price overlay settings to Config > Overlay - Fixed exception in storage filter
- Loading branch information
1 parent
290d300
commit 6d54ca9
Showing
18 changed files
with
261 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
using System.Windows.Media; | ||
|
||
namespace NewWorldCompanion.Converters | ||
{ | ||
class DateTimeToHealthConverter : IValueConverter | ||
{ | ||
public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture) | ||
{ | ||
if (targetType == typeof(Brush)) | ||
{ | ||
var updated = System.Convert.ToDateTime(value, culture); | ||
var timeSpan = DateTime.Now - updated; | ||
|
||
if (timeSpan < TimeSpan.FromHours(24)) | ||
return Brushes.Green; | ||
else if (timeSpan < TimeSpan.FromHours(36)) | ||
return Brushes.Orange; | ||
else | ||
return Brushes.Red; | ||
} | ||
|
||
throw new InvalidOperationException("Converter can only convert to value of type Brush."); | ||
} | ||
|
||
public Object ConvertBack(Object aValue, Type aTargetType, Object aParameter, CultureInfo aCulture) | ||
{ | ||
throw new InvalidOperationException("Converter cannot convert back."); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.