本文整理汇总了C#中Device.Connect方法的典型用法代码示例。如果您正苦于以下问题:C# Device.Connect方法的具体用法?C# Device.Connect怎么用?C# Device.Connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Device
的用法示例。
在下文中一共展示了Device.Connect方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public void Start()
{
var platform = manager.GetPlatform(new ObjectId(deviceInfo.PlatformId));
currentDevice = platform.GetDevice(new ObjectId(deviceInfo.DeviceId));
currentDevice.Connect();
}
示例2: EnableSpaceNavigator
public static void EnableSpaceNavigator(this SceneView sceneView, Speed move = Speed.Normal, Speed zoom = Speed.Normal, Speed rotation = Speed.Normal, Speed tilt = Speed.Normal)
{
if (_device == null)
{
_device = new Device();
_device.Connect();
}
var sensor = _device.Sensor;
sensor.SensorInput += () => sceneView.Update(sensor, move.Translate(4000000), zoom.Translate(4000000), rotation.Translate(50000), tilt.Translate(40));
}
示例3: ConnectionDeviceInstallApp
/// <summary>
/// Connection Emulator Device
/// </summary>
/// <param name="deviceObj">Device Object</param>
/// <param name="applicationGuid">Application Guid</param>
/// <param name="iconFilePath">IconFile Path</param>
/// <param name="xapFileName">XapFile Name</param>
/// <returns>return is Connection Device</returns>
public static void ConnectionDeviceInstallApp(Device deviceObj,Guid applicationGuid,string iconFilePath,string xapFileName)
{
if (!string.IsNullOrEmpty(applicationGuid.ToString()))
{
try
{
deviceObj.Connect();
ApplicationManager.InstallApplicationAndLaunch(deviceObj, applicationGuid, iconFilePath, xapFileName);
}
finally
{
deviceObj.Disconnect();
}
}
}
示例4: SpaceNavigator
public SpaceNavigator()
{
try
{
_device = new Device();
_sensor = _device.Sensor;
_sensor.SensorInput += OnSensorInput;
// keyboard.KeyDown += keyboard_KeyDown;
// keyboard.KeyUp += keyboard_KeyUp;
// Associate a configuration with this _device'
_device.LoadPreferences("csMonitor");
_device.Connect();
}
catch (COMException e)
{
Console.WriteLine("{0} Caught exception #1.", e);
throw e;
}
}
示例5: Connect
private void Connect()
{
try
{
_input = new Device();
_sensor = _input.Sensor;
_input.DeviceChange += input_DeviceChange;
_sensor.SensorInput += Sensor_SensorInput;
_input.Connect();
}
catch (COMException e)
{
Trace.WriteLine(e.Message);
}
}