SimpleTypeResolver Class

 

Provides a type resolver for managed types.

Namespace:   System.Web.Script.Serialization
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

System::Object
  System.Web.Script.Serialization::JavaScriptTypeResolver
    System.Web.Script.Serialization::SimpleTypeResolver

public ref class SimpleTypeResolver : JavaScriptTypeResolver

NameDescription
System_CAPS_pubmethodSimpleTypeResolver()

Initializes a new instance of the SimpleTypeResolver class.

NameDescription
System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodResolveType(String^)

Returns the Type of the specified name.(Overrides JavaScriptTypeResolver::ResolveType(String^).)

System_CAPS_pubmethodResolveTypeId(Type^)

Returns the assembly-qualified name of the specified Type.(Overrides JavaScriptTypeResolver::ResolveTypeId(Type^).)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

This type resolver can be used with the JavaScriptSerializer class to include in the serialized JavaScript Object Notation (JSON) string the assembly-qualified name of any managed type that requires custom type metadata.

The SimpleTypeResolver class enables you to serialize managed types as JSON while retaining the managed type definition for custom types.

To create an instance of the JavaScriptSerializer class that uses a type resolver, you must use the JavaScriptSerializer(JavaScriptTypeResolver^) constructor.

The following example demonstrates how to use the SimpleTypeResolver class and shows the resulting serialized strings by using different type resolvers.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.5

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: