本文整理汇总了C#中IPackageLog.TrapErrors方法的典型用法代码示例。如果您正苦于以下问题:C# IPackageLog.TrapErrors方法的具体用法?C# IPackageLog.TrapErrors怎么用?C# IPackageLog.TrapErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPackageLog
的用法示例。
在下文中一共展示了IPackageLog.TrapErrors方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadConfig
public void ReadConfig(IFubuFile config, IPackageLog log)
{
_diagnostics.SetCurrentProvenance(config.Provenance);
var reader = new SharingDslReader(_diagnostics);
log.Trace(" Reading sharing directives from {0}", config.ToString());
log.TrapErrors(() => config.ReadLines(text =>
{
if (text.Trim().IsEmpty()) return;
log.TrapErrors(() => reader.ReadLine(text, config.Provenance));
}));
}
示例2: ReadFile
public void ReadFile(string file, IPackageLog log)
{
var reader = new AssetDslReader(_assets);
log.Trace(" Reading script directives from {0}", file);
log.TrapErrors(() =>
{
_fileSystem.ReadTextFile(file, text =>
{
if (text.Trim().IsEmpty()) return;
log.TrapErrors(() => reader.ReadLine(text));
});
});
}
示例3: ReadFile
public void ReadFile(string provenance, string file, IPackageLog log)
{
_diagnostics.SetCurrentProvenance(provenance);
var reader = new SharingDslReader(_diagnostics);
log.Trace(" Reading spark directives from {0}", file);
log.TrapErrors(() => _fileSystem.ReadTextFile(file, text =>
{
if (text.Trim().IsEmpty())
{
return;
}
log.TrapErrors(() => reader.ReadLine(text, provenance));
}));
}
示例4: Precompile
public void Precompile(IPackageLog log)
{
Parallel.ForEach(nonNativePartialDescriptors(), vd=> log.TrapErrors(() => {
var def = vd.ToViewDefinition();
_providerCache.GetViewEntry(def.ViewDescriptor);
_providerCache.GetViewEntry(def.PartialDescriptor);
}));
}
示例5: ReadFile
public void ReadFile(string file, IPackageLog log)
{
_diagnostics.SetCurrentProvenance(file);
var reader = new AssetDslReader(_diagnostics);
_configurationFiles.Fill(file.ToFullPath());
log.Trace(" Reading script directives from {0}", file);
log.TrapErrors(() =>
{
_fileSystem.ReadTextFile(file, text =>
{
if (text.Trim().IsEmpty()) return;
log.TrapErrors(() => reader.ReadLine(text));
});
});
}