Class CheckBox
Названий на: Aspose.Note Асамблея: Aspose.Note.dll (25.4.0)
Базовий клас для тегів, які можуть розрізнити свій стан між повною і неповною.
public abstract class CheckBox : ITag
Inheritance
Derived
Implements
Нападні члени
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
Показує, як генерувати PDF, що містить всі сторінки, пов’язані з “Проект А”.
// 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 => e.Tags.Any(x => x.Label.Contains("Project A"))))
{
report.AppendChildLast(page.Clone());
}
}
report.Save(Path.Combine(dataDir, "ProjectA_Report.pdf"));</itaggable>
Показати, як завершити всі пункти перевірки, пов’язані з “Проект C”.
// 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") && !checkBox.Checked)
{
checkBox.SetCompleted();
}
}
}
oneFile.Save(Path.Combine(dataDir, ClosedProjectCNotesFileName));</checkbox></itaggable>
Показати, як відкрити всі елементи контрольної скриньки, пов’язані з “Проект C”.
// 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") && checkBox.Checked)
{
checkBox.SetOpen();
}
}
}
oneFile.Save(Path.Combine(dataDir, "ProjectNoteWithOpenProjectC.one"));</checkbox></itaggable>
Показує, як генерувати PDF-файл, що містить сторінки з елементами, зазначеними неповними коробками і створеними протягом минулого тижня.
// 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 => 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"));</checkbox></itaggable>
Покажіть, як генерувати PDF, що містить сторінки з Outlook неповні завдання, які повинні бути виконані на цьому тижні.
// 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 => 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"));</notetask></itaggable>
Constructors
CheckBox(TagIcon)
Ініціалює нову інстанцію класу Aspose.Note.CheckBox.
protected CheckBox(TagIcon icon)
Parameters
icon
TagIcon
Ікони з тегу.
Properties
Checked
Отримається значення, яке вказує на те, чи знаходиться CheckBox в перевіреному стані.
public bool Checked { get; }
вартість нерухомості
Examples
Показує, як генерувати PDF, що містить всі сторінки, пов’язані з “Проект А”.
// 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 => e.Tags.Any(x => x.Label.Contains("Project A"))))
{
report.AppendChildLast(page.Clone());
}
}
report.Save(Path.Combine(dataDir, "ProjectA_Report.pdf"));</itaggable>
Показати, як завершити всі пункти перевірки, пов’язані з “Проект C”.
// 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") && !checkBox.Checked)
{
checkBox.SetCompleted();
}
}
}
oneFile.Save(Path.Combine(dataDir, ClosedProjectCNotesFileName));</checkbox></itaggable>
Показати, як відкрити всі елементи контрольної скриньки, пов’язані з “Проект C”.
// 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") && checkBox.Checked)
{
checkBox.SetOpen();
}
}
}
oneFile.Save(Path.Combine(dataDir, "ProjectNoteWithOpenProjectC.one"));</checkbox></itaggable>
Показує, як генерувати PDF-файл, що містить сторінки з елементами, зазначеними неповними коробками і створеними протягом минулого тижня.
// 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 => 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"));</checkbox></itaggable>
Покажіть, як генерувати PDF, що містить сторінки з Outlook неповні завдання, які повинні бути виконані на цьому тижні.
// 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 => 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"));</notetask></itaggable>
CompletedTime
Приймати або встановити завершений час.
public DateTime? CompletedTime { get; }
вартість нерухомості
DateTime ?
CreationTime
Знайти або встановити час створення.
public DateTime CreationTime { get; set; }
вартість нерухомості
Icon
Приймати або встановити ікону.
public abstract TagIcon Icon { get; }
вартість нерухомості
Label
Знайдіть текст етикетки.
public string Label { get; }
вартість нерухомості
Status
Знайти або встановити статус.
public TagStatus Status { get; }
вартість нерухомості
Methods
SetCompleted(DateTime)
Налаштуйте знак до завершеного стану.
public void SetCompleted(DateTime completedTime)
Parameters
completedTime
DateTime
Завершеного часу .
SetCompleted()
Налаштуйте етикетку до завершеного стану за допомогою поточного часу як закінченого часу.
public void SetCompleted()
Examples
Показати, як завершити всі пункти перевірки, пов’язані з “Проект C”.
// 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") && !checkBox.Checked)
{
checkBox.SetCompleted();
}
}
}
oneFile.Save(Path.Combine(dataDir, ClosedProjectCNotesFileName));</checkbox></itaggable>
SetOpen()
Налаштуйте знак для відкритого стану.
public virtual void SetOpen()
Examples
Показати, як відкрити всі елементи контрольної скриньки, пов’язані з “Проект C”.
// 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") && checkBox.Checked)
{
checkBox.SetOpen();
}
}
}
oneFile.Save(Path.Combine(dataDir, "ProjectNoteWithOpenProjectC.one"));</checkbox></itaggable>