Esempio n. 1
0
        private async void FetchDevicesList()
        {
            var devices = (await CloudClipboardService.GetDevices(accountId))?.OrderBy(x => x.Name ?? "");

            if (devices == null)
            {
                return;
            }

            foreach (var item in devices)
            {
                if ((item.Name ?? "").ToLower() == CurrentDevice.GetDeviceName().ToLower())
                {
                    currentDeviceId = item.DeviceID;

                    //Don't set the property directly, so we don't send a request with the same value.
                    receiveCloudClipboardOnThisDeviceChecked = item.CloudClipboardEnabled;
                    OnPropertyChanged("ReceiveCloudClipboardOnThisDeviceChecked");

                    ReceiveCloudClipboardOnThisDeviceEnabled = true;
                    continue;
                }

                Devices.Add(new DeviceItem(item.CloudClipboardEnabled)
                {
                    AccountID = item.AccountID,
                    DeviceID  = item.DeviceID,
                    Name      = item.Name,
                    Type      = (item.FormFactor == null) ? DeviceType.Unknown :
                                (item.FormFactor.ToLower() == "phone") ? DeviceType.Phone : DeviceType.PC,
                });
            }
        }
        private async void FetchDevicesList()
        {
            var devices = (await CloudClipboardService.GetDevices(accountId))?.OrderBy(x => x.Name ?? "");

            if (devices == null)
            {
                return;
            }

            foreach (var item in devices)
            {
                if ((item.Name ?? "").ToLower() == (new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation()).FriendlyName.ToLower())
                {
                    continue;
                }

                Devices.Add(new DeviceItem(item));
            }
        }