Class CheckBox
Le nom : Aspose.Note Assemblée: Aspose.Note.dll (25.4.0)
La classe de base pour les tags qui peuvent regrouper leur état entre complet et incomplète.
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
Derived
Implements
I membri ereditari
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Découvrez comment générer un pdf contenant toutes les pages liées à ‘Projet 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"));
Affichez comment remplir tous les éléments de la boîte de contrôle liés à ‘Projet 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));
Affichez comment ouvrir tous les éléments de la boîte de contrôle liés à ‘Projet 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"));
Il montre comment générer un pdf contenant des pages avec des articles marqués par des boîtes d’inspection incomplètes et créés au cours de la semaine dernière.
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"));
Découvrez comment générer un pdf contenant des pages avec Outlook tâches incomplètes à remplir cette semaine.
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
Le CheckBox (TagIcon)
Initialisez une nouvelle instance de la classe Aspose.Note.CheckBox.
protected CheckBox(TagIcon icon)
{
}
Parameters
icon
TagIcon
L’icône du tag.
Properties
Checked
Obtenez une valeur indiquant si le CheckBox est dans l’état vérifié.
public bool Checked
{
get;
}
Valore di proprietà
Examples
Découvrez comment générer un pdf contenant toutes les pages liées à ‘Projet 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"));
Affichez comment remplir tous les éléments de la boîte de contrôle liés à ‘Projet 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));
Affichez comment ouvrir tous les éléments de la boîte de contrôle liés à ‘Projet 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"));
Il montre comment générer un pdf contenant des pages avec des articles marqués par des boîtes d’inspection incomplètes et créés au cours de la semaine dernière.
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"));
Découvrez comment générer un pdf contenant des pages avec Outlook tâches incomplètes à remplir cette semaine.
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
Obtenez ou définissez le temps terminé.
public DateTime? CompletedTime
{
get;
}
Valore di proprietà
DateTime ?
CreationTime
Obtenez ou définissez le temps de création.
public DateTime CreationTime
{
get;
set;
}
Valore di proprietà
Icon
Obtenez ou mettez l’icône.
public abstract TagIcon Icon
{
get;
}
Valore di proprietà
Label
Obtenez le texte de l’étiquette.
public string Label
{
get;
}
Valore di proprietà
Status
Obtenez ou définissez le statut.
public TagStatus Status
{
get;
}
Valore di proprietà
Methods
Démarrage complet (DateTime)
Mettez la marque à l’état terminé.
public void SetCompleted(DateTime completedTime)
{
}
Parameters
completedTime
DateTime
Le temps terminé.
Complet( )
Mettez le tag dans l’état terminé en utilisant le temps actuel en tant que temps complet.
public void SetCompleted()
{
}
Examples
Affichez comment remplir tous les éléments de la boîte de contrôle liés à ‘Projet 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));
Déploiement ()
Mettez la marque à l’état ouvert.
public virtual void SetOpen()
{
}
Examples
Affichez comment ouvrir tous les éléments de la boîte de contrôle liés à ‘Projet 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"));