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


C# CompilerParameters.ToString方法代码示例

本文整理汇总了C#中System.CodeDom.Compiler.CompilerParameters.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# CompilerParameters.ToString方法的具体用法?C# CompilerParameters.ToString怎么用?C# CompilerParameters.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.CodeDom.Compiler.CompilerParameters的用法示例。


在下文中一共展示了CompilerParameters.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CompileAssemblyFromFileBatch

        public CompilerResults CompileAssemblyFromFileBatch(CompilerParameters options, string[] fileNames)
        {
            //System.Diagnostics.Debug.Assert(false);
            foreach (string file in fileNames)
                if (file.ToLower().EndsWith(".xaml"))
                    return CompileAssemblyFromFileBatchImpl(options, fileNames);

            if (options.ToString() == "" || options == null)
                return new CSharpCodeProvider().CreateCompiler().CompileAssemblyFromFileBatch(options, fileNames);
            else
                return new CSharpCodeProvider(new Dictionary<string, string>() { { "CompilerVersion", options.ToString() } }).CreateCompiler().CompileAssemblyFromFileBatch(options, fileNames);
        }
开发者ID:oleg-shilo,项目名称:cs-script,代码行数:12,代码来源:xamlcompiler.cs

示例2: CompileAssemblyFromFileBatch

		public CompilerResults CompileAssemblyFromFileBatch(CompilerParameters options, string[] fileNames)
		{
			string tempFile;
			ArrayList classlessFiles = new ArrayList(); 
			ArrayList files = new ArrayList();
			int count = 0;
			CCSharpParser ccs;
			foreach (string file in fileNames)
			{
				ccs = new CCSharpParser(file);
				if (!ccs.isClassless)
				{
					files.Add(file);
				}
				else
				{
					tempFile = ccs.ToTempFile(count > 0 );
					classlessFiles.Add(tempFile);
					files.Add(tempFile);
				}
				count++;
			}
			
            Microsoft.CSharp.CSharpCodeProvider provider;

            if (options.ToString() == "" || options == null)
                return new Microsoft.CSharp.CSharpCodeProvider().CreateCompiler().CompileAssemblyFromFileBatch(options, fileNames);
            else
                return new Microsoft.CSharp.CSharpCodeProvider(new Dictionary<string, string>() { { "CompilerVersion", options.ToString() } }).CreateCompiler().CompileAssemblyFromFileBatch(options, fileNames);

            CompilerResults retval;
            retval = provider.CreateCompiler().CompileAssemblyFromFileBatch(options, (string[])files.ToArray(typeof(string)));
			
			
			if (!retval.Errors.HasErrors)
				foreach (string file in classlessFiles)
					try
					{ 
						File.Delete(file);
					} 
					catch{}

			return retval;
		}
开发者ID:oleg-shilo,项目名称:cs-script,代码行数:44,代码来源:ccscompiler.cs

示例3: CompilationException

        public CompilationException(
            CodeDomProvider provider,
            CompilerParameters parameters,
            CompilerResults results,
            params String[] sources
            )
        {
            StringWriter sw = new StringWriter();
            sw.WriteLine("Compilation:  {0} errors", results.Errors.Count);
            sw.WriteLine("Compiler: {0}", provider.FileExtension);
            sw.WriteLine("CompilerParameters: {0}", parameters.ToString());
            foreach (CompilerError error in results.Errors)
            {
                sw.WriteLine(error.ToString());
            }
            sw.WriteLine("Sources:");
            foreach (string source in sources)
                sw.WriteLine(source);

            this.body = sw.ToString();
        }
开发者ID:sayedjalilhassan,项目名称:LearningPlatform,代码行数:21,代码来源:CompilationException.cs

示例4: CompilationException

        public CompilationException(
            ICodeCompiler compiler,
            CompilerParameters parameters,
            CompilerResults results,
            params String[] sources
            )
        {
            StringWriter sw = new StringWriter();
            sw.WriteLine("Compilation:  {0} errors",results.Errors.Count);
            sw.WriteLine("Compiler: {0}",compiler.GetType().Name);
            sw.WriteLine("CompilerParameters: {0}",parameters.ToString());
            foreach(CompilerError error in results.Errors)
            {
                sw.WriteLine(error.ToString());
            }
            sw.WriteLine("Sources:");
            foreach(string source in sources)
                sw.WriteLine(source);

            this.message =sw.ToString();
        }
开发者ID:BackupTheBerlios,项目名称:mbunit-svn,代码行数:21,代码来源:CompilationException.cs


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