Intersoft ClientUI Documentation
RegisterInstance(String,Type,Object) Method
See Also  Send Feedback
Intersoft.Client.Framework.Containers Namespace > IDependencyRegistrar Interface > RegisterInstance Method : RegisterInstance(String,Type,Object) Method






name
The name this registration will be registered under.
type
The type that is being registered for resolution.
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) 
Overloads Function RegisterInstance( _
   ByVal name As String, _
   ByVal type As Type, _
   ByVal instance As Object _
) As IRegistration
Visual Basic (Usage)Copy Code
Dim instance As IDependencyRegistrar
Dim name As String
Dim type As Type
Dim instance As Object
Dim value As IRegistration
 
value = instance.RegisterInstance(name, type, instance)
C# 
IRegistration RegisterInstance( 
   string name,
   Type type,
   object instance
)
Delphi 
function RegisterInstance( 
    name: String;
    type: Type;
    instance: TObject
): IRegistration; 
JScript 
function RegisterInstance( 
   name : String,
   type : Type,
   instance : Object
) : IRegistration;
Managed Extensions for C++ 
IRegistration* RegisterInstance( 
   string* name,
   Type* type,
   Object* instance
) 
C++/CLI 
IRegistration^ RegisterInstance( 
   String^ name,
   Type^ type,
   Object^ instance
) 

Parameters

name
The name this registration will be registered under.
type
The type that is being registered for resolution.
instance
The instance that will alway be returned when TType is resolved. The instance must be assignable to a variable of type TType.

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.