本文整理汇总了C#中DeviceType类的典型用法代码示例。如果您正苦于以下问题:C# DeviceType类的具体用法?C# DeviceType怎么用?C# DeviceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeviceType类属于命名空间,在下文中一共展示了DeviceType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterDevice
public string RegisterDevice(int tenantID, string userID, string token, DeviceType type)
{
if (string.IsNullOrEmpty(token))
throw new FaultException("empty device token");
if (string.IsNullOrEmpty(userID))
throw new FaultException("empty user id");
var device = GetDeviceDao().GetAll(tenantID, userID).FirstOrDefault(x => x.Token == token);
if (device == null)
{
_log.DebugFormat("register device ({0}, {1}, {2}, {3})", tenantID, userID, token, type);
device = new Device
{
TenantID = tenantID,
UserID = userID,
Token = token,
Type = type
};
GetDeviceDao().Save(device);
}
return device.RegistrationID;
}
示例2: addDevice
public void addDevice(int deviceID, DeviceInfo deviceInfo, DeviceType deviceType)
{
Debug.Log("addDevice("+deviceID+", "+deviceInfo+", "+deviceType+")");
bool alreadyEquiped = (!_equipedDevices.Exists(device => device.getID() == deviceID));
bool alreadyInventory = (!_inventoryDevices.Exists(device => device.getID() == deviceID));
if(alreadyEquiped || alreadyInventory) {
Vector3 localPosition;
UnityEngine.Transform parent;
List<DisplayedDevice> devices;
int newDeviceId = deviceID;
if(deviceType == DeviceType.Equiped) {
parent = equipPanel.transform;
devices = _equipedDevices;
if(deviceID == 0) {
newDeviceId = devices.Count;
}
Debug.Log("addDevice("+newDeviceId+") in equipment");
} else {
parent = inventoryPanel.transform;
devices = _inventoryDevices;
Debug.Log("addDevice("+newDeviceId+") in inventory");
}
localPosition = getNewPosition(deviceType);
DisplayedDevice newDevice = DisplayedDevice.Create (parent, localPosition, newDeviceId, deviceType, deviceInfo, this);
devices.Add(newDevice);
//let's add reaction to reaction engine
//for each module of deviceInfo, add to reaction engine
//deviceInfo._modules.ForEach( module => module.addToReactionEngine(celliaMediumID, reactionEngine));
} else {
Debug.Log("addDevice failed: alreadyEquiped="+alreadyEquiped+", alreadyInventory="+alreadyInventory);
}
}
示例3: GetDeviceObject
// Using device type decideds which device object to initilise, this allows for dynamic object creation.
public static DeviceBase GetDeviceObject(DeviceInformation deviceInfo, DeviceType type)
{
DeviceBase device = null;
// Main switch statement to handle the creation of the device objects.
switch (type)
{
case DeviceType.GenericAccess:
device = new GenericAccessDevice();
break;
case DeviceType.HeartRate:
device = new HeartRateMonitorDevice();
break;
}
if (device == null)
{
// Display error if device does not have a value and return null.
MessageHelper.DisplayBasicMessage(StringResources.InitialisationError);
return device;
}
device.Initialise(deviceInfo.Id);
return device;
}
示例4: ControlModuleOrChannelLocateCommand
/// <summary>
/// 定位模块或通道的命令
/// </summary>
/// <param name="deviceType">设备类型</param>
/// <returns></returns>
public Byte[] ControlModuleOrChannelLocateCommand(DeviceType deviceType = DeviceType.Module)
{
return GetDatagram(MessageId.ControlModuleOrChannelLocate,
deviceType == DeviceType.Channel ?
new Parameter(ParameterType.ChannelNo, ChannelNo) :
new Parameter(ParameterType.None, 0X00));
}
示例5: CtlCode
public static int CtlCode(DeviceType type, int function, DeviceControlMethod method, DeviceControlAccess access)
{
return ((int)type << 16) |
((int)access << 14) |
(function << 2) |
(int)method;
}
示例6: clGetDeviceIDs
public extern static int clGetDeviceIDs (
IntPtr platform,
DeviceType device_type,
uint num_entries,
IntPtr[] devices,
out uint num_devices
);
示例7: Trame
/// <summary>
/// Initializes a new instance of the <see cref="Trame"/> class.
/// </summary>
/// <param name="dt">Dt.</param>
public Trame(DeviceType dt)
{
last = Creator.GetNewInvalidSkeleton();
currentType = dt;
resetTimer = new Timer(1000);
resetTimer.AutoReset = true;
lastUpdate = DateTime.Now;
resetTimer.Elapsed += (sender, args) =>
{
if ((dt == DeviceType.KINECT || dt == DeviceType.LEAP_MOTION_AND_KINECT) && !resetInProgress && (DateTime.Now - lastUpdate).TotalMilliseconds > 2000)
{
resetInProgress = true;
// reset trame
UpdatedType();
currentDevice.Start();
resetInProgress = false;
lastUpdate = DateTime.Now;
}
};
UpdatedType();
}
示例8: HDPApp
public HDPApp(DeviceType deviceType, IBlobCache cache)
{
RxApp.DefaultExceptionHandler = Observer.Create ((Exception e) => {
System.Diagnostics.Debug.WriteLine(e.Message);
System.Diagnostics.Debug.WriteLine(e.StackTrace);
});
BlobCache.ApplicationName = "HDP";
_cache = BlobCache.LocalMachine;
JsonConvert.DefaultSettings =
() => new JsonSerializerSettings() {
ContractResolver = new CamelCasePropertyNamesContractResolver(),
Converters = {new MediaTypeConverter(), new StringEnumConverter()}
};
_apiService = new ApiService (deviceType: deviceType);
_newsService = new NewsService (_apiService);
_eventsService = new EventsService (_apiService);
_electionArticlesService = new ElectionArticlesService (_apiService);
Locator.CurrentMutable.RegisterConstant (this, typeof(HDPApp));
State = new AppState ();
UserCity.Subscribe (city => {
System.Diagnostics.Debug.WriteLine("Current city is: {0}", city);
});
_repository = new ContentRepository (_newsService, _electionArticlesService, _eventsService, cache);
ImplementCommands ();
}
示例9: WriteChassisFru
/// <summary>
/// Write to Chassis Fru - (Important) note that this function enables write to any offset
/// Offset checks ensures that we are within permissible limits, but cannot enforce semantics within those limits
/// Length checks validity of packet, however empty fields in packet are responsibility of writing function
/// User level priority since this is not an internal call
/// </summary>
/// <param name="offset"></param>
/// <param name="length"></param>
/// <param name="packet"></param>
/// <returns></returns>
public CompletionCode WriteChassisFru(ushort offset, ushort length,
byte[] packet, DeviceType deviceType)
{
ChassisFruWriteResponse response = new ChassisFruWriteResponse();
response.CompletionCode = (byte)CompletionCode.UnspecifiedError;
try
{
response = (ChassisFruWriteResponse)this.SendReceive(deviceType,
this.DeviceId, new ChassisFruWriteRequest(offset, length, packet),
typeof(ChassisFruWriteResponse), (byte)PriorityLevel.User);
}
catch (Exception ex)
{
Tracer.WriteError(string.Format("ChassisFru.WriteChassisFru() Write had an exception with paramaters: Offset: {0} Length: {1} Packet: {2} DeviceType: {3} Exception: {4}",
offset, length, (packet == null ? "Null packet" : Ipmi.IpmiSharedFunc.ByteArrayToHexString(packet)), deviceType.ToString(), ex));
}
if (response.CompletionCode != (byte)CompletionCode.Success)
{
Tracer.WriteError("ChassisFru.WriteChassisFru() write failed with completion code {0:X}", response.CompletionCode);
}
return (CompletionCode)response.CompletionCode;
}
示例10: OutputRequirements
public OutputRequirements(DeviceType devType, bool hardwareTnL, Version ps, Version vs)
{
this.devType = devType;
this.hardwareTnL = hardwareTnL;
this.ps = ps;
this.vs = vs;
}
示例11: HttpWiflyImpl
public HttpWiflyImpl(HttpImplementationClient.RequestReceivedDelegate requestReceived, int localPort, DeviceType deviceType, SPI.SPI_module spiModule, Cpu.Pin chipSelect)
{
m_requestReceived = requestReceived;
LocalPort = localPort;
this.m_spiModule = spiModule;
this.m_chipSelect = chipSelect;
}
示例12: DeviceView
//-------------------------------------------------------------------------------------
/// <summary>
/// Constructor
/// </summary>
/// <param name="device">ref NodeController</param>
/// <param name="deviceType">type of device</param>
public DeviceView(DeviceController device, DeviceType deviceType)
{
InitializeComponent();
this.deviceController = device;
BitmapImage bi3 = new BitmapImage();
if (deviceType == DeviceType.dPc)
{
bi3.BeginInit();
bi3.UriSource = new Uri("/GEditor;component/Resources/screen_zoom_in_ch.png", UriKind.Relative);
bi3.EndInit();
}
else
{
if (deviceType == DeviceType.dSwitch)
{
bi3.BeginInit();
bi3.UriSource = new Uri("/GEditor;component/Resources/switch_ch.png", UriKind.Relative);
bi3.EndInit();
}
else
{
bi3.BeginInit();
bi3.UriSource = new Uri("/GEditor;component/Resources/password_ch.png", UriKind.Relative);
bi3.EndInit();
}
}
this.point.Source = bi3;
Canvas.SetZIndex(this, 2);
this.point.Width = this.point.Height = radiusView;
}
示例13: GraphicsDeviceInformation
public GraphicsDeviceInformation()
{
deviceType = DeviceType.Hardware;
adapter = GraphicsAdapter.DefaultAdapter;
presentationParameters = new PresentationParameters();
presentationParameters.Clear();
}
示例14: DeviceAnnouncement
internal DeviceAnnouncement(UpnpClient client, DeviceType type, string udn, IEnumerable<string> locations)
{
this.client = client;
this.type = type;
this.udn = udn;
this.locations = locations;
}
示例15: DeviceBase
public DeviceBase(AudioBase audio, VideoBase video)
{
_audio = audio;
_video = video;
_deviceType = DeviceType.NO_DEVICE;
_name = "Plug in your Kinect";
}