Interface ITag

Interface ITag

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

The interface for tags of all kinds.

public interface ITag

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 =&gt; e.Tags.Any(x =&gt; 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") &amp;&amp; !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") &amp;&amp; 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 =&gt; e.Tags.OfType<checkbox>().Any(x =&gt; !x.Checked &amp;&amp; DateTime.UtcNow.Subtract(TimeSpan.FromDays(7)) &lt;= 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 =&gt; e.Tags.OfType<notetask>().Any(x =&gt; !x.Checked &amp;&amp; DateTime.UtcNow.Subtract(TimeSpan.FromDays(7)) &lt;= x.CreationTime &amp;&amp; x.DueDate &lt;= endOfWeek)))
                                                                                                               {
                                                                                                                   report.AppendChildLast(page.Clone());
                                                                                                               }
                                                                                                           }

                                                                                                           report.Save(Path.Combine(dataDir, "IncompleteTasksForThisWeekReport.pdf"));</notetask></itaggable>

Shows how to access details of outlook's tasks.```csharp
// 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}");
                                                                  }
                                                              }
                                                          }</notetask></richtext></richtext>

Shows how to access details of a tag.```csharp // 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}");
                                                    }
                                                }
                                            }</notetag></richtext></richtext>

## Properties

### <a id="Aspose_Note_ITag_CompletedTime"></a> CompletedTime

Gets or sets the completed time.

```csharp
DateTime? CompletedTime { get; }

Property Value

DateTime?

Examples

Shows how to access details of outlook’s tasks.```csharp // 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}");
                                                              }
                                                          }
                                                      }</notetask></richtext></richtext>

Shows how to access details of a tag.```csharp
// 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}");
                                                        }
                                                    }
                                                }</notetag></richtext></richtext>

CreationTime

Gets or sets the creation time.

DateTime CreationTime { get; set; }

Property Value

DateTime

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 =&gt; e.Tags.Any(x =&gt; x.Label.Contains("Project A"))))
                                                                                   {
                                                                                       report.AppendChildLast(page.Clone());
                                                                                   }
                                                                               }

                                                                               report.Save(Path.Combine(dataDir, "ProjectA_Report.pdf"));</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 =&gt; e.Tags.OfType<checkbox>().Any(x =&gt; !x.Checked &amp;&amp; DateTime.UtcNow.Subtract(TimeSpan.FromDays(7)) &lt;= 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 =&gt; e.Tags.OfType<notetask>().Any(x =&gt; !x.Checked &amp;&amp; DateTime.UtcNow.Subtract(TimeSpan.FromDays(7)) &lt;= x.CreationTime &amp;&amp; x.DueDate &lt;= endOfWeek)))
                                                                                                               {
                                                                                                                   report.AppendChildLast(page.Clone());
                                                                                                               }
                                                                                                           }

                                                                                                           report.Save(Path.Combine(dataDir, "IncompleteTasksForThisWeekReport.pdf"));</notetask></itaggable>

Shows how to access details of outlook's tasks.```csharp
// 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}");
                                                                  }
                                                              }
                                                          }</notetask></richtext></richtext>

Shows how to access details of a tag.```csharp // 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}");
                                                    }
                                                }
                                            }</notetag></richtext></richtext>

### <a id="Aspose_Note_ITag_Icon"></a> Icon

Gets or sets the icon.

```csharp
TagIcon Icon { get; }

Property Value

TagIcon

Examples

Shows how to access details of outlook’s tasks.```csharp // 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}");
                                                              }
                                                          }
                                                      }</notetask></richtext></richtext>

Shows how to access details of a tag.```csharp
// 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}");
                                                        }
                                                    }
                                                }</notetag></richtext></richtext>

Label

Gets the label text.

string Label { get; }

Property Value

string

Examples

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") &amp;&amp; !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") &amp;&amp; checkBox.Checked)
                                                                                    {
                                                                                        checkBox.SetOpen();
                                                                                    }
                                                                                }
                                                                            }

                                                                            oneFile.Save(Path.Combine(dataDir, "ProjectNoteWithOpenProjectC.one"));</checkbox></itaggable>

Shows how to access details of a tag.```csharp // 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}");
                                                    }
                                                }
                                            }</notetag></richtext></richtext>

### <a id="Aspose_Note_ITag_Status"></a> Status

Gets or sets the status.

```csharp
TagStatus Status { get; }

Property Value

TagStatus

Examples

Shows how to access details of outlook’s tasks.```csharp // 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}");
                                                              }
                                                          }
                                                      }</notetask></richtext></richtext>

Shows how to access details of a tag.```csharp
// 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}");
                                                        }
                                                    }
                                                }</notetag></richtext></richtext>