如何向目标类型添加/修改功能 [英] how to add/modify features to a target type
问题描述
我正在尝试使用API执行一些测试。请参阅下面的代码。
am trying to execute few tests using APIs. see the code below.
ReadOnlyCollection < TargetData > data = pi.FindTargetFromId(@"HID_DEVICE_SYSTEM_KEYBOARD");
// the findTargetXXX methods return a list of potential targets
// for now, just use the first one that's found
pi.CreateTarget(data.First());
现在我想为现有目标添加更多功能。 (手动我们使用 HCK studio,例如音频驱动程序,右键单击和" ;添加/修改功能并添加相应的功能)
now i want to add some more features to the existing target. (manually we do using HCK studio, for example an audio driver,right click and "Add/Modify Features and add corresponding feature)
有什么可用的吗?
推荐答案
HCK Studio不执行HCK OM未提供的任何操作。 HCK OM提供了ProjectManager :: GetFeatures(),它提供了所有目标类型(系统,设备等)和Target :: GetFeatures()的可能功能的完整列表,其中列出了
找到的功能对于特定目标。
HCK Studio doesn't do anything that the HCK OM does not provide. The HCK OM provides ProjectManager::GetFeatures() which gives the entire list of possible features for all target types (system, device, etc.) and Target::GetFeatures() which gives a list of features found for the specific target.
要添加功能,请使用Target :: AddFeature(功能)。
To add a feature use Target::AddFeature(Feature).
添加功能时需要注意的一些事项 -
Some things to note when adding a feature -
1。要素必须与目标的类型相同(Target.TargetType == featureToAdd.TargetType)
1. Feature must be the same type as the target (Target.TargetType == featureToAdd.TargetType)
2。必须尚未将功能添加到目标(Target.GetFeatures()。包含(featureToAdd)== false)
2. Feature must not already be added to the target (Target.GetFeatures().Contains(featureToAdd) == false)
这篇关于如何向目标类型添加/修改功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!