TType
The type that is being registered for resolution.
Intersoft ClientUI Documentation
RegisterInstance<TType>(TType) Method
See Also  Send Feedback
Intersoft.Client.Framework.Containers Namespace > IocContainer Class > RegisterInstance Method : RegisterInstance<TType>(TType) Method






instance
The instance that will alway be returned when TType is resolved. The instance must be assignable to a variable of type TType.
Registers an instance that will be returned whenever the IocContainer resolves the specified type.

Syntax

Visual Basic (Declaration) 
Public Overloads Function RegisterInstance(Of TType)( _
   ByVal instance As TType _
) As IRegistration
Visual Basic (Usage)Copy Code
Dim instance As IocContainer
Dim instance As TType
Dim value As IRegistration
 
value = instance.RegisterInstance(Of TType)(instance)
C# 
public IRegistration RegisterInstance<TType>( 
   TType instance
)
Delphi 
public function RegisterInstance( 
    instance: TType
): IRegistration; 
JScript 
public function RegisterInstance( 
   instance : TType
) : IRegistration;
Managed Extensions for C++ 
public: IRegistration* RegisterInstance<TType>( 
   TType* instance
) 
C++/CLI 
public:
IRegistration^ RegisterInstancegeneric<typename TType>
( 
   TType^ instance
) 

Parameters

instance
The instance that will alway be returned when TType is resolved. The instance must be assignable to a variable of type TType.

Type Parameters

TType
The type that is being registered for resolution.

Return Value

An instance of IRegistration that can be used to configure how the get information about the registration, or change the lifetime manager.

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.