public static byte[] Marshal(AmsAddress address) { byte[] destinationArray = new byte[8]; Array.Copy(address.NetId.netId, destinationArray, 6); Array.Copy(BitConverter.GetBytes((ushort)address.Port), 0, destinationArray, 6, 2); return(destinationArray); }
public static AmsAddress Parse(string str) { AmsAddress address = null; if (!TryParse(str, out address)) { throw new FormatException(); } return(address); }
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); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (!(obj is AmsAddress)) { return(false); } AmsAddress address = (AmsAddress)obj; return((this.port == address.port) ? !(this.netId != address.netId) : false); }
public static int SizeOf(AmsAddress address) => 8;
public AdsSession(AmsAddress address, SessionSettings settings, object owner) : base(SessionProvider <AdsSession, AmsAddress, SessionSettings> .Self) { this._owner = owner; this._address = address.Clone(); this._settings = settings; }
public AdsSession(AmsAddress address, SessionSettings settings) : this(address, settings, null) { }
public AdsSession(AmsAddress address) : this(address, SessionSettings.Default) { }
public AmsAddress(AmsAddress address) { this.netId = address.netId; this.port = address.port; }