GetDeviceCategoryAsync() public static method

public static GetDeviceCategoryAsync ( ) : Task
return Task
Beispiel #1
0
        public static string GetDeviceType()
        {
            var deviceType = SystemInfoEstimate.GetDeviceCategoryAsync().Result;

            switch (deviceType)
            {
            case "Computer.Lunchbox": return("pc");

            case "Computer.Tablet": return("tablet");

            case "Computer.Portable": return("phone");

            default: return("unknown");
            }
        }
Beispiel #2
0
        public static string GetDeviceType(EasClientDeviceInformation deviceInfo)
        {
            var deviceType = SystemInfoEstimate.GetDeviceCategoryAsync().Result;

            switch (deviceType)
            {
            case "Computer.Lunchbox": return("pc");

            case "Computer.Tablet": return("tablet");

            case "Computer.Portable": return("phone");
            }

            if (deviceInfo.SystemSku == "Microsoft Virtual")
            {
                return("emulator");
            }

            return("unknown");
        }