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.WriterAssembly: yWorks.yFilesWPF.Viewer (in yWorks.yFilesWPF.Viewer.dll) Version: 2.2.0.2 (2.2.0.2)
Syntax
| C# |
|---|
[AttributeUsageAttribute(AttributeTargets.Class)] [ObfuscationAttribute(StripAfterObfuscation = false, ApplyToMembers = true, Exclude = true)] public class SingletonSerializationAttribute : Attribute |
| Visual Basic |
|---|
<AttributeUsageAttribute(AttributeTargets.Class)> _ <ObfuscationAttribute(StripAfterObfuscation := False, ApplyToMembers := True, _ Exclude := True)> _ 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#
has the effect that all references to field ContainedTypeSingleton will be written
as static extensions, e.g.
CopyC#
[SingletonSerialization(ContainerTypes = new[]{typeof(ContainingType)})] public class ContainedType {} public class ContainingType { public static ContainedType ContainedTypeSingleton = new ContainedType(); }
{x:Static myNSDeclarationPrefix:ContainingType.ContainedTypeSingleton}
Inheritance Hierarchy
System..::..Object
System..::..Attribute
yWorks.yFiles.GraphML.Writer..::..SingletonSerializationAttribute
System..::..Attribute
yWorks.yFiles.GraphML.Writer..::..SingletonSerializationAttribute