Bewerken

Delen via


SharedPropertyGroupManager.CreatePropertyGroup Method

Definition

Finds or creates a property group with the given information.

public:
 System::EnterpriseServices::SharedPropertyGroup ^ CreatePropertyGroup(System::String ^ name, System::EnterpriseServices::PropertyLockMode % dwIsoMode, System::EnterpriseServices::PropertyReleaseMode % dwRelMode, [Runtime::InteropServices::Out] bool % fExist);
public System.EnterpriseServices.SharedPropertyGroup CreatePropertyGroup (string name, ref System.EnterpriseServices.PropertyLockMode dwIsoMode, ref System.EnterpriseServices.PropertyReleaseMode dwRelMode, out bool fExist);
member this.CreatePropertyGroup : string * PropertyLockMode * PropertyReleaseMode * bool -> System.EnterpriseServices.SharedPropertyGroup
Public Function CreatePropertyGroup (name As String, ByRef dwIsoMode As PropertyLockMode, ByRef dwRelMode As PropertyReleaseMode, ByRef fExist As Boolean) As SharedPropertyGroup

Parameters

name
String

The name of requested property.

dwIsoMode
PropertyLockMode

One of the PropertyLockMode values. See the Remarks section for more information.

dwRelMode
PropertyReleaseMode

One of the PropertyReleaseMode values. See the Remarks section for more information.

fExist
Boolean

When this method returns, contains true if the property already existed; false if the call created the property.

Returns

The requested SharedPropertyGroup.

Examples

The following code example shows how to use the CreatePropertyGroup method to create a shared property group manager.

// Create a shared property group.
SharedPropertyGroup^ group =
   groupManager->CreatePropertyGroup( "Receipts",  lockMode,  releaseMode,  groupExists );
// Create a shared property group.
SharedPropertyGroup group = groupManager.CreatePropertyGroup("Receipts",
                           ref lockMode, ref releaseMode, out groupExists);
' Create a shared property group.
Dim group As SharedPropertyGroup = groupManager.CreatePropertyGroup("Receipts", lockMode, releaseMode, groupExists)

Remarks

Using dwIsoMode, during get and set operations, you can either choose to make locking properties atomic by specifying SetGet, or to lock properties over the duration of the method call by specifying Method.

Caution

Do not use Method when creating a property group in a constructor, doing so can result in a deadlock.

If the release mode specified for dwRelMode is Process, the property specified by name is held alive for the lifetime of the process.

Applies to