Class MarkupData
Abstract entity representing an item that can be included inside a MarkupDataContainer. Examples: TextMarkup, PlaceholderTag, TagPair.
Inheritance
Inherited Members
Namespace: Sdl.Core.Bcm.BcmModel
Assembly: Sdl.Core.Bcm.BcmModel.dll
Syntax
[DataContract]
[JsonConverter(typeof(MarkupDataCreator))]
public abstract class MarkupData : MetadataContainer, IEquatable<MetadataContainer>, ICloneable<MarkupData>, IEquatable<MarkupData>
Remarks
Inheritors of MarkupData should not implement themselves IEquatable<T>, but should override MarkupData equality.
Constructors
MarkupData()
Initializes a new instance of the MarkupData class.
Declaration
protected MarkupData()
MarkupData(string)
Initializes a new instance of the MarkupData class.
Declaration
protected MarkupData(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | The identifier. |
Properties
Ancestors
This item's MarkupDataContainer ancestors, in ascending order.
Declaration
public IEnumerable<MarkupDataContainer> Ancestors { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<MarkupDataContainer> |
Id
Markup data unique id (GUID).
Declaration
[JsonProperty(PropertyName = "id", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, Order = -2147483648)]
public string Id { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
IndexInParent
The index of this item in the parent MarkupDataContainer. -1 if it doesn't have a parent.
Declaration
public int IndexInParent { get; }
Property Value
| Type | Description |
|---|---|
| int |
IsContainer
True if this MarkupData is a container. Otherwise false.
Declaration
public bool IsContainer { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Parent
The MarkupDataContainer parent container.
Declaration
public MarkupDataContainer Parent { get; set; }
Property Value
| Type | Description |
|---|---|
| MarkupDataContainer |
ParentFragment
The Fragment containing this item.
Declaration
public Fragment ParentFragment { get; }
Property Value
| Type | Description |
|---|---|
| Fragment |
ParentParagraph
The Paragraph containing this item.
Declaration
public Paragraph ParentParagraph { get; }
Property Value
| Type | Description |
|---|---|
| Paragraph |
ParentParagraphUnit
The ParagraphUnit containing this item.
Declaration
public virtual ParagraphUnit ParentParagraphUnit { get; set; }
Property Value
| Type | Description |
|---|---|
| ParagraphUnit |
ParentSegment
The Segment containing this item. Null if the item isn't inside of a Segment.
Declaration
public Segment ParentSegment { get; }
Property Value
| Type | Description |
|---|---|
| Segment |
Type
Gets or sets the type. Should be implement in derived classes to uniquely identify the type of MarkupData on deserialization.
Declaration
[JsonProperty("type")]
protected abstract string Type { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The type. |
Methods
AcceptVisitor(BcmVisitor)
Accepts a visitor of type BcmVisitor.
Declaration
public abstract void AcceptVisitor(BcmVisitor visitor)
Parameters
| Type | Name | Description |
|---|---|---|
| BcmVisitor | visitor | The BcmVisitor used to visit this item. |
Clone()
Clones the item to a new MarkupData.
Declaration
public virtual MarkupData Clone()
Returns
| Type | Description |
|---|---|
| MarkupData |
Equals(MarkupData)
Indicates whether the current object is equal to another object of the same type.
Declaration
public virtual bool Equals(MarkupData other)
Parameters
| Type | Name | Description |
|---|---|---|
| MarkupData | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool | true if the current object is equal to the |
Equals(object)
Performs a deep-equals comparison.
System.Object.Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for this instance. |
Overrides
UniqueClone()
Creates clone of the current object, with a new unique Id.
Declaration
public virtual MarkupData UniqueClone()
Returns
| Type | Description |
|---|---|
| MarkupData | A clone with a new unique Id. |