Attributes for Identifying Service Objects and Assigning Hardware (POS for .NET v1.14 SDK Documentation)
POS for .NET uses .NET reflection and .NET attributes to locate Service Object assemblies, identify Service Objects within those assemblies, and finally to associate a Plug and Play device with that Service Object. By leveraging these .NET features, PosExplorer can identify Service Objects within an assembly and quickly assess their Plug and Play requirements. The expensive process of loading a .NET assembly is delayed until needed by the application.
In order to provide these features, POS for .NET depends on three different .NET attributes:
- PosAssembly This is a global, assembly-level attribute that tells PosExplorer that this is a POS for .NET assembly which contains one or more Service Objects. Generally, it should be set in your AssemblyInfo.cs source file. For an example, see Setting up a Service Object Project.
- ServiceObject This attribute is applied to the Service Object class and specifies the type, name, and version information for the Service Object. See the Creating a Basic Service Object Code Template section for an example.
- HardwareId This attribute is used to specify which hardware IDs will be used by this Service Object. This information is used by PosExplorer to filter out Service Objects that use Plug and Play hardware which is not currently plugged in. The HardwareId attribute allows multiples, so there may be several attached to a Server Object class. See the sample topic Adding Plug and Play Support for an example. For a more lengthy discussion of Plug and Play features, including how the HardwareId attribute is utilized, see the topics Adding Plug and Play Support and POS for .NET POS for .NET Integration with Plug and Play.
See Also
Reference
Concepts
Other Resources
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.