/// <summary> /// Writes a single atom. /// </summary> /// <param name="atom"></param> public void EnterAtom(AtomType atom) { _jsonWriter.WriteStartArray(); _jsonWriter.WriteValue(atom.Name); _jsonWriter.WriteValue(atom.Text); atom.Payload.WriteTo(_jsonWriter); }
/// <summary> /// Finalizes writing an atom. /// </summary> /// <param name="atom"></param> public void ExitAtom(AtomType atom) { _jsonWriter.WriteEndArray(); }
/// <summary> /// Checks whether an atom type can be rendered with this renderer. /// </summary> /// <param name="atomType">Atom type to render.</param> /// <returns>Returns <c>true</c> when the atom type can be rendered; Otherwise <c>false</c>.</returns> public abstract bool CanRender(AtomType atomType);
/// <summary> /// Renders the provided atom type and appends the output to the provided parent element. /// </summary> /// <param name="parentElement">parent element to render in.</param> /// <param name="atomType">Atom type to render.</param> public abstract void Render(HtmlNode parentElement, AtomType atomType);
public virtual void ExitAtom(AtomType atom) { }
public virtual void EnterAtom(AtomType atom) { }