Class CheckBox

Class CheckBox

Nombre del espacio: Aspose.Note Asamblea: Aspose.Note.dll (25.4.0)

La clase básica para las etiquetas que pueden separar su estado entre completo e incompleto.

public abstract class CheckBox : ITag
   {
      private bool isChecked;
      private string text;
      public CheckBox(bool isChecked, string text)
      {
         this.isChecked = isChecked;
         this.text = text;
      }
      public bool IsChecked
      {
         get { return isChecked; }
         set { isChecked = value; }
      }
      public string Text
      {
         get { return text; }
         set { text = value; }
      }
   }

Inheritance

object CheckBox

Derived

NoteCheckBox ,y, NoteTask

Implements

ITag

Miembros heredados

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

Examples

Mostra cómo generar un pdf que contiene todas las páginas relacionadas con ‘Proyecto 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"));

Mostra cómo completar todos los elementos de la caja de control relacionados con ‘Proyecto 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));

Mostra cómo abrir todos los elementos de la caja de control relacionados con ‘Proyecto 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"));

Mostra cómo generar un pdf que contiene páginas con artículos marcados por cuadros de control incompletos y creados durante la semana pasada.

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<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"));

Mostra cómo generar un pdf que contiene páginas con tareas incompletas de Outlook para completar en esta semana.

string 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)
   {
       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"));

Constructors

Título de la etiqueta (TagIcon)

Inicia una nueva instancia de la clase Aspose.Note.CheckBox.

protected CheckBox(TagIcon icon)
   {
   }

Parameters

icon TagIcon

La icona de la etiqueta.

Properties

Checked

Recibe un valor que indica si el CheckBox está en el estado verificado.

public bool Checked
   {
      get;
   }

Valor de la propiedad

bool

Examples

Mostra cómo generar un pdf que contiene todas las páginas relacionadas con ‘Proyecto 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<Tag>().Any(e => e.Tags.Any(x => x.Label.Contains("Project A"))))
       {
           report.AppendChildLast(page.Clone());
       }
   }
   report.Save(Path.Combine(dataDir, "ProjectA_Report.pdf"));

Mostra cómo completar todos los elementos de la caja de control relacionados con ‘Proyecto 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));

Mostra cómo abrir todos los elementos de la caja de control relacionados con ‘Proyecto 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"));

Mostra cómo generar un pdf que contiene páginas con artículos marcados por cuadros de control incompletos y creados durante la semana pasada.

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<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"));

Mostra cómo generar un pdf que contiene páginas con tareas incompletas de Outlook para completar en esta semana.

string 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)
   {
       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"));

CompletedTime

Obtenga o establece el tiempo terminado.

public DateTime? CompletedTime
   {
      get;
   }

Valor de la propiedad

DateTime ?

CreationTime

Obtenga o establece el tiempo de creación.

public DateTime CreationTime
   {
      get;
      set;
   }

Valor de la propiedad

DateTime

Icon

Obtenga o coloca el icono.

public abstract TagIcon Icon
   {
      get;
   }

Valor de la propiedad

TagIcon

Label

Obtenga el texto de la etiqueta.

public string Label
   {
      get;
   }

Valor de la propiedad

string

Status

Obtenga o establece el estatus.

public TagStatus Status
   {
      get;
   }

Valor de la propiedad

TagStatus

Methods

El tiempo completo (DateTime)

Coloca la etiqueta al estado completado.

public void SetCompleted(DateTime completedTime)
   {
   }

Parameters

completedTime DateTime

El tiempo terminado.

Completado ( )

Configure la etiqueta al estado terminado utilizando el tiempo actual como tiempo completado.

public void SetCompleted()
   {
   }

Examples

Mostra cómo completar todos los elementos de la caja de control relacionados con ‘Proyecto C’.

string dataDir = RunExamples.GetDataDir_Tags();
   var oneFile = new Aspose.Words.Document(Path.Combine(dataDir, "ProjectNotes.one"));
   foreach (var node in oneFile.GetChildNodes<Aspose.Words.ITaggable>())
   {
       foreach (var checkBox in node.Tags.OfType<Aspose.Words.Checkbox>())
       {
           if (checkBox.Label.Contains("Project C") && !checkBox.Checked)
           {
               checkBox.SetCompleted();
           }
       }
   }
   oneFile.Save(Path.Combine(dataDir, ClosedProjectCNotesFileName));

Conexión()

Coloca la etiqueta en el estado abierto.

public virtual void SetOpen()
   {
   }

Examples

Mostra cómo abrir todos los elementos de la caja de control relacionados con ‘Proyecto C’.

string dataDir = RunExamples.GetDataDir_Tags();
   var oneFile = new Document(Path.Combine(dataDir, ClosedProjectCNotesFileName));
   foreach (var node in oneFile.GetChildNodes<Tagable>())
   {
       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"));
 Español