Exemplo n.º 1
0
 /// <summary>
 /// 构造
 /// </summary>
 /// <param name="core"></param>
 public AdbClientWrapper(IAdbClient core)
 {
     this.core = core;
     if (!core.IsConnected)
     {
         core.Connect();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Connect to a device via TCP/IP.
        /// </summary>
        /// <param name="client">
        /// An instance of a class that implements the <see cref="IAdbClient"/> interface.
        /// </param>
        /// <param name="host">
        /// The host address of the remote device.
        /// </param>
        public static void Connect(this IAdbClient client, string host)
        {
            if (string.IsNullOrEmpty(host))
            {
                throw new ArgumentNullException(nameof(host));
            }

            client.Connect(new DnsEndPoint(host, AdbClient.DefaultPort));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Connect to a device via TCP/IP.
        /// </summary>
        /// <param name="client">
        /// An instance of a class that implements the <see cref="IAdbClient"/> interface.
        /// </param>
        /// <param name="endpoint">
        /// The IP endpoint at which the <c>adb</c> server on the device is running.
        /// </param>
        public static void Connect(this IAdbClient client, IPEndPoint endpoint)
        {
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }

            client.Connect(new DnsEndPoint(endpoint.Address.ToString(), endpoint.Port));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Connect to a device via TCP/IP.
        /// </summary>
        /// <param name="client">
        /// An instance of a class that implements the <see cref="IAdbClient"/> interface.
        /// </param>
        /// <param name="address">
        /// The IP address of the remote device.
        /// </param>
        public static void Connect(this IAdbClient client, IPAddress address)
        {
            if (address == null)
            {
                throw new ArgumentNullException(nameof(address));
            }

            client.Connect(new IPEndPoint(address, AdbClient.DefaultPort));
        }