Interface ITaggable
Interface ITaggable
Название пространства: Aspose.Note Ассоциация: Aspose.Note.dll (25.4.0)
Интерфейс для узлов, которые могут быть обозначены тегами.
public interface ITaggable : INode
Implements
Examples
Показать, как генерировать pdf, содержащий все страницы, связанные с “Проект А”.
// 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>
Показать, как сделать завершены все предметы в контрольной коробке, связанные с “Проект С”.
// 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>
Показать, как открыть все элементы контрольного ящика, связанные с «Проект С».
// 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>
Показывает, как генерировать PDF-файл, содержащий страницы с элементами, обозначенными неполными коробками и созданными на прошлой неделе.
// 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>
Показать, как генерировать PDF-файлы, содержащие страницы с неполными задачами Outlook, которые должны быть выполнены на этой неделе.
// 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
Tags
Получите список всех тегов.
List<itag> Tags { get; }