ITag.Label
Contents
[
Hide
]ITag.Label property
Gets the label text.
public string Label { get; }
Examples
Shows how to make completed all checkbox items related to ‘Project C’.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Tags();
// Load the document into Aspose.Note.
var oneFile = new Document(Path.Combine(dataDir, "ProjectNotes.one"));
foreach (var node in oneFile.GetChildNodes<ITaggable>())
{
foreach (var checkBox in node.Tags.OfType<CheckBox>())
{
if (checkBox.Label.Contains("Project C") && !checkBox.Checked)
{
checkBox.SetCompleted();
}
}
}
oneFile.Save(Path.Combine(dataDir, ClosedProjectCNotesFileName));
Shows how to make open all checkbox items related to ‘Project C’.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Tags();
// Load the document into Aspose.Note.
var oneFile = new Document(Path.Combine(dataDir, ClosedProjectCNotesFileName));
foreach (var node in oneFile.GetChildNodes<ITaggable>())
{
foreach (var checkBox in node.Tags.OfType<CheckBox>())
{
if (checkBox.Label.Contains("Project C") && checkBox.Checked)
{
checkBox.SetOpen();
}
}
}
oneFile.Save(Path.Combine(dataDir, "ProjectNoteWithOpenProjectC.one"));
Shows how to access details of a tag.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Tags();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "TagFile.one");
// Get all RichText nodes
IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
// Iterate through each node
foreach (RichText richText in nodes)
{
var tags = richText.Tags.OfType<NoteTag>();
if (tags.Any())
{
Console.WriteLine($"Text: {richText.Text}");
foreach (var noteTag in tags)
{
// Retrieve properties
Console.WriteLine($" Completed Time: {noteTag.CompletedTime}");
Console.WriteLine($" Create Time: {noteTag.CreationTime}");
Console.WriteLine($" Font Color: {noteTag.FontColor}");
Console.WriteLine($" Status: {noteTag.Status}");
Console.WriteLine($" Label: {noteTag.Label}");
Console.WriteLine($" Icon: {noteTag.Icon}");
Console.WriteLine($" High Light: {noteTag.Highlight}");
}
}
}
See Also
- interface ITag
- namespace Aspose.Note
- assembly Aspose.Note