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


C# Compiler.TempFileCollection类代码示例

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


TempFileCollection类属于System.CodeDom.Compiler命名空间,在下文中一共展示了TempFileCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ManagedProjectReference

        public ManagedProjectReference(XmlElement xmlDefinition, ReferencesResolver referencesResolver, ProjectBase parent, SolutionBase solution, TempFileCollection tfc, GacCache gacCache, DirectoryInfo outputDir)
            : base(referencesResolver, parent)
        {
            if (xmlDefinition == null) {
                throw new ArgumentNullException("xmlDefinition");
            }
            if (solution == null) {
                throw new ArgumentNullException("solution");
            }
            if (tfc == null) {
                throw new ArgumentNullException("tfc");
            }
            if (gacCache == null) {
                throw new ArgumentNullException("gacCache");
            }

            XmlAttribute privateAttribute = xmlDefinition.Attributes["Private"];
            if (privateAttribute != null) {
                _isPrivateSpecified = true;
                _isPrivate = bool.Parse(privateAttribute.Value);
            }

            // determine path of project file
            string projectFile = solution.GetProjectFileFromGuid(
                xmlDefinition.GetAttribute("Project"));

            // load referenced project
            _project = LoadProject(solution, tfc, gacCache, outputDir, projectFile);
        }
开发者ID:smaclell,项目名称:NAnt,代码行数:29,代码来源:ManagedProjectReference.cs

