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






name
The name this registration will be registered under.
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 and name.

Syntax

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

Parameters

name
The name this registration will be registered under.
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.