本文整理汇总了C#中IPackageLog.MarkFailure方法的典型用法代码示例。如果您正苦于以下问题:C# IPackageLog.MarkFailure方法的具体用法?C# IPackageLog.MarkFailure怎么用?C# IPackageLog.MarkFailure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPackageLog
的用法示例。
在下文中一共展示了IPackageLog.MarkFailure方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Activate
public void Activate(IEnumerable<IPackageInfo> packages, IPackageLog log)
{
log.Trace("Trying to resolve chains to the navigation graph");
_graph.Navigation.AllNodes().OfType<MenuNode>().Each(x =>
{
try
{
x.Resolve(_resolver);
}
catch (Exception ex)
{
log.MarkFailure("Failed to resolve a BehaviorChain for navigation element " + x.Key);
log.MarkFailure(ex);
}
});
}
示例2: Check
public void Check(IPackageLog log)
{
if (Directory.Exists(_folder))
{
log.Trace(SuccessMessage, _folder);
}
else
{
log.MarkFailure(FailureMessage, _folder);
}
}
示例3: checkCertificates
private void checkCertificates(ISamlCertificateRepository repository, IPackageLog log)
{
var loader = _services.GetInstance<ICertificateLoader>();
repository.AllKnownCertificates().Each(samlCertificate => {
try
{
var certificate = loader.Load(samlCertificate.Thumbprint);
if (certificate == null)
{
log.MarkFailure("Could not load Certificate for Issuer " + samlCertificate.Issuer);
}
}
catch (Exception ex)
{
log.MarkFailure("Could not load Certificate for Issuer " + samlCertificate.Issuer);
log.MarkFailure(ex);
}
});
}
示例4: Check
public void Check(IPackageLog log)
{
if (File.Exists(_file))
{
log.Trace(SuccessMessage, _file);
}
else
{
log.MarkFailure(FailureMessage, _file);
}
}
示例5: Check
public void Check(IPackageLog log)
{
WasCalled = true;
if (!_success)
{
log.MarkFailure(_message);
}
else
{
log.Trace(_message);
}
}
示例6: Activate
public void Activate(IEnumerable<IPackageInfo> packages, IPackageLog log)
{
_jobs.Where(x => x.ScheduledExecution != ScheduledExecution.Disabled).Each(x => {
try
{
log.Trace("Starting " + x.JobType.GetFullName());
x.Start();
}
catch (Exception ex)
{
log.MarkFailure(ex);
}
});
}
示例7: Activate
public void Activate(IEnumerable<IPackageInfo> packages, IPackageLog log)
{
_jobs.Each(x => {
try
{
log.Trace("Starting " + Description.For(x).Title);
x.Start();
}
catch (Exception ex)
{
log.MarkFailure(ex);
}
});
}
示例8: Check
public void Check(IPackageLog log)
{
var file = _folder.AppendPath(TracerFile);
try
{
var system = new FileSystem();
system.WriteStringToFile(file, "just a test of whether or not a process can write to a folder");
system.DeleteFile(file);
log.Trace(SuccessMessage.ToFormat(_folder));
}
catch (Exception)
{
log.MarkFailure(FailureMessage.ToFormat(_folder));
}
}
示例9: WithLog
public static void WithLog(IPackageLog log, Action action)
{
_status.PushLog(log);
try
{
log.Execute(action);
}
catch (Exception ex)
{
log.MarkFailure(ex);
}
finally
{
_status.PopLog();
}
}
示例10: Deactivate
public void Deactivate(IPackageLog log)
{
_latch.Latched = true;
_jobs.Each(x => {
try
{
x.Stop();
}
catch (Exception ex)
{
Console.WriteLine(ex);
log.MarkFailure(ex);
}
});
}
示例11: startTheEnvironment
private static void startTheEnvironment(IList<LogEntry> list, IEnvironment environment, IPackageLog log, params Action<IInstaller, IPackageLog>[] actions)
{
try
{
var installers = environment.StartUp(log);
// This needs to happen regardless, but we want these logs put in before
// logs for the installers, so we don't do it in the finally{}
addPackagingLogEntries(list);
executeInstallers(list, installers, actions);
}
catch (Exception ex)
{
addPackagingLogEntries(list);
log.MarkFailure(ex.ToString());
}
finally
{
list.Add(LogEntry.FromPackageLog(environment, log));
environment.SafeDispose();
}
}
示例12: StartUp
public IEnumerable<IInstaller> StartUp(IPackageLog log)
{
log.MarkFailure("I found a problem in StartUp");
return new IInstaller[0];
}
示例13: Install
public override void Install(IPackageLog log)
{
log.MarkFailure("I detected a problem during Install");
}
示例14: CheckEnvironment
public override void CheckEnvironment(IPackageLog log)
{
log.MarkFailure("I detected a problem during CheckEnvironment");
}