Exemplo n.º 1
0
 static DeviceInfo()
 {
     deviceInfo   = new EasClientDeviceInformation();
     currentIdiom = DeviceIdiom.Unknown;
     try
     {
         systemProductName = deviceInfo.SystemProductName;
     }
     catch (Exception ex)
     {
         Debug.WriteLine($"Unable to get system product name. {ex.Message}");
     }
 }
Exemplo n.º 2
0
        static DeviceIdiom GetIdiom()
        {
            switch (AnalyticsInfo.VersionInfo.DeviceFamily)
            {
            case "Windows.Mobile":
                currentIdiom = DeviceIdiom.Phone;
                break;

            case "Windows.Universal":
            case "Windows.Desktop":
            {
                try
                {
                    var uiMode = UIViewSettings.GetForCurrentView().UserInteractionMode;
                    currentIdiom = uiMode == UserInteractionMode.Mouse ? DeviceIdiom.Desktop : DeviceIdiom.Tablet;
                }
                catch (Exception ex)
                {
                    Debug.WriteLine($"Unable to get device . {ex.Message}");
                }
            }
            break;

            case "Windows.Xbox":
            case "Windows.Team":
                currentIdiom = DeviceIdiom.TV;
                break;

            case "Windows.IoT":
            default:
                currentIdiom = DeviceIdiom.Unknown;
                break;
            }

            return(currentIdiom);
        }
Exemplo n.º 3
0
 static DeviceInfo()
 {
     deviceInfo   = new EasClientDeviceInformation();
     currentIdiom = DeviceIdiom.Unknown;
 }