ITag.CreationTime
Contents
[
Hide
]ITag.CreationTime property
Gets or sets the creation time.
public DateTime CreationTime { get; set; }
Property Value
The DateTime.
Examples
Shows how to generate a pdf containing all pages related to ‘Project A’.
// 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"));
Shows how to generate a pdf containing pages with items marked by incomplete checkboxes and created during last week.
// 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"));
Shows how to generate a pdf containing pages with Outlook incomplete tasks to complete on this week.
// 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"));
Shows how to access details of outlook’s tasks.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Tasks();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "Aspose.one");
// Get all RichText nodes
IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
// Iterate through each node
foreach (RichText richText in nodes)
{
var tasks = richText.Tags.OfType<NoteTask>();
if (tasks.Any())
{
Console.WriteLine($"Task: {richText.Text}");
foreach (var noteTask in tasks)
{
// Retrieve properties
Console.WriteLine($" Completed Time: {noteTask.CompletedTime}");
Console.WriteLine($" Create Time: {noteTask.CreationTime}");
Console.WriteLine($" Due Date: {noteTask.DueDate}");
Console.WriteLine($" Status: {noteTask.Status}");
Console.WriteLine($" Icon: {noteTask.Icon}");
}
}
}
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