本文整理汇总了C#中LoggerResult.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# LoggerResult.CopyTo方法的具体用法?C# LoggerResult.CopyTo怎么用?C# LoggerResult.CopyTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LoggerResult
的用法示例。
在下文中一共展示了LoggerResult.CopyTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadAssemblyFromPath
public Assembly LoadAssemblyFromPath(string assemblyFullPath, ILogger outputLog = null, List<string> lookupDirectoryList = null)
{
if (assemblyFullPath == null) throw new ArgumentNullException("assemblyFullPath");
log = new LoggerResult();
lookupDirectoryList = lookupDirectoryList ?? new List<string>();
assemblyFullPath = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, assemblyFullPath));
var assemblyDirectory = Path.GetDirectoryName(assemblyFullPath);
if (assemblyDirectory == null || !Directory.Exists(assemblyDirectory))
{
throw new ArgumentException("Invalid assembly path. Doesn't contain directory information");
}
if (!lookupDirectoryList.Contains(assemblyDirectory, StringComparer.InvariantCultureIgnoreCase))
{
lookupDirectoryList.Add(assemblyDirectory);
}
var previousLookupList = searchDirectoryList;
try
{
loadingInstance = this;
searchDirectoryList = lookupDirectoryList;
return LoadAssemblyFromPathInternal(assemblyFullPath);
}
finally
{
loadingInstance = null;
searchDirectoryList = previousLookupList;
if (outputLog != null)
{
log.CopyTo(outputLog);
}
}
}
示例2: BuildGetGraphicsPlatform
private BuildResultCode BuildGetGraphicsPlatform()
{
var localLogger = new LoggerResult();
var simplePackage = Package.Load(localLogger, builderOptions.PackageFile, new PackageLoadParameters { AutoLoadTemporaryAssets = false, LoadAssemblyReferences = false, AutoCompileProjects = false });
if (simplePackage == null
|| localLogger.HasErrors)
{
localLogger.CopyTo(builderOptions.Logger);
return BuildResultCode.BuildError;
}
var buildProfile = simplePackage.Profiles.FirstOrDefault(pair => pair.Name == builderOptions.BuildProfile);
if (buildProfile == null)
{
builderOptions.Logger.Error("Package {0} did not contain platform {1}", builderOptions.PackageFile, builderOptions.BuildProfile);
return BuildResultCode.BuildError;
}
// For now, graphics platform is implicit.
// It will need to be readded to GameSettingsAsset at some point.
var graphicsPlatform = builderOptions.Platform.GetDefaultGraphicsPlatform();
Console.WriteLine(graphicsPlatform);
return BuildResultCode.Successful;
}
示例3: BuildGetGraphicsPlatform
private BuildResultCode BuildGetGraphicsPlatform()
{
var localLogger = new LoggerResult();
var simplePackage = Package.Load(localLogger, builderOptions.PackageFile, new PackageLoadParameters { AutoLoadTemporaryAssets = false, LoadAssemblyReferences = false, AutoCompileProjects = false });
if (simplePackage == null
|| localLogger.HasErrors)
{
localLogger.CopyTo(builderOptions.Logger);
return BuildResultCode.BuildError;
}
var buildProfile = simplePackage.Profiles.FirstOrDefault(pair => pair.Name == builderOptions.BuildProfile);
if (buildProfile == null)
{
builderOptions.Logger.Error("Package {0} did not contain platform {1}", builderOptions.PackageFile, builderOptions.BuildProfile);
return BuildResultCode.BuildError;
}
var graphicsPlatform = buildProfile.Properties.ContainsKey(ParadoxConfig.GraphicsPlatform)
? buildProfile.Properties.Get(ParadoxConfig.GraphicsPlatform)
: builderOptions.GetDefaultGraphicsPlatform();
Console.WriteLine(graphicsPlatform);
return BuildResultCode.Successful;
}