예제 #1
0
        /// <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);
            }
        }
예제 #2
0
 /// <summary>
 /// インスタンスを初期化します。
 /// </summary>
 public void Initialize()
 {
     this._client = new WpdClient(ResUtility.GetString("Strings.Common.AppName"), 1, 0);
     this.Devices = new ObservableCollection <PortableDeviceViewModel>();
 }