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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public virtual bool Accept(RendererBase renderer, MarkdownObject obj)
 {
     return(obj is TObject);
 }
 public bool Accept(RendererBase renderer, Type objectType)
 {
     return(typeof(TObject).IsAssignableFrom(objectType));
 }