static void Main(string[] args) { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.SetCapability("deviceName", "QAappsS7"); capabilities.SetCapability("platformName", "Android"); capabilities.SetCapability("platformVersion", "7.0"); capabilities.SetCapability("automationName", "uiautomator2"); capabilities.SetCapability("appPackage", "com.android.settings"); capabilities.SetCapability("appActivity", "com.android.settings.Settings"); driver = new AndroidDriver <AndroidElement>(new Uri("http://localhost:4723/wd/hub"), capabilities); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(15)); // AndroidElement element = driver.FindElementsById("android:id/title").First(iw => iw.Text.Equals("Notifications")); PhoneSettings phoneSettings = new PhoneSettings(driver); phoneSettings.GoToConnectionsSettingsPage(); ConnectionSettingsPage connectionSettingsPage = new ConnectionSettingsPage(driver); connectionSettingsPage.GotoBluetoothSettings(); BluetoothSettingsPage bluetoothSettingsPage = new BluetoothSettingsPage(driver); bluetoothSettingsPage.UnpairAllDevices(); Console.ReadLine(); }
public Item CreateItem(IItemSettings settings) { if (settings == null) { return(phone.Clone()); } PhoneSettings set = settings as PhoneSettings; return(new Phone(set.Name, set.Price, set.Category, set.Type, set.BrandName, set.ReleaseDate, set.DisplaySize, set.OS, set.SimCardQuantity, set.RAM, set.ROM, set.Camera, set.BatteryCapacity, set.Comm)); }
public static void LoadData(AppDBContext dbContext) { Strings.Clear(); foreach (var item in dbContext.AppSettings) { Strings[item.Name] = item.Value; } EmailSettings = LoadSettings <EmailSettings>("EmailSettings"); PhoneSettings = LoadSettings <PhoneSettings>("PhoneSettings"); }
public Profile() { _areaLevelData = new Dictionary<string, AreaDataContainer>(); _settings = new PhoneSettings(); _nextReminderDate = new DateTime(); _hasRated = false; _livesRemaining = 0; _lastLivesUpdateTime = new DateTime(); _goldenTicketCount = 0; _newlyUnlockedItems = new List<XElement>(); _unlockedAvatarComponents = new List<XElement>(); }
public void Deserialize(XElement serializedData) { Serializer serializer = new Serializer(serializedData); _settings = serializer.GetDataItem<PhoneSettings>("config-settings"); _hasRated = serializer.GetDataItem<bool>("has-rated"); if (serializedData.Elements("dataitem").Any(x => x.Attribute("name").Value == "reminder-plays")) { _playsBeforeNextReminder = serializer.GetDataItem<int>("reminder-plays"); } else { _playsBeforeNextReminder = Initial_Plays_Before_Rating_Reminder; } _nextReminderDate = serializer.GetDataItem<DateTime>("next-reminder"); _livesElementAdded = serializer.GetDataItem<bool>("lives-added"); _livesRemaining = serializer.GetDataItem<int>("lives-remaining"); _lastLivesUpdateTime = serializer.GetDataItem<DateTime>("lives-updated"); _goldenTicketCount = serializer.GetDataItem<int>("golden-tickets"); _currentArea = serializer.GetDataItem<string>("last-area"); LoadAreaDataFromXml(serializer.GetDataElement("survival-area-data")); LoadAvatarComponentDataFromXml(serializer.GetDataElement("avatar-component-data")); }
public static string GetPhoneSettings(string phoneMacAddress) { if (string.IsNullOrEmpty(phoneMacAddress)) { return(string.Empty); } using (var store = new DataContextEF()) { //Get a user's phone details var phoneDet = store.PhoneDetails .Include("StaffMember") .Include("StaffMember.StaffContactData") .FirstOrDefault( m => m.RecordStatus.Equals("Active") && m.StaffPhoneMac.Equals(phoneMacAddress)); if (phoneDet == null) { throw new Exception("Staff phone details not found"); } phoneDet.StaffMember.StaffContactData = phoneDet.StaffMember.StaffContactData.Where(x => x.RecordStatus.Equals("Active")).ToList(); var phoneSettings = new PhoneSettings(phoneDet); store.Staff.Where(m => m.StaffId != phoneDet.StaffMember.StaffId && m.RecordStatus.Equals("Active")).OrderBy(x => x.StaffName) .ToList().ForEach((m) => phoneSettings.Directory.PhoneList.Add(new PhoneEntry { ContactId = m.StaffId, UserName = string.Empty, FirstName = m.StaffName, LastName = m.StaffSurname, Number = m.StaffTellExt, NumberType = "sip", })); var count = 1; var sortedData = phoneSettings.Directory.PhoneList.OrderBy(x => x.LastName).ThenBy(x => x.FirstName); foreach (PhoneEntry phoneEntry in sortedData) { phoneEntry.Index = count; count++; } phoneSettings.Directory.PhoneList = new List <PhoneEntry>(phoneSettings.Directory.PhoneList.OrderBy(x => x.LastName).ThenBy(x => x.FirstName)); return(phoneSettings.ToString()); #region /*var workContactsToStaffContactsModel = new List<StaffContactModel>(); * * workContacts.ForEach((m) => workContactsToStaffContactsModel.Add(new StaffContactModel * { * ContactDescription = m.StaffName, * ContactId = m.StaffId, * ContactName = m.StaffName, * ContactNumber = m.StaffTellExt, * ContactSurname = m.StaffSurname, * StaffId = m.StaffId, * StaffMember = m * })); * * * // workContactsToStaffContactsModel.AddRange(personalContacts); * * // var phoneSettings = new PhoneSettings(phoneDet); * * store.Staff.Where(m => m.StaffId != phoneDet.StaffMember.StaffId && m.RecordStatus.Equals("Active")).OrderBy(x => x.StaffName) * .ToList() * .ForEach((m) => phoneSettings.Directory.PhoneList.Add(new PhoneEntry * { * ContactId = m.StaffId, * UserName = string.Empty, * * FirstName = m.StaffName, * LastName = m.StaffSurname, * Number = m.StaffTellExt, * NumberType = "sip", * Index = phoneSettings.Directory.PhoneList.Count + 1 * })); * * return phoneSettings.ToString();*/ #endregion } }
public Settings() { Email = new EmailSettings(); Phone = new PhoneSettings(); }