Visual Basic (Declaration) | |
---|---|
Public Overloads Shared Function SerializeObject( _ ByVal o As Object, _ ByVal saveInterface As Type, _ ByVal elementName As String, _ ByVal w As XmlTextWriter _ ) As Boolean |
Visual Basic (Usage) | Copy Code |
---|---|
Dim o As Object Dim saveInterface As Type Dim elementName As String Dim w As XmlTextWriter Dim value As Boolean value = Serializer.SerializeObject(o, saveInterface, elementName, w) |
C# | |
---|---|
public static bool SerializeObject( object o, Type saveInterface, string elementName, XmlTextWriter w ) |
Parameters
- o
- Object to serialize
- saveInterface
- Serialization interface to use
- elementName
- Name of XML element
- w
- XmlTextWriter object to which to save
Return Value
true if successful; false otherwiseIf the object is defined in a different assembly, you should use one of the other overloads that passes the callingAssembly argument so that assembly attributes are saved appropriately.
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