Intersoft ClientUI Documentation
RegisterRoutedEvent Method
See Also  Send Feedback
Intersoft.Client.Framework Namespace > EventManager Class : RegisterRoutedEvent Method






name
The name of the routed event. The name must be unique within the owner type and cannot be or an empty string.
routingStrategy
The routing strategy of the event as a value of the enumeration.
handlerType
The type of the event handler. This must be a delegate type and cannot be .
ownerType
The identifier for the newly registered routed event. This identifier object can now be stored as a static field in a class and then used as a parameter for methods that attach handlers to the event. The routed event identifier is also used for other event system APIs.

Registers a new routed event with the ClientUI event architecture.

Syntax

Visual Basic (Declaration) 
Public Shared Function RegisterRoutedEvent( _
   ByVal name As String, _
   ByVal routingStrategy As RoutingStrategy, _
   ByVal handlerType As Type, _
   ByVal ownerType As Type _
) As RoutedEvent
Visual Basic (Usage)Copy Code
Dim name As String
Dim routingStrategy As RoutingStrategy
Dim handlerType As Type
Dim ownerType As Type
Dim value As RoutedEvent
 
value = EventManager.RegisterRoutedEvent(name, routingStrategy, handlerType, ownerType)
C# 
public static RoutedEvent RegisterRoutedEvent( 
   string name,
   RoutingStrategy routingStrategy,
   Type handlerType,
   Type ownerType
)
Delphi 
public function RegisterRoutedEvent( 
    name: String;
    routingStrategy: RoutingStrategy;
    handlerType: Type;
    ownerType: Type
): RoutedEvent; static; 
JScript 
public static function RegisterRoutedEvent( 
   name : String,
   routingStrategy : RoutingStrategy,
   handlerType : Type,
   ownerType : Type
) : RoutedEvent;
Managed Extensions for C++ 
public: static RoutedEvent* RegisterRoutedEvent( 
   string* name,
   RoutingStrategy routingStrategy,
   Type* handlerType,
   Type* ownerType
) 
C++/CLI 
public:
static RoutedEvent^ RegisterRoutedEvent( 
   String^ name,
   RoutingStrategy routingStrategy,
   Type^ handlerType,
   Type^ ownerType
) 

Parameters

name
The name of the routed event. The name must be unique within the owner type and cannot be or an empty string.
routingStrategy
The routing strategy of the event as a value of the enumeration.
handlerType
The type of the event handler. This must be a delegate type and cannot be .
ownerType
The identifier for the newly registered routed event. This identifier object can now be stored as a static field in a class and then used as a parameter for methods that attach handlers to the event. The routed event identifier is also used for other event system APIs.

Remarks

Use the return value of this method to create the static declaration for a unique RoutedEvent identifier field. This field should be stored within the owner type.

There are a considerable number of conventions and best practices associated with how routed events should be named, registered, and exposed in a class. For more information, see Routed Events Overview.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.