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






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.

Syntax

Visual Basic (Declaration) 
Public Overloads Function RegisterInstance( _
   ByVal type As Type, _
   ByVal instance As Object _
) As IRegistration
Visual Basic (Usage)Copy Code
Dim instance As IocContainer
Dim type As Type
Dim instance As Object
Dim value As IRegistration
 
value = instance.RegisterInstance(type, instance)
C# 
public IRegistration RegisterInstance( 
   Type type,
   object instance
)
Delphi 
public function RegisterInstance( 
    type: Type;
    instance: TObject
): IRegistration; 
JScript 
public function RegisterInstance( 
   type : Type,
   instance : Object
) : IRegistration;
Managed Extensions for C++ 
public: IRegistration* RegisterInstance( 
   Type* type,
   Object* instance
) 
C++/CLI 
public:
IRegistration^ RegisterInstance( 
   Type^ type,
   Object^ instance
) 

Parameters

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.