NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

FormatterServices.GetUninitializedObject

Creates a new instance of the specified object type.

[Visual Basic]
Public Shared Function GetUninitializedObject( _
   ByVal type As Type _
) As Object
[C#]
public static object GetUninitializedObject(
   Type type
);
[C++]
public: static Object* GetUninitializedObject(
   Type* type
);
[JScript]
public static function GetUninitializedObject(
   type : Type
) : Object;

Parameters

type
The type of object to create.

Return Value

A zeroed object of the specified type.

Exceptions

Exception Type Condition
ArgumentNullException the type parameter is a null reference (in Visual Basic Nothing).

Remarks

The new instance of the object is initialized to 0 and no constructors are run. This means that the object may not represent a state that is regarded as valid by that object. This method should only be used for deserialization when the user intends to immediately populate all fields. The method will not create an un-initialized string, since creating an empty instance of an immutable type is pointless.

See Also

FormatterServices Class | FormatterServices Members | System.Runtime.Serialization Namespace