Ejemplo n.º 1
0
        private void InitializeFields()
        {
            IEnumerable <IPhoneDeviceInfo> devicesInfo = PhoneDeviceInfoReader.GetDevicesInfo();

            phoneListBox.AddPhoneOptions(devicesInfo);

            mergeContactsCheckbox.IsChecked           = _DisplayOptions.MergeContacts;
            hideEmptyContactsCheckbox.IsChecked       = _DisplayOptions.HideEmptyConversations;
            loadMmsAttachmentsCheckbox.IsChecked      = _DisplayOptions.LoadMmsAttachments;
            timeFormatComboBox.SelectedValue          = _DisplayOptions.TimeDisplayFormat;
            conversationSortingComboBox.SelectedValue = _DisplayOptions.ConversationSorting;
            phoneListBox.SelectedValue       = SelectedDevice;
            promptForPhoneCheckBox.IsChecked = _PhoneSelectOptions.PromptForPhoneChoice;
        }
Ejemplo n.º 2
0
        private IPhoneDeviceInfo GetSelectedPhoneInfo()
        {
            List <IPhoneDeviceInfo> devicesInfo   = devicesInfo = new List <IPhoneDeviceInfo>(PhoneDeviceInfoReader.GetDevicesInfo());
            PhoneSelector           phoneSelector = new PhoneSelector(devicesInfo, _phoneSelectOptions);

            IPhoneDeviceInfo selectedPhone;

            selectedPhone = phoneSelector.AutoSelectPhoneDevice();

            if (phoneSelector.ShouldWarnAboutLaterSyncedPhone())
            {
                bool letUserChoosePhone;
                bool ignoreNewerSyncs;
                PromptToChooseLaterSync(out letUserChoosePhone, out ignoreNewerSyncs);

                if (letUserChoosePhone)
                {
                    selectedPhone = null;
                }
                else if (ignoreNewerSyncs)
                {
                    _phoneSelectOptions.WarnAboutMoreRecentSync = false;
                    _phoneSelectOptions.Save();
                }
            }

            if (selectedPhone != null)
            {
                _deviceInfo = selectedPhone;
                return(selectedPhone);
            }

            bool alwaysPrompt;

            if (PromptForPhoneSelectionOptions(devicesInfo, out selectedPhone, out alwaysPrompt) == false)
            {
                Environment.Exit(0);
            }

            _deviceInfo = selectedPhone;
            _phoneSelectOptions.PromptForPhoneChoice = alwaysPrompt;
            _phoneSelectOptions.PhoneDataPath        = selectedPhone.BackupPath;
            _phoneSelectOptions.Save();

            return(selectedPhone);
        }