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


C# MonoSymbolFile.AddCompileUnit方法代码示例

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


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

示例1: CompileUnitEntry

		public CompileUnitEntry(MonoSymbolFile file, SourceFileEntry source)
		{
			this.file = file;
			this.source = source;
			this.Index = file.AddCompileUnit(this);
			this.creating = true;
			this.namespaces = new List<NamespaceEntry>();
		}
开发者ID:FreshBirdZhe,项目名称:LSharp,代码行数:8,代码来源:CompileUnitEntry.cs

示例2: RewriteMdbFile

		public void RewriteMdbFile (string inputFile)
		{
			if (!settings.Quiet)
				Console.WriteLine ("Processing {0}", inputFile);
			var input = MonoSymbolFile.ReadSymbolFile (inputFile);

			var output = new MonoSymbolFile ();

			foreach (var s in input.Sources) {
				var newFileName = settings.FileNamesOnly
					? Path.Combine (Path.GetDirectoryName (s.FileName), settings.Replace (Path.GetFileName (s.FileName)))
					: settings.Replace (s.FileName);

				if (settings.Verbose)
					Console.WriteLine ("{0} -> {1}", s.FileName, newFileName);

				s.FileName = newFileName;
				output.AddSource (s);
			}

			foreach (var cu in input.CompileUnits) {
				cu.ReadAll ();
				output.AddCompileUnit (cu);
			}
		
			foreach (var m in input.Methods) {
				m.ReadAll ();
				output.AddMethod (m);
			}


			var mdbName = new FileInfo (inputFile).Name;
			var tmpMdb = Path.GetTempFileName ();
			var finalMdb = inputFile;
			if (settings.OutputDirectory != null)
				finalMdb = Path.Combine (settings.OutputDirectory, mdbName);

			using (var stream = new FileStream (tmpMdb, FileMode.Create)) {
				output.CreateSymbolFile (input.Guid, stream);
			}
			input.Dispose ();

			File.Delete (finalMdb);
			File.Move (tmpMdb, finalMdb);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:45,代码来源:mdbrebase.cs

示例3: MdbRebase

        static void MdbRebase(string mdbFile, string toRemove)
        {
            #if WINDOWS_BUILD
            Console.Error.WriteLine ("Warning: skipping MDB rebasing of {0} (not supported on Windows)", mdbFile);
            #else
            using (var input = MonoSymbolFile.ReadSymbolFile (mdbFile)) {
                var output = new MonoSymbolFile ();

                foreach (var source in input.Sources) {
                    source.FileName = Path.Combine (
                        Path.GetDirectoryName (source.FileName),
                        Path.GetFileName (source.FileName).Replace (toRemove, String.Empty)
                    );

                    output.AddSource (source);
                }

                foreach (var compileUnit in input.CompileUnits) {
                    compileUnit.ReadAll ();
                    output.AddCompileUnit (compileUnit);
                }

                foreach (var method in input.Methods) {
                    method.ReadAll ();
                    output.AddMethod (method);
                }

                var tmpMdb = Path.GetTempFileName ();

                using (var stream = new FileStream (tmpMdb, FileMode.Create))
                    output.CreateSymbolFile (input.Guid, stream);

                File.Delete (mdbFile);
                File.Move (tmpMdb, mdbFile);
            }
            #endif
        }
开发者ID:yudhitech,项目名称:xamarin-macios,代码行数:37,代码来源:Driver.cs


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