New() private method

private New ( byte publicKey ) : ToxDnsHandle
publicKey byte
return ToxDnsHandle
Example #1
0
        /// <summary>
        /// Initializes a new instance of tox dns3.
        /// </summary>
        /// <param name="publicKey"></param>
        public ToxDns(string publicKey)
        {
            _toxDns3 = ToxDnsFunctions.New(ToxTools.StringToHexBin(publicKey));

            if (_toxDns3 == null || _toxDns3.IsInvalid)
            {
                throw new Exception("Could not create a new tox_dns3 instance with the provided public_key");
            }
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of tox dns3.
        /// </summary>
        /// <param name="publicKey">The public key that this instance of toxdns should be initialized with.</param>
        public ToxDns(ToxKey publicKey)
        {
            _toxDns3 = ToxDnsFunctions.New(publicKey.GetBytes());

            if (_toxDns3 == null || _toxDns3.IsInvalid)
            {
                throw new Exception("Could not create a new tox_dns3 instance with the provided publicKey");
            }
        }