Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
DurationToXmlString.cs
1
using
System;
2
using
System.Globalization;
3
using
System.Windows.Data;
4
using
System.Windows.Markup;
5
using
Waher.Content
;
6
7
namespace
LegalLab.Converters
8
{
12
public
class
DurationToXmlString
: MarkupExtension, IValueConverter
13
{
15
public
object
Convert
(
object
value, Type targetType,
object
parameter, CultureInfo culture)
16
{
17
return
value?.ToString();
18
}
19
21
public
object
ConvertBack
(
object
value, Type targetType,
object
parameter, CultureInfo culture)
22
{
23
if
(value is
string
s &&
Duration
.
TryParse
(s, out
Duration
TS))
24
return
TS;
25
else
26
return
value;
27
}
28
30
public
override
object
ProvideValue
(IServiceProvider serviceProvider)
31
{
32
return
this
;
33
}
34
}
35
}
LegalLab.Converters.DurationToXmlString
Converts Duration values to XML strings.
Definition:
DurationToXmlString.cs:13
LegalLab.Converters.DurationToXmlString.Convert
object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Definition:
DurationToXmlString.cs:15
LegalLab.Converters.DurationToXmlString.ProvideValue
override object ProvideValue(IServiceProvider serviceProvider)
Definition:
DurationToXmlString.cs:30
LegalLab.Converters.DurationToXmlString.ConvertBack
object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Definition:
DurationToXmlString.cs:21
LegalLab.Converters
Definition:
BooleanToVisibility.cs:8
Waher.Content
Definition:
Array.cs:6
Waher.Content.Duration
Represents a duration value, as defined by the xsd:duration data type: http://www....
Definition:
Duration.cs:13
Waher.Content.Duration.TryParse
static bool TryParse(string s, out Duration Result)
Tries to parse a duration value.
Definition:
Duration.cs:85
LegalLab
LegalLab
Converters
DurationToXmlString.cs
Generated by
1.9.5