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

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


[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property)] public class GraphMLSerializerAttribute : Attribute
Visual Basic
<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Property)> _ Public Class GraphMLSerializerAttribute _ Inherits Attribute


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


See Also