Rfid Metadata: Creating of the list of entries

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

While creating the metadata in DSPI provider sometimes it will be required to provide the list of values, which administrator can choose during installing of the provider.
Following example shows the method which creates two properties. First one is "Copyright" of type "string" in the group "General". The second one is the list of string values
in the group "DAENET FileWatcher". That means the administrator can select one of values in the collection, which will appear in the list-box as shown on the picture bellow.
Another interesting example related to properties can be found here.

private static
Dictionary<PropertyKey, RfidProviderPropertyMetadata>
getDefaultProviderMetadata(){

Dictionary
<PropertyKey, RfidProviderPropertyMetadata> providerMetaData =
new Dictionary<PropertyKey, RfidProviderPropertyMetadata>();


PropertyKey key1 = new PropertyKey("General", "Copyright");
RfidProviderPropertyMetadata metadata1 = new RfidProviderPropertyMetadata(typeof(string),
"Copyright", "DAENET 2005-2007", true, false, false);
providerMetaData.Add(key1, metadata1);

PropertyKey sensorTypeKey = new PropertyKey("DAENET FileWatcher", "SensorType");
Collection<object> collection = new Collection<object>();
collection.Add(SensorType.RfidTag.ToString());
collection.Add(SensorType.PressureSensor.ToString());
collection.Add(SensorType.TemperatureSensor.ToString());


RfidProviderPropertyMetadata sensorTypeMetaData =
new RfidProviderPropertyMetadata(typeof(string),
"Sensor Type to be simulated", SensorType.RfidTag.ToString(),
false, false, false, collection);


providerMetaData.Add(sensorTypeKey, sensorTypeMetaData);

return providerMetaData;

}


Posted May 03 2007, 12:52 AM by Damir Dobric
Filed under:
developers.de is a .Net Community Blog powered by daenet GmbH.