/// <summary>
        /// Get the portable device by his id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public PortableDevice GetPortableDeviceById(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                throw new ArgumentNullException("id");
            }

            if (!portableDevices.ContainsKey(id))
            {
                PortableDevice portableDevice = new PortableDevice(id);
                if (AutoConnectToPortableDevice)
                {
                    portableDevice.ConnectToDevice(appName, majorVersion, minorVersion);
                }
                portableDevices.Add(id, portableDevice);
            }

            return(this.portableDevices[id]);
        }
        /// <summary>
        ///     Get the portable device by his id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public PortableDevice GetPortableDeviceById(string id)
        {
            if (string.IsNullOrEmpty(id))
                throw new ArgumentNullException("id");

            if (!portableDevices.ContainsKey(id))
            {
                var portableDevice = new PortableDevice(id);
                if (AutoConnectToPortableDevice)
                    portableDevice.ConnectToDevice(appName, majorVersion, minorVersion);
                portableDevices.Add(id, portableDevice);
            }

            return portableDevices[id];
        }
 private void ConnectToDevice(PortableDevice portableDevice)
 {
     portableDevice.ConnectToDevice(AppName, AppMajorVersionNumber, AppMinorVersionNumber);
     this.SelectedPortableDevice = portableDevice;
 }