/// <summary> /// Set a <see cref="NetworkEndpoint"/> value for the specified key in the properties table. /// </summary> /// <param name="key">The byte key</param> /// <param name="value">The <see cref="NetworkEndpoint"/> value</param> public void Set(byte key, NetworkEndpoint value) { var buffer = new NetBuffer(); buffer.Write(value); this.InternalSetBuffer(key, buffer); }
/// <summary> /// Gets a <see cref="NetworkEndpoint"/> value from the specified key from the properties table. /// </summary> /// <param name="key">The byte key</param> /// <param name="value"> /// The value associated with the specified key, if the key exists; otherwise, the predefined value for the /// parameter type /// </param> /// <returns> /// <c>true</c> if the table contains a property for the specified key; otherwise, <c>false</c> /// </returns> public bool TryGetNetworkEndpoint(byte key, out NetworkEndpoint value) { NetBuffer buffer; bool exists = this.InternalTryGetBuffer(key, out buffer); value = default(NetworkEndpoint); if (exists) { value = buffer.ReadNetworkEndpoint(); } return(exists); }