Interface ITaggable
Interface ITaggable
Namespace: Aspose.Note
Assembly: Aspose.Note.dll (24.12.0)
The interface for nodes that can be marked by tags.
public interface ITaggable : INode
Implements
Examples
Shows how to generate a pdf containing all pages related to ‘Project A’.```csharp // 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"));
var report = new Document();
foreach (var page in oneFile)
{
if (page.GetChildNodes<itaggable>().Any(e => e.Tags.Any(x => x.Label.Contains("Project A"))))
{
report.AppendChildLast(page.Clone());
}
}
report.Save(Path.Combine(dataDir, "ProjectA_Report.pdf"));</itaggable>
Shows how to make completed all checkbox items related to 'Project C'.```csharp
// 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));</checkbox></itaggable>
Shows how to make open all checkbox items related to ‘Project C’.```csharp // 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"));</checkbox></itaggable>
Shows how to generate a pdf containing pages with items marked by incomplete checkboxes and created during last week.```csharp
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Tags();
// Load the document into Aspose.Note.
var oneFile = new Document(Path.Combine(dataDir, "TagFile.one"));
var report = new Document();
foreach (var page in oneFile)
{
if (page.GetChildNodes<itaggable>().Any(e => e.Tags.OfType<checkbox>().Any(x => !x.Checked && DateTime.UtcNow.Subtract(TimeSpan.FromDays(7)) <= x.CreationTime)))
{
report.AppendChildLast(page.Clone());
}
}
report.Save(Path.Combine(dataDir, "IncompleteLastWeekReport.pdf"));</checkbox></itaggable>
Shows how to generate a pdf containing pages with Outlook incomplete tasks to complete on this week.```csharp // The path to the documents directory. string dataDir = RunExamples.GetDataDir_Tags();
// Load the document into Aspose.Note.
var oneFile = new Document(Path.Combine(dataDir, "TagFile.one"));
var report = new Document();
var endOfWeek = DateTime.Today.AddDays(5 - (int)DateTime.Today.DayOfWeek);
foreach (var page in oneFile)
{
if (page.GetChildNodes<itaggable>().Any(e => e.Tags.OfType<notetask>().Any(x => !x.Checked && DateTime.UtcNow.Subtract(TimeSpan.FromDays(7)) <= x.CreationTime && x.DueDate <= endOfWeek)))
{
report.AppendChildLast(page.Clone());
}
}
report.Save(Path.Combine(dataDir, "IncompleteTasksForThisWeekReport.pdf"));</notetask></itaggable>
## Properties
### <a id="Aspose_Note_ITaggable_Tags"></a> Tags
Gets the list of all tags.
```csharp
List<itag> Tags { get; }