void IConfigurable.Configure(IConfiguration configuration, string path) { _traceFilter.ConfigureWith(configuration); _configurationRegistration = configuration.Register( path, cfg => { _configuration = cfg; _resourceManager.LocalResourcePath = cfg.LocalFilePath; }, new DocumenterConfiguration()); }
private Task DocumentConfiguration(IOwinContext context) { var document = GetResource("configuration.html"); document = document.Replace("{path}", _configuration.Path); document = document.Replace("{enabled}", _configuration.Enabled.ToString()); document = document.Replace("{requiredPermission}", _configuration.RequiredPermission ?? "<none>"); var defaultConfiguration = new DocumenterConfiguration(); document = document.Replace("{path.default}", defaultConfiguration.Path); document = document.Replace("{enabled.default}", defaultConfiguration.Enabled.ToString()); document = document.Replace("{requiredPermission.default}", defaultConfiguration.RequiredPermission ?? "<none>"); context.Response.ContentType = "text/html"; return(context.Response.WriteAsync(document)); }