Exemplo n.º 1
0
        public static TmdRenderOptions FromResource(ResourceManager rm)
        {
            if (rm == null)
            {
                throw new ArgumentNullException(nameof(rm));
            }

            // Create default options
            var options = new TmdRenderOptions();

            // Load templates from resource if present
            options.DownloadTemplate    = rm.GetString("DownloadTemplate") ?? options.DownloadTemplate;
            options.InformationTemplate = rm.GetString("InformationTemplate") ?? options.InformationTemplate;
            options.NamedStepTemplate   = rm.GetString("NamedStepTemplate") ?? options.NamedStepTemplate;
            options.StepLinkTemplate    = rm.GetString("StepLinkTemplate") ?? options.StepLinkTemplate;
            options.StepTemplate        = rm.GetString("StepTemplate") ?? options.StepTemplate;
            options.TableBeginTemplate  = rm.GetString("TableBeginTemplate") ?? options.TableBeginTemplate;
            options.TableEndTemplate    = rm.GetString("TableEndTemplate") ?? options.TableEndTemplate;
            options.WarningTemplate     = rm.GetString("WarningTemplate") ?? options.WarningTemplate;

            return(options);
        }
Exemplo n.º 2
0
 public TmdParser(TmdParserOptions parserOptions = null, TmdRenderOptions renderOptions = null)
 {
     this.parserOptions = parserOptions ?? new TmdParserOptions();
     this.renderOptions = renderOptions ?? new TmdRenderOptions();
 }