本文整理汇总了C#中Bundle.Process方法的典型用法代码示例。如果您正苦于以下问题:C# Bundle.Process方法的具体用法?C# Bundle.Process怎么用?C# Bundle.Process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bundle
的用法示例。
在下文中一共展示了Bundle.Process方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateBundleInitializationAction
Action CreateBundleInitializationAction(Bundle bundle, XElement containerElement)
{
var bundleElement = GetBundleElement(bundle, containerElement);
if (bundleElement == null) return null;
var hash = GetHash(bundleElement);
if (hash == null) return null;
var filename = BundleAssetCacheFilename(bundle);
var file = cacheDirectory.GetFile(filename);
if (bundle.Assets.Count > 0 && !file.Exists) return null;
var childAssets = bundle.Assets.ToArray();
var references = GetBundleReferences(bundleElement).ToArray();
return () =>
{
if (bundle.Assets.Count > 0)
{
bundle.Assets.Clear();
bundle.Assets.Add(new CachedAsset(file, hash, childAssets));
}
foreach (var reference in references)
{
bundle.AddReference(reference);
}
bundle.IsFromCache = true;
bundle.Process(settings);
};
}
示例2: ProcessSingleBundle
protected Bundle ProcessSingleBundle(IFileHelper fileHelper, IDirectory directory, List<Bundle> bundlesToSort,
Dictionary<string, string> uncachedToCachedFiles, Bundle bundle, AssignHash hasher)
{
Trace.Source.TraceInformation("Processing {0} {1}", bundle.GetType().Name, bundle.Path);
//need to process early to generate an accurate hash.
if (IsCompositeBundle(bundle))
{
bundle.Process(settings);
}
else
{
hasher.Process(bundle, settings);
}
var bundleKey = CassetteSettings.bundles.GetSafeString(Encoding.Default.GetString(bundle.Hash));
if (CassetteSettings.bundles.ContainsKey(fileHelper, directory, uncachedToCachedFiles, bundleKey, bundle))
{
bundle = CassetteSettings.bundles.GetBundle(fileHelper, directory, uncachedToCachedFiles, bundleKey, bundle);
bundlesToSort.Add(bundle);
}
else
{
var unprocessedAssetPaths = CassetteSettings.bundles.GetAssetPaths(bundle);
if (!IsCompositeBundle(bundle))
{
bundle.Process(settings);
}
CassetteSettings.bundles.AddBundle(fileHelper, uncachedToCachedFiles, bundleKey, bundle, unprocessedAssetPaths);
}
return bundle;
}