-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
349 additions
and
148 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
12 changes: 11 additions & 1 deletion
12
src/Shared/HandyControlDemo_Shared/UserControl/Controls/TimeBarDemoCtl.xaml.cs
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 |
---|---|---|
@@ -1,10 +1,20 @@ | ||
namespace HandyControlDemo.UserControl | ||
using System; | ||
using HandyControl.Data; | ||
|
||
namespace HandyControlDemo.UserControl | ||
{ | ||
public partial class TimeBarDemoCtl | ||
{ | ||
public TimeBarDemoCtl() | ||
{ | ||
InitializeComponent(); | ||
|
||
for (int i = 0; i < 10; i++) | ||
{ | ||
var hour = 6 * i; | ||
TimeBarDemo.Hotspots.Add(new DateTimeRange(DateTime.Today.AddHours(hour), DateTime.Today.AddHours(hour + 1))); | ||
TimeBarDemo.Hotspots.Add(new DateTimeRange(DateTime.Today.AddHours(-hour), DateTime.Today.AddHours(-hour + 1))); | ||
} | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Shared/HandyControl_Shared/Collections/DateTimeRangeComparer.cs
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,15 @@ | ||
using System.Collections.Generic; | ||
using HandyControl.Data; | ||
|
||
namespace HandyControl.Collections | ||
{ | ||
public class DateTimeRangeComparer : IComparer<DateTimeRange> | ||
{ | ||
public int Compare(DateTimeRange x, DateTimeRange y) | ||
{ | ||
if (x.Start > y.Start && x.End > y.End) return 1; | ||
if (x.Start < y.Start && x.End < y.End) return -1; | ||
return 0; | ||
} | ||
} | ||
} |
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.