示例#1
0
        public static AssetOutputFile Create(IAssetFile from, byte[] content, AssetHeader meta = null, string extension = null)
        {
            var name = extension == null
                ? new FileInfo(from.FullName)
                : new FileInfo(Path.ChangeExtension(from.FullName, extension));

            var head = meta == null
                ? from.Meta
                : meta;

            return(new AssetOutputFile(
                       from.Project,
                       name,
                       head,
                       content
                       ));
        }
示例#2
0
 public static AssetOutputFile Create(IAssetFile from, string content, AssetHeader meta = null, string extension = null)
 {
     return(Create(from, Encoding.UTF8.GetBytes(content), meta, extension));
 }
示例#3
0
 public static AssetOutputFile Create(IAssetFile from, MemoryStream content, AssetHeader meta = null, string extension = null)
 {
     return(Create(from, content.ToArray(), meta, extension));
 }
示例#4
0
 /// <summary>
 /// Constructs a new file wrapper around a file info.
 /// </summary>
 /// <param name="file">The file info to wrap.</param>
 /// <param name="meta">The metadata associated with the output file.</param>
 /// <param name="project">The project of this file.</param>
 /// <param name="content">The content of the output file.</param>
 public AssetOutputFile(SiteProject project, FileInfo file, AssetHeader meta, byte[] content)
     : base(project, file)
 {
     this.CachedContent = content;
     this.Meta          = meta;
 }