当前位置: 首页>>代码示例>>C#>>正文


C# LoggerResult.CopyTo方法代码示例

本文整理汇总了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);
                }
            }
        }
开发者ID:Powerino73,项目名称:paradox,代码行数:39,代码来源:AssemblyContainer.cs

示例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;
        }
开发者ID:jiangzi,项目名称:paradox,代码行数:25,代码来源:PackageBuilder.cs

示例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;
        }
开发者ID:hck509,项目名称:paradox,代码行数:25,代码来源:PackageBuilder.cs


注:本文中的LoggerResult.CopyTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。