EnterpriseManagementObjectBaseWithProperties.TryGetProperty Method

Definition

Gets a property value if one exists.

Overloads

TryGetProperty(ManagementPackType, String, EnterpriseManagementSimpleObject)

Gets a property value by name and type if one exists.

TryGetProperty(ManagementPackProperty, EnterpriseManagementSimpleObject)

Gets a property value if one exists.

TryGetProperty(Guid, EnterpriseManagementSimpleObject)

Gets a property value by identifier if one exists.

TryGetProperty(ManagementPackType, String, EnterpriseManagementSimpleObject)

Gets a property value by name and type if one exists.

public:
 bool TryGetProperty(Microsoft::EnterpriseManagement::Configuration::ManagementPackType ^ type, System::String ^ name, [Runtime::InteropServices::Out] Microsoft::EnterpriseManagement::Common::EnterpriseManagementSimpleObject ^ % simpleObject);
public bool TryGetProperty (Microsoft.EnterpriseManagement.Configuration.ManagementPackType type, string name, out Microsoft.EnterpriseManagement.Common.EnterpriseManagementSimpleObject simpleObject);
member this.TryGetProperty : Microsoft.EnterpriseManagement.Configuration.ManagementPackType * string * EnterpriseManagementSimpleObject -> bool
Public Function TryGetProperty (type As ManagementPackType, name As String, ByRef simpleObject As EnterpriseManagementSimpleObject) As Boolean

Parameters

type
ManagementPackType

The type to search.

name
String

The name of the property.

simpleObject
EnterpriseManagementSimpleObject

When this method returns, contains the property value. This parameter is passed uninitialized.

Returns

true if the property was found and returned; otherwise, false.

Exceptions

The name parameter is a null reference (Nothing in Visual Basic).

The property does not exist.

More than one property matched the name and type.

Applies to

TryGetProperty(ManagementPackProperty, EnterpriseManagementSimpleObject)

Gets a property value if one exists.

public:
 bool TryGetProperty(Microsoft::EnterpriseManagement::Configuration::ManagementPackProperty ^ property, [Runtime::InteropServices::Out] Microsoft::EnterpriseManagement::Common::EnterpriseManagementSimpleObject ^ % simpleObject);
public bool TryGetProperty (Microsoft.EnterpriseManagement.Configuration.ManagementPackProperty property, out Microsoft.EnterpriseManagement.Common.EnterpriseManagementSimpleObject simpleObject);
member this.TryGetProperty : Microsoft.EnterpriseManagement.Configuration.ManagementPackProperty * EnterpriseManagementSimpleObject -> bool
Public Function TryGetProperty (property As ManagementPackProperty, ByRef simpleObject As EnterpriseManagementSimpleObject) As Boolean

Parameters

property
ManagementPackProperty

The property to search for.

simpleObject
EnterpriseManagementSimpleObject

When this method returns, it contains the property value. This parameter is passed uninitialized.

Returns

true if the property was found and returned; otherwise, false.

Exceptions

The property parameter is a null reference (Nothing in Visual Basic).

Applies to

TryGetProperty(Guid, EnterpriseManagementSimpleObject)

Gets a property value by identifier if one exists.

public:
 bool TryGetProperty(Guid propertyId, [Runtime::InteropServices::Out] Microsoft::EnterpriseManagement::Common::EnterpriseManagementSimpleObject ^ % simpleObject);
public bool TryGetProperty (Guid propertyId, out Microsoft.EnterpriseManagement.Common.EnterpriseManagementSimpleObject simpleObject);
member this.TryGetProperty : Guid * EnterpriseManagementSimpleObject -> bool
Public Function TryGetProperty (propertyId As Guid, ByRef simpleObject As EnterpriseManagementSimpleObject) As Boolean

Parameters

propertyId
Guid

The identifier of the property.

simpleObject
EnterpriseManagementSimpleObject

When this method returns, it contains the property value. This parameter is passed uninitialized.

Returns

true if the property was found and returned; otherwise, false.

Applies to