DevicePropertyFactory.CreateStringProperty Method (DevicePropertyName, String)
Create an StringProperty object that provides property information in a string format.
Namespace: Microsoft.WindowsServerSolutions.Common.Devices
Assembly: DevicesOM (in DevicesOM.dll)
Syntax
public static StringProperty CreateStringProperty(
DevicePropertyName propertyName,
string value
)
public:
static StringProperty^ CreateStringProperty(
DevicePropertyName propertyName,
String^ value
)
Public Shared Function CreateStringProperty (
propertyName As DevicePropertyName,
value As String
) As StringProperty
Parameters
propertyName
Type: Microsoft.WindowsServerSolutions.Common.Devices.DevicePropertyNameThe name of the property for which information will be provided.
value
Type: System.StringThe string value.
Return Value
Type: Microsoft.WindowsServerSolutions.Common.Devices.StringProperty
An instance of StringProperty.
Remarks
Valid values for propertyName are DevicePropertyName.Description and DevicePropertyName.Name.
Examples
The following code example shows how to create an StringProperty object:
DevicePropertyName propertyName = DevicePropertyName.Description;
string value = "My SDK Device";
// create the string property
StringProperty stringProperty =
DevicePropertyFactory.CreateStringProperty(propertyName, value);
Console.WriteLine("Property Name = {0}", stringProperty.PropertyName);
Console.WriteLine("Property Value = {0}", stringProperty.PropertyValue);
// expected output:
// Property Name = Description
// Property Value = My SDK Device
See Also
DevicePropertyFactory Class
Microsoft.WindowsServerSolutions.Common.Devices Namespace
Return to top