public virtual void Write(RendererBase renderer, MarkdownObject obj) { var htmlRenderer = (TRenderer)renderer; var typedObj = (TObject)obj; if (_tryWriters is not null && TryWrite(htmlRenderer, typedObj)) { return; } Write(htmlRenderer, typedObj); }
public virtual void Write(RendererBase renderer, MarkdownObject obj) { var htmlRenderer = (TRenderer)renderer; var typedObj = (TObject)obj; // Try processing for (int i = 0; i < TryWriters.Count; i++) { var tryWriter = TryWriters[i]; if (tryWriter(htmlRenderer, typedObj)) { return; } } Write(htmlRenderer, typedObj); }
public virtual bool Accept(RendererBase renderer, MarkdownObject obj) { return(obj is TObject); }
public bool Accept(RendererBase renderer, Type objectType) { return(typeof(TObject).IsAssignableFrom(objectType)); }