Share via


InstanceDependencyProperty.Register Method (String, Type, Type, Object)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Creates a new instance of an InstanceDependencyProperty field, specifying the name of the property with which the InstanceDependencyProperty field is associated, the type of value stored in the property, the type of owner of the property, and a default value for the property.

Namespace: Microsoft.SpeechServer.Dialog
Assembly: Microsoft.SpeechServer (in microsoft.speechserver.dll)

Syntax

'Declaration
Public Shared Function Register ( _
    name As String, _
    propertyType As Type, _
    ownerType As Type, _
    defaultValue As Object _
) As InstanceDependencyProperty
public static InstanceDependencyProperty Register (
    string name,
    Type propertyType,
    Type ownerType,
    Object defaultValue
)

Parameters

  • name
    The name of the property that is associated with the InstanceDependencyProperty field.
  • propertyType
    The type of values stored in the property.
  • ownerType
    The type of the owner of the property.
  • defaultValue
    The default value of the property.

Return Value

The new InstanceDependencyProperty field, if successful.

Exceptions

Exception type Condition
ArgumentException

name is null.

name is an empty string.

ArgumentNullException

propertyType is null.

ownerType is null.

ownerType is invalid.

Remarks

This method returns an InstanceDependencyProperty field that can be written to.

Example

The following example registers FailedBusyAttemptsProperty as an InstanceDependencyProperty field associated with FailedBusyAttempt, which is a property of the CustomMakeCall class. The fourth argument in the call to Register provides a default value for this property.

private readonly static InstanceDependencyProperty FailedBusyAttemptsProperty =
    InstanceDependencyProperty.Register("FailedBusyAttempts", typeof(ushort), 
    typeof(CustomMakeCall), (ushort)0);

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

Windows Server 2003

See Also

Reference

InstanceDependencyProperty Class
InstanceDependencyProperty Members
Microsoft.SpeechServer.Dialog Namespace