Interface ITag

Interface ITag

Namespace: Aspose.Note
Assembly: Aspose.Note.dll (25.6.0)

The interface for tags of all kinds.

public interface ITag
{
    string Name { get; set; }
    string Value { get; private set; }
}

Examples

Shows how to generate a pdf containing all pages related to ‘Project A’.

string dataDir = RunExamples.GetDataDir_Tags();
   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 make completed all checkbox items related to ‘Project C’.

string dataDir = RunExamples.GetDataDir_Tags();
   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’.

string dataDir = RunExamples.GetDataDir_Tags();
   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 generate a pdf containing pages with items marked by incomplete checkboxes and created during last week.

var oneFile = new Document(Path.Combine(dataDir, "TagFile.one"));
   var report = new Document();
   foreach (var page in oneFile)
   {
       if (page.GetChildNodes<Aspose.Words.ITaggable>()
            .Any(e => e.Tags.OfType<Aspose.Words.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.

var dataDir = RunExamples.GetDataDir_Tags();
   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.GetChildNodes<Taggable>())
   {
       if (page.GetChildNodes<Taggable>().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.

string dataDir = RunExamples.GetDataDir_Tasks();
   Document oneFile = new Document(dataDir + "Aspose.one");
   IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
   foreach (RichText richText in nodes)
   {
      var tasks = richText.Tags.OfType<Notetask>();
      if (tasks.Any())
      {
         Console.WriteLine($"Task: {richText.Text}");
         Console.WriteLine($"    Completed Time: {tasks.First().CompletedTime}");
         Console.WriteLine($"    Create Time: {tasks.First().CreationTime}");
         Console.WriteLine($"    Due Date: {tasks.First().DueDate}");
         Console.WriteLine($"    Status: {tasks.First().Status}");
         Console.WriteLine($"    Icon: {tasks.First().Icon}");
      }
   }

Shows how to access details of a tag.

string dataDir = RunExamples.GetDataDir_Tags();
   Document oneFile = new Document(dataDir + "TagFile.one");
   IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
   foreach (RichText richText in nodes)
   {
      var tags = richText.Tags.OfType<Notetag>();
      if (tags.Any())
      {
         Console.WriteLine($"Text: {richText.Text}");
         foreach (var noteTag in tags)
         {
            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}");
         }
      }
   }

Properties

CompletedTime

Gets or sets the completed time.

DateTime? completedTime;
   public DateTime? CompletedTime
   {
      get
      {
         return completedTime;
      }
   }

Property Value

DateTime ?

Examples

Shows how to access details of outlook’s tasks.

string dataDir = RunExamples.GetDataDir_Tasks();
   Document oneFile = new Document(dataDir + "Aspose.one");
   IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
   foreach (RichText richText in nodes)
   {
       var tasks = richText.Tags.OfType<Notetask>();
       if (tasks.Any())
       {
           Console.WriteLine($"Task: {richText.Text}");
           Console.WriteLine($"    Completed Time: {tasks.First().CompletedTime}");
           Console.WriteLine($"    Create Time: {tasks.First().CreationTime}");
           Console.WriteLine($"    Due Date: {tasks.First().DueDate}");
           Console.WriteLine($"    Status: {tasks.First().Status}");
           Console.WriteLine($"    Icon: {tasks.First().Icon}");
       }
   }

Shows how to access details of a tag.

string dataDir = RunExamples.GetDataDir_Tags();
   Document oneFile = new Document(dataDir + "TagFile.one");
   IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
   foreach (RichText richText in nodes)
   {
       var tags = richText.Tags.OfType<NoteTag>();
       if (tags.Any())
       {
           Console.WriteLine($"Text: {richText.Text}");
           foreach (var noteTag in tags)
           {
               Console.WriteLine($"\tCompleted Time: {noteTag.CompletedTime}");
               Console.WriteLine($"\tCreate Time: {noteTag.CreationTime}");
               Console.WriteLine($"\tFont Color: {noteTag.FontColor}");
               Console.WriteLine($"\tStatus: {noteTag.Status}");
               Console.WriteLine($"\tLabel: {noteTag.Label}");
               Console.WriteLine($"\tIcon: {noteTag.Icon}");
               Console.WriteLine($"\tHigh Light: {noteTag.Highlight}");
           }
       }
   }

CreationTime

Gets or sets the creation time.

DateTime _creationTime;
   public DateTime CreationTime
   {
      get => _creationTime;
      set => _creationTime = value;
   }

Property Value

DateTime

Examples

Shows how to generate a pdf containing all pages related to ‘Project A’.

var oneFile = new Aspose.Words.Document(Path.Combine(dataDir, "ProjectNotes.one"));
   var report = new Aspose.Words.Document();
   foreach (var page in oneFile.ChildNodes)
   {
       if (((IEnumerable<Aspose.Words.ITaggable>)page.GetChildNodes()).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.

string dataDir = RunExamples.GetDataDir_Tags();
   var oneFile = new Document(Path.Combine(dataDir, "TagFile.one"));
   var report = new Document();
   foreach (var page in oneFile)
   {
      if (page.GetChildNodes<Aspose.Words.ITaggable>()
         .Any(e => e.Tags.OfType<Aspose.Words.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.

var dataDir = RunExamples.GetDataDir_Tags();
   var oneFile = new Document(Path.Combine(dataDir, "TagFile.one"));
   var report = new Document();
   DateTime endOfWeek = DateTime.Today.AddDays(5 - (int)DateTime.Today.DayOfWeek);
   foreach (var page in oneFile)
   {
       if (page.GetChildNodes<Taggable>().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.

string dataDir = RunExamples.GetDataDir_Tasks();
   Document oneFile = new Document(dataDir + "Aspose.one");
   IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
   foreach (RichText richText in nodes)
   {
       var tasks = richText.Tags.OfType<Notetask>();
       if (tasks.Any())
       {
           Console.WriteLine($"Task: {richText.Text}");
           foreach (var noteTask in tasks)
           {
               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.

string dataDir = RunExamples.GetDataDir_Tags();
   Document oneFile = new Document(dataDir + "TagFile.one");
   IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
   foreach (RichText richText in nodes)
   {
       var tags = richText.Tags.OfType<NoteTag>();
       if (tags.Any())
       {
           Console.WriteLine($"Text: {richText.Text}");
           foreach (var noteTag in tags)
           {
               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}");
           }
       }
   }

Icon

Gets or sets the icon.

TagIcon IGetTagIcon()
   {
      return this.Icon;
   }

Property Value

TagIcon

Examples

Shows how to access details of outlook’s tasks.

string dataDir = RunExamples.GetDataDir_Tasks();
   Document oneFile = new Document(dataDir + "Aspose.one");
   IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
   foreach (RichText richText in nodes)
   {
       var tasks = richText.Tags.OfType<Notetask>();
       if (tasks.Any())
       {
           Console.WriteLine($"Task: {richText.Text}");
           foreach (var noteTask in tasks)
           {
               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.

string dataDir = RunExamples.GetDataDir_Tags();
   Document oneFile = new Document(dataDir + "TagFile.one");
   IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
   foreach (RichText richText in nodes)
   {
      var tags = richText.Tags.OfType<NoteTag>();
      if (tags.Any())
      {
         Console.WriteLine($"Text: {richText.Text}");
         Console.WriteLine();
         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}");
      }
   }

Label

Gets the label text.

string Label
   {
      get;
   }

Property Value

string

Examples

Shows how to make completed all checkbox items related to ‘Project C’.

string dataDir = RunExamples.GetDataDir_Tags();
   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’.

string dataDir = RunExamples.GetDataDir_Tags();
   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.

string dataDir = RunExamples.GetDataDir_Tags();
   Document oneFile = new Document(dataDir + "TagFile.one");
   IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
   foreach (RichText richText in nodes)
   {
       var tags = richText.Tags.OfType<Notetag>();
       if (tags.Any())
       {
           Console.WriteLine($"Text: {richText.Text}");
           foreach (var noteTag in tags)
           {
               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}");
           }
       }
   }

Status

Gets or sets the status.

TagStatus TagStatus { get; }

Property Value

TagStatus

Examples

Shows how to access details of outlook’s tasks.

string dataDir = RunExamples.GetDataDir_Tasks();
   Document oneFile = new Document(dataDir + "Aspose.one");
   IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
   foreach (RichText richText in nodes)
   {
       var tasks = richText.Tags.OfType<Notetask>();
       if (tasks.Any())
       {
           Console.WriteLine($"Task: {richText.Text}");
           foreach (var noteTask in tasks)
           {
               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.

string dataDir = RunExamples.GetDataDir_Tags();
   Document oneFile = new Document(dataDir + "TagFile.one");
   IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
   foreach (RichText richText in nodes)
   {
      var tags = richText.Tags.OfType<NoteTag>();
      if (tags.Any())
      {
         Console.WriteLine($"Text: {richText.Text}");
         foreach (var noteTag in tags)
         {
            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}");
         }
      }
   }
 English