[This is preliminary documentation and is subject to change.]

Called by Value for steps which context object is of type for which IsSupportedType(Type) returns true

Namespace: Tools.XmlT.XPathT
Assembly: Tools (in Tools.dll) Version: 1.5.3.38916 (1.5.3.38916)

Syntax

C#
protected virtual string SupportedTypeValue(
	Object obj
)
Visual Basic
Protected Overridable Function SupportedTypeValue ( _
	obj As Object _
) As String
Visual C++
protected:
virtual String^ SupportedTypeValue(
	Object^ obj
)
F#
abstract SupportedTypeValue : 
        obj:Object -> string 
override SupportedTypeValue : 
        obj:Object -> string 
JScript
protected function SupportedTypeValue(
	obj : Object
) : String

Parameters

obj
Type: System..::..Object
Object to get String value for

Return Value

[Missing <returns> documentation for "M:Tools.XmlT.XPathT.XPathObjectNavigator.SupportedTypeValue(System.Object)"]

Remarks

This implementation treats supported types in same way as Value with exception for following types:
TypeTreatement
DateTimeReturned in format YYY-MMddHH:mm:ss.fffzzz (fff part is ommited when Millisecond is zero; zzz part is ommited when Kind is neither Local nor Utc and replaced wizh 'Z' when it is Utc)
TimeSpanConverted to TimeSpanFormattable and SupportedTypeValue(Object) is called again
TimeSpanFormattableReturned ifn format h(0):mm:ss.lll (lll part is ommited when Milliseconds is zero).
Boolean"true" or "false" depending on value
Derived from EnumReturned result of ToString()()()()

Note for inheritors: You should consider implementing this method for any type added to IsSupportedType(Type) if you don't want default behavior for such type.

Examples

Following example shows preffered way of adding own supported type. Of course you can use any other way - change SupportedTypeValue(Object)'s behavior for in-this-implementation supported types or make supported type unsuported by returnnig false for it from IsSupportedType(Type)

CopyVB.NET
Protected Overrides Function IsSupportedType(ByVal T As Type) As Boolean
    Return T.Equals(GetType(MySupportedType)) OrElse T.IsSubclassOf(GetType(MySupportedType)) OrElse MyBase.IsSupportedType(T)
End Function
Protected Overrides Function SupportedTypeValue(ByVal obj As Object) As String
    If TypeOf obj Is MySupportedType Then
         Return DirectCast(obj, MySupportedType).GetValueThatIWantToBeGot()
    Else
        Return MyBase.SupportedTypeValue(obj)
    End If
End Function
Note: This function is also called for steps of XPathObjectNavigator..::..SpecialStep type not depending on if type of pseudo-attribute has IsSupportedType(Type) true for itself. So, this function must behave correctly for all types of pseudo-attributes (in this implementation it is only String and Boolean).

See Also