GraphML support attribute that can be used to make it possible to identify instances of the attributed types as static fields or properties.

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

Syntax

C#
[AttributeUsageAttribute(AttributeTargets.Class)] public class SingletonSerializationAttribute : Attribute
Visual Basic
<AttributeUsageAttribute(AttributeTargets.Class)> _ Public Class SingletonSerializationAttribute _ Inherits Attribute

Remarks

When a type is annotated with this attribute, all types in the ContainerTypes array are searched for public static fields or properties that have the annotated type. The GraphML writer will write these members as StaticExtensions instead of the usual serialization.

Examples

Using the following annotation
CopyC#
[SingletonSerialization(ContainerTypes = new[]{typeof(ContainingType)})]
public class ContainedType
{} 

public class ContainingType
{
  public static ContainedType ContainedTypeSingleton = new ContainedType();
}
has the effect that all references to field ContainedTypeSingleton will be written as static extensions, e.g.
CopyC#
{x:Static myNSDeclarationPrefix:ContainingType.ContainedTypeSingleton}

Inheritance Hierarchy

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

See Also