SharedPropertyGroupManager.CreatePropertyGroup Method (String, PropertyLockMode, PropertyReleaseMode, Boolean)

 

Finds or creates a property group with the given information.

Namespace:   System.EnterpriseServices
Assembly:  System.EnterpriseServices (in System.EnterpriseServices.dll)

public SharedPropertyGroup CreatePropertyGroup(
	string name,
	ref PropertyLockMode dwIsoMode,
	ref PropertyReleaseMode dwRelMode,
	out bool fExist
)

Parameters

name
Type: System.String

The name of requested property.

dwIsoMode
Type: System.EnterpriseServices.PropertyLockMode

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

dwRelMode
Type: System.EnterpriseServices.PropertyReleaseMode

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

fExist
Type: System.Boolean

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

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.

System_CAPS_cautionCaution

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.

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",
                           ref lockMode, ref releaseMode, out groupExists);

.NET Framework
Available since 1.1
Return to top
Show: