Chronos Plugins 5.4.0
This documentation covers the plugin interfaces definitions and an example implementation.
Loading...
Searching...
No Matches
AxelSemrau.Chronos.Plugin.DevicesLimitedAttribute Class Reference

Add this attribute to your ITaskForDevice.SetDevice method or your IDevice property if you are using more than one device to limit the range of autosamplers that is offered in the method editor. More...

+ Inheritance diagram for AxelSemrau.Chronos.Plugin.DevicesLimitedAttribute:
+ Collaboration diagram for AxelSemrau.Chronos.Plugin.DevicesLimitedAttribute:

Public Member Functions

 DevicesLimitedAttribute (params Type[] types)
 Takes a whitelist of sampler types that are OK for your task.
 
virtual bool IsOK (Type someDeviceType)
 Override this if you need a more complex logic than simple type whitelisting.
 

Private Attributes

readonly Type[] mLimitedTo
 For the default implementation.
 

Detailed Description

Add this attribute to your ITaskForDevice.SetDevice method or your IDevice property if you are using more than one device to limit the range of autosamplers that is offered in the method editor.

Definition at line 227 of file TaskInterfaces.cs.

Constructor & Destructor Documentation

◆ DevicesLimitedAttribute()

AxelSemrau.Chronos.Plugin.DevicesLimitedAttribute.DevicesLimitedAttribute ( params Type[]  types)

Takes a whitelist of sampler types that are OK for your task.

Parameters
types

Definition at line 238 of file TaskInterfaces.cs.

239 {
240 mLimitedTo = types;
241 }
readonly Type[] mLimitedTo
For the default implementation.

References AxelSemrau.Chronos.Plugin.DevicesLimitedAttribute.mLimitedTo.

Member Function Documentation

◆ IsOK()

virtual bool AxelSemrau.Chronos.Plugin.DevicesLimitedAttribute.IsOK ( Type  someDeviceType)
virtual

Override this if you need a more complex logic than simple type whitelisting.

Parameters
someDeviceType
Returns

Definition at line 249 of file TaskInterfaces.cs.

250 {
251 return mLimitedTo?.Any(someType => someType.IsAssignableFrom(someDeviceType)) ?? false;
252 }

References AxelSemrau.Chronos.Plugin.DevicesLimitedAttribute.mLimitedTo.

Member Data Documentation

◆ mLimitedTo

readonly Type [] AxelSemrau.Chronos.Plugin.DevicesLimitedAttribute.mLimitedTo
private

The documentation for this class was generated from the following file: