public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType != typeof(string)) { return(base.ConvertTo(context, culture, value, destinationType)); } AmsNetId id = (AmsNetId)value; return(!(id == AmsNetId.Empty) ? (!(id == AmsNetId.Local) ? (!(id == AmsNetId.LocalHost) ? id.ToString() : "LocalHost") : "Local") : "Empty"); }
public static bool TryParse(string str, out AmsAddress address) { AmsNetId netId = null; int port = 0; if (TryParse(str, out netId, out port)) { address = new AmsAddress(netId, port); return(true); } address = null; return(false); }
internal static bool TryParse(string str, out AmsNetId netId, out int port) { Match match = regex.Match(str); if (match.Success) { netId = AmsNetId.GetNetId(match); port = GetPort(match); return(true); } netId = null; port = 0; return(false); }
public AdsSession(AmsNetId netId, int port, SessionSettings settings) : this(new AmsAddress(netId, port), settings, null) { }
public AdsSession(AmsNetId netId, int port) : this(netId, port, SessionSettings.Default) { }
public AmsAddress(byte[] netId, AmsPort port) { this.netId = new AmsNetId(netId); this.port = (int)port; }
public AmsAddress(AmsNetId netId, AmsPort port) { this.netId = netId; this.port = (int)port; }
public AmsAddress(byte[] netId, int port) { this.netId = new AmsNetId(netId); this.port = port; }
public AmsAddress(AmsNetId netId, int port) { this.netId = netId; this.port = port; }
public AmsAddress(string netId, int port) { this.netId = new AmsNetId(netId); this.port = port; }
public AmsAddress(AmsPort port) { this.netId = AmsNetId.Local; this.port = (int)port; }
public AmsAddress(AmsAddress address) { this.netId = address.netId; this.port = address.port; }
public AmsAddress(int port) { this.netId = AmsNetId.Local; this.port = port; }
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) => (!(value is string) ? base.ConvertFrom(context, culture, value) : AmsNetId.Parse((string)value));