AnkiIO 1.0.2
Build, validate, import, and export Anki-compatible decks from .NET
Loading...
Searching...
No Matches
AnkiCard.cs
1namespace AnkiIO;
2
23public sealed class AnkiCard
24{
25 private AnkiScheduling scheduling;
26
45 public AnkiCard(long id, long noteId, long deckId, int templateOrdinal, AnkiScheduling scheduling)
46 {
47 ArgumentOutOfRangeException.ThrowIfNegative(templateOrdinal);
48
49 Id = id;
50 NoteId = noteId;
51 DeckId = deckId;
52 TemplateOrdinal = templateOrdinal;
53 this.scheduling = scheduling ?? throw new ArgumentNullException(nameof(scheduling));
54 }
55
62 public long Id { get; }
63
66 public long NoteId { get; }
67
75 public long DeckId { get; set; }
76
85 public int TemplateOrdinal { get; }
86
96 {
97 get => scheduling;
98 set => scheduling = value ?? throw new ArgumentNullException(nameof(value), "Scheduling cannot be null.");
99 }
100
127 public int Flag { get; set; }
128
137 public IList<AnkiReviewLog> ReviewHistory { get; } = new List<AnkiReviewLog>();
138}
int Flag
Gets or sets the single user-visible color flag attached to this card.
Definition AnkiCard.cs:127
AnkiCard(long id, long noteId, long deckId, int templateOrdinal, AnkiScheduling scheduling)
Initializes an unattached card for an importer or format adapter.
Definition AnkiCard.cs:45
IList< AnkiReviewLog > ReviewHistory
Gets answer events associated with this card.
Definition AnkiCard.cs:137
long NoteId
Gets the ID of the note whose fields and template render this card.
Definition AnkiCard.cs:66
int TemplateOrdinal
Gets which template or Cloze deletion generated this card.
Definition AnkiCard.cs:85
long DeckId
Gets or sets the deck in which Anki should place this individual card.
Definition AnkiCard.cs:75
long Id
Gets the persisted identity Anki uses to distinguish this card from every other card.
Definition AnkiCard.cs:62
AnkiScheduling Scheduling
Gets or replaces the complete persisted scheduler state for this card.
Definition AnkiCard.cs:96
Preserves the current scheduler state stored on one card without running Anki's scheduler.