diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Converters/TimeSpanToDaysConverter.cs | 23 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj | 3 |
2 files changed, 25 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/TimeSpanToDaysConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/TimeSpanToDaysConverter.cs new file mode 100644 index 000000000..d9256ac08 --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Converters/TimeSpanToDaysConverter.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.SharedUI.Converters +{ + public class TimeSpanToDaysConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return ((TimeSpan)value).TotalDays; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return TimeSpan.FromDays(double.Parse(value.ToString())); + } + } +} diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index edbb21a77..2b75d0531 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -143,6 +143,7 @@ <Compile Include="Converters\StringToOneLineConverter.cs" /> <Compile Include="Converters\StringToTitleCaseConverter.cs" /> <Compile Include="Converters\StringToWordsConverter.cs" /> + <Compile Include="Converters\TimeSpanToDaysConverter.cs" /> <Compile Include="Converters\TimeSpanToMinutesConverter.cs" /> <Compile Include="Converters\TimeSpanToSecondsConverter.cs" /> <Compile Include="Converters\TimeSpanToTwoDigitsTimeConverter.cs" /> @@ -258,7 +259,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file |
