本文整理汇总了C#中IResource.GetContent方法的典型用法代码示例。如果您正苦于以下问题:C# IResource.GetContent方法的具体用法?C# IResource.GetContent怎么用?C# IResource.GetContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IResource
的用法示例。
在下文中一共展示了IResource.GetContent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDependencies
public IEnumerable<string> GetDependencies(IResource resource)
{
var matches = _referenceRegex.Matches(resource.GetContent());
return (from match in matches.Cast<Match>()
let virtualPath = ParseReferenceElement(match.Groups[1].Value, resource)
where !String.IsNullOrEmpty(virtualPath)
select virtualPath).ToList();
}
示例2: CompileResource
public ICompiledResource CompileResource(IResource resource)
{
var contentFilterPipeline = _contentFilterPipelineMap.GetPipelineForExtension(resource.FileExtension);
var contentFilterContext = new ContentFilterContext
{
Minify = _resourceMode == ResourceMode.Release, //TODO: obey global Minify settings
ResourceVirtualPath = resource.VirtualPath
};
var compiledContent = contentFilterPipeline.FilterContent(resource.GetContent(), contentFilterContext);
return new IndividuallyCompiledResource
{
Resource = resource,
Mode = _resourceMode,
CompiledContent = compiledContent
};
}
示例3: GetDependencies
public IEnumerable<string> GetDependencies(IResource resource)
{
return from match in _dependencyRegex.Matches(resource.GetContent()).Cast<Match>()
where match.Success
select ToCanonicalPath(match.Groups[1].Value, resource);
}