private TextRestriction Translate(textRestriction from) { TextRestriction to; switch (from) { case textRestriction.none: { to = TextRestriction.None; break; } case textRestriction.ipv4: { to = TextRestriction.IPv4; break; } case textRestriction.ipv6: { to = TextRestriction.IPv6; break; } case textRestriction.number: { to = TextRestriction.Number; break; } case textRestriction.port: { to = TextRestriction.Port; break; } default: throw new ArgumentOutOfRangeException(nameof(from), from, null); } return(to); }
public text() { this.restrictionField = textRestriction.none; }