Class XlfTransUnit.Optionals
- Namespace
- SunamoXliffParser
- Assembly
- SunamoXliffParser.dll
Provides access to optional attributes of a translation unit element.
public class XlfTransUnit.Optionals
- Inheritance
-
XlfTransUnit.Optionals
- Inherited Members
- Extension Methods
Constructors
Optionals(XElement, XNamespace)
Initializes a new instance of the XlfTransUnit.Optionals class.
public Optionals(XElement node, XNamespace xmlNamespace)
Parameters
nodeXElementThe XML element containing optional attributes.
xmlNamespaceXNamespaceThe XML namespace of the XLIFF document.
Properties
Approved
Gets or sets the approved attribute which indicates whether a translation is final or has passed its final review.
public string Approved { get; set; }
Property Value
DataType
Gets or sets the datatype attribute specifying the kind of text contained in the element.
public string DataType { get; set; }
Property Value
Notes
Gets the collection of note elements associated with this translation unit.
public IEnumerable<XlfNote> Notes { get; }
Property Value
Resname
Gets or sets the resname attribute which is the resource name or identifier of an item.
public string Resname { get; set; }
Property Value
Restype
Gets or sets the restype attribute which indicates the resource type of the container element.
public string Restype { get; set; }
Property Value
TargetState
Gets or sets the status of a particular translation in a target or bin-target element.
public string? TargetState { get; set; }
Property Value
Translate
Gets or sets the translate attribute which indicates whether or not the text should be translated.
public string Translate { get; set; }
Property Value
Methods
AddNote(string)
Adds a note with the specified comment.
public void AddNote(string comment)
Parameters
commentstringThe text content of the note.
AddNote(string, string)
Adds a note with the specified comment and optional author.
public void AddNote(string comment, string from)
Parameters
RemoveNotes(string, string)
Removes all notes that have the specified attribute with the specified value.
public void RemoveNotes(string attributeName, string value)
Parameters
attributeNamestringThe name of the attribute to match.
valuestringThe value of the attribute to match.
SetCommentFromResx(string)
Sets or updates the first note from a ResX comment, or adds a new note if none exists.
public void SetCommentFromResx(string comment)
Parameters
commentstringThe comment text from the ResX source.
ToString()
Returns the XML string representation of this translation unit's optional attributes.
public override string ToString()
Returns
- string
The XML string of the node.