示例2: ExecWaitWithCapture

		[SecurityPermission (SecurityAction.Assert, ControlPrincipal = true)] // UnmanagedCode "covers" more than ControlPrincipal
		public static Int32 ExecWaitWithCapture (IntPtr userToken, string cmd, string currentDir, TempFileCollection tempFiles, ref string outputName, ref string errorName)
		{
			// WindowsImpersonationContext implements IDisposable only in 2.0
			using (WindowsImpersonationContext context = WindowsIdentity.Impersonate (userToken)) {
				return InternalExecWaitWithCapture (cmd, currentDir, tempFiles, ref outputName, ref errorName);
			}
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:Executor.cs

示例3: Execute

        public static string Execute(string strCmd, bool bDropFirstLineOfOutput)
        {
            string output = "";
            string error  = "";

            TempFileCollection tf = new TempFileCollection();
            Executor.ExecWaitWithCapture(strCmd, tf, ref output, ref error);

            StreamReader sr = File.OpenText(output);
            StringBuilder strBuilder = new StringBuilder();
            string strLine = null;
            bool bFirstLine = true;

            while (null != (strLine = sr.ReadLine()))
            {
                if ("" != strLine)
                {
                    if (bFirstLine && bDropFirstLineOfOutput)
                    {
                        bFirstLine = false;
                        continue;
                    }
                    strBuilder.Append(strLine);
                    strBuilder.Append("\r\n");
                }
            }
            sr.Close();

            File.Delete(output);
            File.Delete(error);

            return strBuilder.ToString();
        }
开发者ID:AlexZeitler,项目名称:SharpDevelop-Servers,代码行数:33,代码来源:SilentCmdLineApplication.cs

示例4: ViewLog

 public void ViewLog()
 {
     TempFileCollection tempFiles = new TempFileCollection();
     FileInfo msgFile = new FileInfo(tempFiles.AddExtension("txt"));
     File.WriteAllText(msgFile.FullName, Session.Log, Encoding.ASCII);
     Process.Start(msgFile.FullName);
 }
开发者ID:LiDamon,项目名称:smtp4dev,代码行数:7,代码来源:SessionViewModel.cs

示例5: FileLoggerTest

 public void FileLoggerTest()
 {
     var tfc = new TempFileCollection();
     var fileName = tfc.AddExtension("txt");
     var logger = LoggerFactory.Instance.GetLogger(LogType.File, fileName);
     logger.Log(TEST_LOG);
 }
开发者ID:solarplexus6,项目名称:Oop,代码行数:7,代码来源:Zad1Test.cs

示例6: Ctor_Empty

 public void Ctor_Empty()
 {
     var collection = new TempFileCollection();
     Assert.Equal(0, collection.Count);
     Assert.Empty(collection.TempDir);
     Assert.False(collection.KeepFiles);
 }
开发者ID:dotnet,项目名称:corefx,代码行数:7,代码来源:TempFileCollectionTests.cs

示例7: FixtureSetUp

		public void FixtureSetUp ()
		{
			// at full trust
			temps = new TempFileCollection ();
			assembly = Assembly.GetExecutingAssembly ();
			path = assembly.Location;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:CompilerResultsCas.cs

示例8: Ctor_String

 public void Ctor_String(string tempDir)
 {
     var collection = new TempFileCollection(tempDir);
     Assert.Equal(0, collection.Count);
     Assert.Equal(tempDir ?? string.Empty, collection.TempDir);
     Assert.False(collection.KeepFiles);
 }
开发者ID:dotnet,项目名称:corefx,代码行数:7,代码来源:TempFileCollectionTests.cs

示例9: ProjectBase

        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectBase" /> class.
        /// </summary>
        protected ProjectBase(XmlElement xmlDefinition, SolutionTask solutionTask, TempFileCollection temporaryFiles, GacCache gacCache, ReferencesResolver referencesResolver, DirectoryInfo outputDir) {
            if (xmlDefinition == null) {
                throw new ArgumentNullException("xmlDefinition");
            }
            if (solutionTask == null) {
                throw new ArgumentNullException("solutionTask");
            }
            if (temporaryFiles == null) {
                throw new ArgumentNullException("temporaryFiles");
            }
            if (gacCache == null) {
                throw new ArgumentNullException("gacCache");
            }
            if (referencesResolver == null) {
                throw new ArgumentNullException("referencesResolver");
            }

            _projectConfigurations = new ConfigurationDictionary();
            _buildConfigurations = new ConfigurationDictionary();
            _extraOutputFiles = CollectionsUtil.CreateCaseInsensitiveHashtable();

            // ensure the specified project is actually supported by this project
            VerifyProjectXml(xmlDefinition);

            _solutionTask = solutionTask;
            _temporaryFiles = temporaryFiles;
            _outputDir = outputDir;
            _gacCache = gacCache;
            _refResolver = referencesResolver;
            _productVersion = DetermineProductVersion(xmlDefinition);
        }
开发者ID:RoastBoy,项目名称:nant,代码行数:34,代码来源:ProjectBase.cs

示例10: Ctor_String_Bool

 public void Ctor_String_Bool(string tempDir, bool keepFiles)
 {
     var collection = new TempFileCollection(tempDir, keepFiles);
     Assert.Equal(0, collection.Count);
     Assert.Equal(tempDir ?? string.Empty, collection.TempDir);
     Assert.Equal(keepFiles, collection.KeepFiles);
 }
开发者ID:dotnet,项目名称:corefx,代码行数:7,代码来源:TempFileCollectionTests.cs

示例11: FileSerializeMatchesLength

		public void FileSerializeMatchesLength() {
			using (TempFileCollection tfc = new TempFileCollection()) {
				string file = tfc.AddExtension(".txt");
				File.WriteAllText(file, "sometext");
				var part = MultipartPostPart.CreateFormFilePart("someformname", file, "text/plain");
				VerifyLength(part);
			}
		}
开发者ID:SachiraChin,项目名称:dotnetopenid,代码行数:8,代码来源:MultipartPostPartTests.cs

示例12: Compilador

 public Compilador( string directorio, string nombre, string archivoSalida, string archivoError )
 {
     archivosTemporales = new TempFileCollection();
     this.directorio = directorio;
     this.nombre = nombre;
     this.archivoSalida = archivoSalida;
     this.archivoError = archivoError;
 }
开发者ID:Erikhht,项目名称:tuassembler,代码行数:8,代码来源:Compilador.cs

示例13: SolutionBase

 protected SolutionBase(SolutionTask solutionTask, TempFileCollection tfc, GacCache gacCache, ReferencesResolver refResolver) : this(tfc, solutionTask) {
     if (solutionTask.SolutionFile != null) {
         _file = solutionTask.SolutionFile;
     } else {
         LoadProjectGuids(new ArrayList(solutionTask.Projects.FileNames), false);
         LoadProjectGuids(new ArrayList(solutionTask.ReferenceProjects.FileNames), true);
         LoadProjects(gacCache, refResolver, CollectionsUtil.CreateCaseInsensitiveHashtable());
     }
 }
开发者ID:RoastBoy,项目名称:nant,代码行数:9,代码来源:SolutionBase.cs

示例14: MultiPartPostAscii

		public void MultiPartPostAscii() {
			using (TempFileCollection tfc = new TempFileCollection()) {
				string file = tfc.AddExtension("txt");
				File.WriteAllText(file, "sometext");
				this.VerifyFullPost(new List<MultipartPostPart> {
					MultipartPostPart.CreateFormPart("a", "b"),
					MultipartPostPart.CreateFormFilePart("SomeFormField", file, "text/plain"),
				});
			}
		}
开发者ID:SachiraChin,项目名称:dotnetopenid,代码行数:10,代码来源:MultipartPostPartTests.cs

示例15: MetaData

 public void MetaData()
 {
     string SAVfilename;
     using (System.CodeDom.Compiler.TempFileCollection tfc = new System.CodeDom.Compiler.TempFileCollection())
     {
         SAVfilename = tfc.AddExtension("sav", true);
         SpssConvert.ToFile(tblTest, tblTest.Select(), SAVfilename, FillInMetaData);
         Console.WriteLine("The file with metadata is stored at: " + SAVfilename);
     }
 }
开发者ID:WMichta,项目名称:SPSS.NET,代码行数:10,代码来源:SpssConvertTest.cs


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