Custom attributes that allows to specify ISerializer implementations for own data types.

Namespace: yWorks.yFiles.GraphML.Writer
Assembly: yWorks.yFilesNET.Viewer (in yWorks.yFilesNET.Viewer.dll) Version: 4.1.0.1 (4.1.0.1)

Syntax

C#
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property)]
[ObfuscationAttribute(StripAfterObfuscation = false, Exclude = true)]
public class GraphMLSerializerAttribute : Attribute
Visual Basic
<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Property)> _
<ObfuscationAttribute(StripAfterObfuscation := False, Exclude := True)> _
Public Class GraphMLSerializerAttribute _
	Inherits Attribute

Remarks

The GraphML framework evaluates this attribute when searching for an ISerializer implementation for a custom data type. When this attribute is specified and no overriding implementation is provided via Lookup(Type) for a concrete instance, the framework tries to:
  1. Retrieve a shared serializer instance via a static property with name Instance
  2. If not successful, create a new instance of the type specified in the constructor of the attribute. In this case, the serializer class needs to provide a parameterless (default) constructor.
It is advised that all ISerializer implementations implement the singleton pattern, thus allowing to share instances.

Inheritance Hierarchy

System..::..Object
  System..::..Attribute
    yWorks.yFiles.GraphML.Writer..::..GraphMLSerializerAttribute

See Also