ContentSerializerAttribute.Optional Property

Indicates whether to write this element if the member is null and skip past it if not found when deserializing XML (default=false).

Namespace: Microsoft.Xna.Framework.Content
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

public bool Optional { get; set; }

Property Value

true if the member should be skipped when null.

ContentSerializerAttribute with Optional set true.

[ContentSerializerAttribute( Optional = true )]

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone

Community Additions

ADD
Show: