Skip to content

Commit

Permalink
correcting animation types
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjebo committed Apr 7, 2021
1 parent 0a9b611 commit 68d48ac
Show file tree
Hide file tree
Showing 4 changed files with 311 additions and 127 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,212 @@

namespace DocumentFormat.OpenXml.Office2019.Drawing.Animation
{
/// <summary>
/// <para>Defines the AnimationProperties Class.</para>
/// <para>This class is available in Office 2019 and above.</para>
/// <para>When the object is serialized out as xml, it's qualified name is aanim:animPr.</para>
/// </summary>
/// <remark>
/// <para>The following table lists the possible child types:</para>
/// <list type="bullet">
/// <item><description>OfficeArtExtensionList &lt;aanim:extLst></description></item>
/// </list>
/// </remark>
#pragma warning disable CS0618 // Type or member is obsolete
[SchemaAttr(111, "animPr")]
#pragma warning restore CS0618 // Type or member is obsolete
public partial class AnimationProperties : OpenXmlCompositeElement
{
/// <summary>
/// Initializes a new instance of the AnimationProperties class.
/// </summary>
public AnimationProperties() : base()
{
}

/// <summary>
/// Initializes a new instance of the AnimationProperties class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public AnimationProperties(IEnumerable<OpenXmlElement> childElements) : base(childElements)
{
}

/// <summary>
/// Initializes a new instance of the AnimationProperties class with the specified child elements.
/// </summary>
/// <param name="childElements">Specifies the child elements.</param>
public AnimationProperties(params OpenXmlElement[] childElements) : base(childElements)
{
}

/// <summary>
/// Initializes a new instance of the AnimationProperties class from outer XML.
/// </summary>
/// <param name="outerXml">Specifies the outer XML of the element.</param>
public AnimationProperties(string outerXml) : base(outerXml)
{
}

/// <summary>
/// <para>name, this property is only available in Office 2019 and later.</para>
/// <para>Represents the following attribute in the schema: name</para>
/// </summary>

#pragma warning disable CS0618 // Type or member is obsolete

[SchemaAttr(0, "name")]
#pragma warning restore CS0618 // Type or member is obsolete

public StringValue? Name
{
get => GetAttribute<StringValue>();
set => SetAttribute(value);
}

/// <summary>
/// <para>length, this property is only available in Office 2019 and later.</para>
/// <para>Represents the following attribute in the schema: length</para>
/// </summary>

#pragma warning disable CS0618 // Type or member is obsolete

[SchemaAttr(0, "length")]
#pragma warning restore CS0618 // Type or member is obsolete

public StringValue? Length
{
get => GetAttribute<StringValue>();
set => SetAttribute(value);
}

/// <summary>
/// <para>count, this property is only available in Office 2019 and later.</para>
/// <para>Represents the following attribute in the schema: count</para>
/// </summary>

#pragma warning disable CS0618 // Type or member is obsolete

[SchemaAttr(0, "count")]
#pragma warning restore CS0618 // Type or member is obsolete

public StringValue? Count
{
get => GetAttribute<StringValue>();
set => SetAttribute(value);
}

/// <summary>
/// <para>auto, this property is only available in Office 2019 and later.</para>
/// <para>Represents the following attribute in the schema: auto</para>
/// </summary>

#pragma warning disable CS0618 // Type or member is obsolete

[SchemaAttr(0, "auto")]
#pragma warning restore CS0618 // Type or member is obsolete

public BooleanValue? Auto
{
get => GetAttribute<BooleanValue>();
set => SetAttribute(value);
}

/// <summary>
/// <para>offset, this property is only available in Office 2019 and later.</para>
/// <para>Represents the following attribute in the schema: offset</para>
/// </summary>

#pragma warning disable CS0618 // Type or member is obsolete

[SchemaAttr(0, "offset")]
#pragma warning restore CS0618 // Type or member is obsolete

public StringValue? Offset
{
get => GetAttribute<StringValue>();
set => SetAttribute(value);
}

/// <summary>
/// <para>st, this property is only available in Office 2019 and later.</para>
/// <para>Represents the following attribute in the schema: st</para>
/// </summary>

#pragma warning disable CS0618 // Type or member is obsolete

[SchemaAttr(0, "st")]
#pragma warning restore CS0618 // Type or member is obsolete

public StringValue? St
{
get => GetAttribute<StringValue>();
set => SetAttribute(value);
}

/// <summary>
/// <para>end, this property is only available in Office 2019 and later.</para>
/// <para>Represents the following attribute in the schema: end</para>
/// </summary>

#pragma warning disable CS0618 // Type or member is obsolete

[SchemaAttr(0, "end")]
#pragma warning restore CS0618 // Type or member is obsolete

public StringValue? End
{
get => GetAttribute<StringValue>();
set => SetAttribute(value);
}

internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(111, "animPr");
builder.Availability = FileFormatVersions.Office2019;
builder.AddChild<OfficeArtExtensionList>();
builder.AddElement<AnimationProperties>()
.AddAttribute(0, "name", a => a.Name)
.AddAttribute(0, "length", a => a.Length, aBuilder =>
{
aBuilder.AddValidator(RequiredValidator.Instance);
})
.AddAttribute(0, "count", a => a.Count, aBuilder =>
{
aBuilder.AddUnion(union =>
{
union.AddValidator<UInt32Value>(NumberValidator.Instance);
union.AddValidator<EnumValue<DocumentFormat.OpenXml.Office2019.Drawing.Animation.Indefinite>>(EnumValidator.Instance);
});
})
.AddAttribute(0, "auto", a => a.Auto)
.AddAttribute(0, "offset", a => a.Offset)
.AddAttribute(0, "st", a => a.St)
.AddAttribute(0, "end", a => a.End);
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
{
new ElementParticle(typeof(DocumentFormat.OpenXml.Office2019.Drawing.Animation.OfficeArtExtensionList), 0, 1, version: FileFormatVersions.Office2019)
};
}

/// <summary>
/// <para>OfficeArtExtensionList.</para>
/// <para>Represents the following element tag in the schema: aanim:extLst.</para>
/// </summary>
/// <remark>
/// xmlns:aanim = http://schemas.microsoft.com/office/drawing/2018/animation
/// </remark>
public OfficeArtExtensionList? OfficeArtExtensionList
{
get => GetElement<OfficeArtExtensionList>();
set => SetElement(value);
}

/// <inheritdoc/>
public override OpenXmlElement CloneNode(bool deep) => CloneImp<AnimationProperties>(deep);
}

/// <summary>
/// <para>Defines the OfficeArtExtensionList Class.</para>
/// <para>This class is available in Office 2019 and above.</para>
Expand Down Expand Up @@ -85,16 +291,16 @@ internal override void ConfigureMetadata(ElementMetadata.Builder builder)
}

/// <summary>
/// Defines the Infinite enumeration.
/// Defines the Indefinite enumeration.
/// </summary>
[OfficeAvailability(FileFormatVersions.Office2019)]
public enum Infinite
public enum Indefinite
{
///<summary>
///infinite.
///<para>When the item is serialized out as xml, its value is "infinite".</para>
///indefinite.
///<para>When the item is serialized out as xml, its value is "indefinite".</para>
///</summary>
[EnumString("infinite")]
Infinite,
[EnumString("indefinite")]
Indefinite,
}
}
Loading

0 comments on commit 68d48ac

Please sign in to comment.