OnAppliedDecorationAttribute Class

System.Runtime.Serialization

Summary

Specifies that a custom attribute can be applied to members that are serialized by the DataContractSerializer.

Remarks

This attribute is used to control which custom attributes can be applied to members during serialization and deserialization. It ensures that only attributes explicitly marked as serializable by the DataContractSerializer are processed, preventing unexpected behavior or errors.

Key scenarios where this attribute is relevant:

  • Defining custom serialization behaviors.
  • Extending the functionality of the DataContractSerializer with metadata.
  • Ensuring interoperability with other systems by controlling the scope of applied attributes.

Syntax

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = true)]
public sealed class OnAppliedDecorationAttribute : Attribute

Constructors

Properties

See Also