Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,13 @@ private static void WriteMetadata(this IndentedTextWriter writer, OpenXmlGenerat
{
foreach (var child in containingType.KnownChildren)
{
writer.Write("builder.AddChild<");
writer.Write(services.FindClassName(child));
writer.WriteLine(">();");
var className = services.FindClassName(child);

writer.Write("builder.AddChild(");
writer.Write(className);
writer.Write(".ElementType, static () => new ");
writer.Write(className);
writer.WriteLine("());");
}
}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,17 @@ internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(ElementType);
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.Callout>();
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.ColorMenu>();
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.ColorMostRecentlyUsed>();
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.Extrusion>();
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.Lock>();
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.Skew>();
builder.AddChild<DocumentFormat.OpenXml.Vml.Fill>();
builder.AddChild<DocumentFormat.OpenXml.Vml.ImageData>();
builder.AddChild<DocumentFormat.OpenXml.Vml.Shadow>();
builder.AddChild<DocumentFormat.OpenXml.Vml.Stroke>();
builder.AddChild<DocumentFormat.OpenXml.Vml.TextBox>();
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.Callout.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.Callout());
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.ColorMenu.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.ColorMenu());
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.ColorMostRecentlyUsed.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.ColorMostRecentlyUsed());
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.Extrusion.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.Extrusion());
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.Lock.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.Lock());
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.Skew.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.Skew());
builder.AddChild(DocumentFormat.OpenXml.Vml.Fill.ElementType, static () => new DocumentFormat.OpenXml.Vml.Fill());
builder.AddChild(DocumentFormat.OpenXml.Vml.ImageData.ElementType, static () => new DocumentFormat.OpenXml.Vml.ImageData());
builder.AddChild(DocumentFormat.OpenXml.Vml.Shadow.ElementType, static () => new DocumentFormat.OpenXml.Vml.Shadow());
builder.AddChild(DocumentFormat.OpenXml.Vml.Stroke.ElementType, static () => new DocumentFormat.OpenXml.Vml.Stroke());
builder.AddChild(DocumentFormat.OpenXml.Vml.TextBox.ElementType, static () => new DocumentFormat.OpenXml.Vml.TextBox());
builder.AddElement<ShapeDefaults>()
.AddAttribute("v:ext", a => a.Extension)
.AddAttribute("spidmax", a => a.MaxShapeId)
Expand Down Expand Up @@ -448,9 +448,9 @@ internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(ElementType);
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.ShapeIdMap>();
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.RegroupTable>();
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.Rules>();
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.ShapeIdMap.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.ShapeIdMap());
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.RegroupTable.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.RegroupTable());
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.Rules.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.Rules());
builder.AddElement<ShapeLayout>()
.AddAttribute("v:ext", a => a.Extension);
builder.Particle = new CompositeParticle.Builder(ParticleType.All, 1, 1)
Expand Down Expand Up @@ -907,7 +907,7 @@ internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(ElementType);
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.RelationTable>();
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.RelationTable.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.RelationTable());
builder.AddElement<Diagram>()
.AddAttribute("v:ext", a => a.Extension)
.AddAttribute("dgmstyle", a => a.Style)
Expand Down Expand Up @@ -1905,9 +1905,9 @@ internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(ElementType);
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.LinkType>();
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.LockedField>();
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.FieldCodes>();
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.LinkType.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.LinkType());
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.LockedField.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.LockedField());
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.FieldCodes.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.FieldCodes());
builder.AddElement<OleObject>()
.AddAttribute("Type", a => a.Type)
.AddAttribute("ProgID", a => a.ProgId)
Expand Down Expand Up @@ -2733,7 +2733,7 @@ internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(ElementType);
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.Entry>();
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.Entry.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.Entry());
builder.AddElement<RegroupTable>()
.AddAttribute("v:ext", a => a.Extension);
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
Expand Down Expand Up @@ -2813,7 +2813,7 @@ internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(ElementType);
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.Rule>();
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.Rule.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.Rule());
builder.AddElement<Rules>()
.AddAttribute("v:ext", a => a.Extension);
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
Expand Down Expand Up @@ -2973,7 +2973,7 @@ internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(ElementType);
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.Proxy>();
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.Proxy.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.Proxy());
builder.AddElement<Rule>()
.AddAttribute("id", a => a.Id, aBuilder =>
{
Expand Down Expand Up @@ -3062,7 +3062,7 @@ internal override void ConfigureMetadata(ElementMetadata.Builder builder)
{
base.ConfigureMetadata(builder);
builder.SetSchema(ElementType);
builder.AddChild<DocumentFormat.OpenXml.Vml.Office.Relation>();
builder.AddChild(DocumentFormat.OpenXml.Vml.Office.Relation.ElementType, static () => new DocumentFormat.OpenXml.Vml.Office.Relation());
builder.AddElement<RelationTable>()
.AddAttribute("v:ext", a => a.Extension);
builder.Particle = new CompositeParticle.Builder(ParticleType.Sequence, 1, 1)
Expand Down
Loading
Loading