Class CheckBox

Class CheckBox

A név: Aspose.Note Összefoglaló: Aspose.Note.dll (25.4.0)

Az alaposztály olyan címkék számára, amelyek állapota teljes és hiányos között osztható.

public abstract class CheckBox : ITag

Inheritance

object CheckBox

Derived

NoteCheckBox , NoteTask

Implements

ITag

Örökletes tagok

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

Megmutatja, hogyan kell létrehozni egy PDF-t, amely tartalmazza az összes “Project A” oldalát.

// 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>

Megmutatja, hogyan kell befejezni az összes “Project C” kapcsolódó elemet.

// 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>

Megmutatja, hogyan lehet megnyitni az összes “Project C” kapcsolódó elemet.

// 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>

Megmutatja, hogyan kell létrehozni egy PDF-t, amely tartalmazza az elemekkel ellátott oldalakat, melyeket hiányos ellenőrző dobozok jelöltek meg, és amelyeket a múlt héten hoztak létre.

// 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>

Megmutatja, hogyan kell létrehozni egy PDF-t, amely az Outlook hiányos feladatait tartalmazza ezen a héten.

// 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>

Constructors

CheckBox(TagIcon)

Kezdődik a Aspose.Note.CheckBox osztály új példája.

protected CheckBox(TagIcon icon)

Parameters

icon TagIcon

A tag ikonja.

Properties

Checked

Megkap egy értéket, amely azt jelzi, hogy a CheckBox ellenőrzött állapotban van-e.

public bool Checked { get; }

ingatlan értéke

bool

Examples

Megmutatja, hogyan kell létrehozni egy PDF-t, amely tartalmazza az összes “Project A” oldalát.

// 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>

Megmutatja, hogyan kell befejezni az összes “Project C” kapcsolódó elemet.

// 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>

Megmutatja, hogyan lehet megnyitni az összes “Project C” kapcsolódó elemet.

// 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>

Megmutatja, hogyan kell létrehozni egy PDF-t, amely tartalmazza az elemekkel ellátott oldalakat, melyeket hiányos ellenőrző dobozok jelöltek meg, és amelyeket a múlt héten hoztak létre.

// 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>

Megmutatja, hogyan kell létrehozni egy PDF-t, amely az Outlook hiányos feladatait tartalmazza ezen a héten.

// 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>

CompletedTime

Megkapja vagy beállítja a befejezett időt.

public DateTime? CompletedTime { get; }

ingatlan értéke

DateTime ?

CreationTime

Megkapja vagy beállítja a teremtés idejét.

public DateTime CreationTime { get; set; }

ingatlan értéke

DateTime

Icon

Megkapja vagy beállítja az ikonot.

public abstract TagIcon Icon { get; }

ingatlan értéke

TagIcon

Label

Megkapja a címke szöveget.

public string Label { get; }

ingatlan értéke

string

Status

Megkapja vagy beállítja a státuszt.

public TagStatus Status { get; }

ingatlan értéke

TagStatus

Methods

SetCompleted(DateTime)

Állítsa be a címkét a befejezett állapotba.

public void SetCompleted(DateTime completedTime)

Parameters

completedTime DateTime

A befejezett idő.

SetCompleted()

Állítsa be a címkéket a befejezett állapotba, a jelenlegi időt befejezett időként használva.

public void SetCompleted()

Examples

Megmutatja, hogyan kell befejezni az összes “Project C” kapcsolódó elemet.

// 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>

SetOpen()

Állítsa be a címkét a nyílt állapotba.

public virtual void SetOpen()

Examples

Megmutatja, hogyan lehet megnyitni az összes “Project C” kapcsolódó elemet.

// 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>
 Magyar