本帖最后由 逝去的谎言 于 2012-4-6 12:11 编辑
找不到引用的类库 但是在WMAppManifest.xml文件也有<Capability Name="ID_CAP_SENSORS"/>,这究竟是怎么回事?是设置问题还是缺少引用的代码问题?
网上有着一段,难道是要加上下面的代码??求教
using System;
using System.Security;
namespace Microsoft.Devices.Sensors
{
// Summary:
// Provides Windows?Phone applications access to the device’s accelerometer
// sensor.
public sealed class Accelerometer : IDisposable
{
// Summary:
// Creates a new instance of the Microsoft.Devices.Sensors.Accelerometer object.
[SecuritySafeCritical]
public Accelerometer();
// Summary:
// Gets the current state of the accelerometer. The value is a member of the
// Microsoft.Devices.Sensors.SensorState enumeration.
//
// Returns:
// Type Microsoft.Devices.Sensors.SensorState.
public SensorState State { get; }
// Summary:
// Occurs when new data arrives from the accelerometer.
public event EventHandler<AccelerometerReadingEventArgs> ReadingChanged;
// Summary:
// Releases the managed and unmanaged resources used by the Microsoft.Devices.Sensors.Accelerometer.
[SecuritySafeCritical]
public void Dispose();
//
// Summary:
// Starts data acquisition from the accelerometer.
[SecuritySafeCritical]
public void Start();
//
// Summary:
// Stops data acquisition from the accelerometer.
[SecuritySafeCritical]
public void Stop();
}
}
|