Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
CiStringToString.cs
1using System;
6
8{
13 {
17 public Type From => typeof(CaseInsensitiveString);
18
22 public Type To => typeof(string);
23
30 public object Convert(object Value)
31 {
32 if (!(Value is CaseInsensitiveString CiString))
33 throw new ArgumentException("Expected case-insensitive string.", nameof(Value));
34
35 return CiString.Value;
36 }
37
45 public IElement ConvertToElement(object Value)
46 {
47 if (!(Value is CaseInsensitiveString CiString))
48 throw new ArgumentException("Expected case-insensitive string.", nameof(Value));
49
50 return new StringValue(CiString.Value);
51 }
52 }
53}
Represents a case-insensitive string.
Converts case-insensitive strings to normal strings.
IElement ConvertToElement(object Value)
Converts the object in Value to an object of type To, encapsulated in an IElement.
Type From
Converter converts objects of this type.
object Convert(object Value)
Converts the object in Value to an object of type To.
Type To
Converter converts objects to this type.
Basic interface for all types of elements.
Definition: IElement.cs:20
Converts an object of one type to an object of another type.