/// <summary> /// Convert to a string. /// </summary> public override string ToString() { var list = new List <string>(); if (MobileCountryCode.HasValue) { list.Add(string.Format("mcc{0}", MobileCountryCode.Value)); } if (MobileNetworkCarrier.HasValue) { list.Add(string.Format("mnc{0}", MobileNetworkCarrier.Value)); } if (!string.IsNullOrEmpty(Language)) { list.Add(Language.ToLower()); } if (!string.IsNullOrEmpty(Region)) { list.Add("r" + Region.ToUpper()); } if (SmallestWidth.HasValue) { list.Add(string.Format("sw{0}dp", SmallestWidth.Value)); } if (AvailableWidth.HasValue) { list.Add(string.Format("w{0}dp", AvailableWidth.Value)); } if (AvailableHeight.HasValue) { list.Add(string.Format("h{0}dp", AvailableHeight.Value)); } if (ScreenSize != ScreenSizes.Any) { list.Add(ScreenSizeOptions.GetOption(ScreenSize)); } if (ScreenAspect != ScreenAspects.Any) { list.Add(ScreenAspectOptions.GetOption(ScreenAspect)); } if (ScreenOrientation != ScreenOrientations.Any) { list.Add(ScreenOrientationOptions.GetOption(ScreenOrientation)); } if (UIMode != UIModes.Any) { list.Add(UIModeOptions.GetOption(UIMode)); } if (NightMode != NightModes.Any) { list.Add(NightModeOptions.GetOption(NightMode)); } if (ScreenPixelDensity != ScreenPixelDensities.Any) { list.Add(ScreenPixelDensityOptions.GetOption(ScreenPixelDensity)); } if (TouchScreenType != TouchScreenTypes.Any) { list.Add(TouchScreenTypeOptions.GetOption(TouchScreenType)); } if (KeyboardAvailability != KeyboardAvailabilities.Any) { list.Add(KeyboardAvailabilityOptions.GetOption(KeyboardAvailability)); } if (PrimaryTextInputMethod != PrimaryTextInputMethods.Any) { list.Add(PrimaryTextInputMethodOptions.GetOption(PrimaryTextInputMethod)); } if (NavigationKeyAvailability != NavigationKeyAvailabilities.Any) { list.Add(NavigationKeyAvailabilityOptions.GetOption(NavigationKeyAvailability)); } if (PrimaryNonTouchNavigationMethod != PrimaryNonTouchNavigationMethods.Any) { list.Add(PrimaryNonTouchNavigationMethodOptions.GetOption(PrimaryNonTouchNavigationMethod)); } if (PlatformVersion.HasValue) { list.Add(string.Format("v{0}", PlatformVersion.Value)); } if (list.Count == 0) { return(string.Empty); } return("-" + string.Join("-", list.ToArray())); }