📄 device.cs.svn-base
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.IO;
namespace Aspecto
{
public class Device
{
public static bool IsPhone
{
get
{
return File.Exists("\\windows\\phone.dll");
}
}
/// <summary>
/// Returns a string which identifies the device platform.
/// </summary>
/// <remarks>Valid values include:-
/// <list type="bullet">
/// <item><term>PocketPC</term><description>Pocket PC device or Emulator</description></item>
/// <item><term>SmartPhone</term><description>Smartphone 2003 Device or Emulator</description></item>
/// <item><term>CEPC platform</term><description>Windows CE.NET Emulator</description></item></list>
/// Additional platform types will have other names.
/// Useful when writing library code targetted at multiple platforms.</remarks>
public static string PlatformName
{
get
{
StringBuilder builder1 = new StringBuilder(0x80);
Coredll.GetSystemParameterString(0x101, (uint)(builder1.Capacity * 2), builder1, false);
return builder1.ToString().ToLower();
}
}
public static PlatformType PlatformType
{
get
{
PlatformType type = PlatformType.Unknown;
string text1 = PlatformName;
if (text1 == "smartphone")
{
type = PlatformType.Smartphone;
}
else if (text1 == "pocketpc")
{
type = PlatformType.PocketPC;
}
return type;
}
}
}
public enum PlatformType
{
Unknown = -1,
PocketPC = 0,
Smartphone = 1,
WindowsCE = 2
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -