%PDF- %PDF-
Direktori : C:/Windows/SystemApps/Microsoft.Windows.Cortana_cw5n1h2txyewy/dss_service/node_modules/platform/win/ |
Current File : C:/Windows/SystemApps/Microsoft.Windows.Cortana_cw5n1h2txyewy/dss_service/node_modules/platform/win/platform_impl.js |
var util=require("util"),platUtils=require("platform-utils"),winrt=require("winrt-projections"),tag="platform_impl.js",networkConnectionTypeMap,wwanDataClassMap;module.exports.getDataFolder=function(){return platUtils.isCachedPropertyExists("app","dataFolder")?platUtils.valuesCache.app.dataFolder:(winrt.projectNamespace("Windows.Storage"),Windows.Storage.ApplicationData.current.localFolder.path)};module.exports.getTemporaryFolder=function(){return platUtils.isCachedPropertyExists("app","temporaryFolder")?platUtils.valuesCache.app.temporaryFolder:(winrt.projectNamespace("Windows.Storage"),Windows.Storage.ApplicationData.current.temporaryFolder.path)};module.exports.getAppLanguages=function(){var n,i,t;if(winrt.projectNamespace("Windows.Globalization"),n=Windows.Globalization.ApplicationLanguages.languages,n&&n.length>0){for(i=new Array(n.length),t=0;t<n.length;t++)i[t]=n[t];return i}return[]};module.exports.isTouchCapable=function(){winrt.projectNamespace("Windows.Devices");var n=new Windows.Devices.Input.TouchCapabilities;return n.touchPresent!=0};module.exports.hasInternetConnection=function(){var n,t;winrt.projectNamespace("Windows.Networking");n=Windows.Networking.Connectivity;try{return t=n.NetworkInformation.getInternetConnectionProfile(),t&&t.getNetworkConnectivityLevel()==n.NetworkConnectivityLevel.internetAccess}catch(i){return console.warn("%s: Failed to query for current connection state.",tag,i),!0}return!0};networkConnectionTypeMap={1:"other",6:"ethernet",9:"tokenRing",23:"ppp",24:"softwareLoopback",37:"atm",71:"wifi",131:"tunnelTypeEncapsulation",144:"ieee1394"};wwanDataClassMap={0:"none",1:"gprs",2:"edge",4:"umts",8:"hsdpa",16:"hsupa",32:"lteAdvanced",65536:"cdma1xRtt",131072:"cdma1xEvdo",262144:"cdma1xEvdoRevA",524288:"cdma1xEvdv",1048576:"cdma3xRtt",2097152:"cdma1xEvdoRevB",4194304:"cdmaUmb",2147483648:"custom"};module.exports.getNetworkConnectivity=function(){var u;winrt.projectNamespace("Windows.Networking");var t=Windows.Networking.Connectivity,i=0,r=t.WwanDataClass.none,n=t.NetworkInformation.getInternetConnectionProfile();return n&&(i=n.networkAdapter.ianaInterfaceType,n.isWwanConnectionProfile&&(u=n.wwanConnectionProfileDetails,r=u.getCurrentDataClass())),{ianaTypeName:networkConnectionTypeMap[i]||"unknown",dataClassName:wwanDataClassMap[r]||"unknown"}}