《VibrateController》———振动

要实现手机振动是件很简单事情。

我们只要使用Microsoft.Devices命名空间中的VibrateController就可以轻易的达到目的。

而VibrateController类只有两个方法:

  public void Start(TimeSpan duration); //开始振动(TimeSpan类型参数,是设置振动时长)

  public void Stop();//停止振动

还有一个静态属性:

  public static VibrateController Default { get; }//用于获得VibrateController

 

使用案例:

using Microsoft.Devices;
// Create a TimeSpan of 3 seconds
var duration = new TimeSpan(0, 0, 3);
VibrateController.Default.Start(duration);
VibrateController.Default.Stop();

 

 

posted @ 2013-01-07 11:23  ╰→劉じ尛鶴  阅读(163)  评论(0编辑  收藏  举报