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