-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TextWithShapeFormat to support
fBehindDocument
- Loading branch information
1 parent
5fbf6ed
commit f6ed8d7
Showing
3 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...graDoc/src/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/TextWithShapeFormat.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// MigraDoc - Creating Documents on the Fly | ||
// See the LICENSE file in the solution root for more information. | ||
|
||
namespace MigraDoc.DocumentObjectModel.Shapes | ||
{ | ||
/// <summary> | ||
/// A TextWithShapeFormat object | ||
/// Defines the background filling of the shape. | ||
/// </summary> | ||
public class TextWithShapeFormat : DocumentObject | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the FillFormat class. | ||
/// </summary> | ||
public TextWithShapeFormat() { } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the FillFormat class with the specified parent. | ||
/// </summary> | ||
internal TextWithShapeFormat(DocumentObject parent) : base(parent) { } | ||
|
||
/// <summary> | ||
/// Creates a deep copy of this object. | ||
/// </summary> | ||
public new TextWithShapeFormat Clone() | ||
=> (TextWithShapeFormat)DeepCopy(); | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the text should be in front of the shape. | ||
/// </summary> | ||
public bool? TextInFront { get; set; } | ||
|
||
/// <summary> | ||
/// Converts FillFormat into DDL. | ||
/// </summary> | ||
internal override void Serialize(Serializer serializer) | ||
{ | ||
int pos = serializer.BeginContent("TextWithShapeFormat"); | ||
if (this.TextInFront.HasValue) | ||
serializer.WriteSimpleAttribute("TextInFront", this.TextInFront.Value); | ||
|
||
serializer.EndContent(); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the meta object of this instance. | ||
/// </summary> | ||
internal override Meta Meta => TheMeta; | ||
|
||
static readonly Meta TheMeta = new(typeof(TextWithShapeFormat)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters