Click or drag to resize

imbTypeExtensionsimbToInstance Method

imbSCI | imbACE | imbNLP | imbWEM | imbWBI
Konvertuje u potrebni tip. Ukoliko postoji konstruktor sa parametrom koji je IsInstanceOfType(input) onda ce koristit njega

Namespace:  imbSCI.Core.extensions.typeworks
Assembly:  imbSCI.Core (in imbSCI.Core.dll) Version: 0.3.58.
Syntax
C#
public static Object imbToInstance(
	this Object input,
	Type targetType
)
Request Example View Source

Parameters

input
Type: SystemObject
targetType
Type: SystemType

Return Value

Type: Object
Instancu objekta

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
Vraca Null: Ako je targetType == null, input == null Vraca Input (nepromenjen): Ako je targetType.IsInstanceOfType(input) Ako postoji konstruktor> new targetType(input) (isti ili kompatibilan tip parametra, onda ce pozvati taj konstruktor). isti tip parametra ima prednost nad kompatibilnim Ako nema kompatibilnog konstruktora, pravi novu instancu i kopira istoimene propertije iz inputa
See Also