/// <summary> /// デバイスを列挙します。 /// </summary> public void EnumDevice() { this.Devices.Clear(); foreach (var device in PortableDevice.EnumDevice(this._client)) { this.Devices.Add(new PortableDeviceViewModel(device)); } this.RaisePropertyChanged("Devices"); if (this.Devices.Count == 0) { MessageBox.Show(ResUtility.GetString("Strings.Message.DeviceNotFound"), ResUtility.GetString("Strings.Common.Info"), MessageBoxButton.OK, MessageBoxImage.Information); } }
/// <summary> /// インスタンスを初期化します。 /// </summary> public void Initialize() { this._client = new WpdClient(ResUtility.GetString("Strings.Common.AppName"), 1, 0); this.Devices = new ObservableCollection <PortableDeviceViewModel>(); }