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: 2.4.0.0

Syntax

C#
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property)] public class GraphMLSerializerAttribute : Attribute
Visual Basic
<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Property)> _ 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