當前位置: 首頁>>代碼示例>>C#>>正文


C# MonoSymbolFile.CreateSymbolFile方法代碼示例

本文整理匯總了C#中Mono.CompilerServices.SymbolWriter.MonoSymbolFile.CreateSymbolFile方法的典型用法代碼示例。如果您正苦於以下問題:C# MonoSymbolFile.CreateSymbolFile方法的具體用法?C# MonoSymbolFile.CreateSymbolFile怎麽用?C# MonoSymbolFile.CreateSymbolFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mono.CompilerServices.SymbolWriter.MonoSymbolFile的用法示例。


在下文中一共展示了MonoSymbolFile.CreateSymbolFile方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RewriteMdbFile

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

		var output = new MonoSymbolFile ();

		foreach (var s in input.Sources) {
			s.FileName = settings.Replace (s.FileName);
			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.Combine (Path.GetTempPath (), mdbName);
		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);
		new FileInfo (tmpMdb).MoveTo (finalMdb);
	}
開發者ID:itguy327,項目名稱:mono,代碼行數:37,代碼來源:mdbrebase.cs

示例2: 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.CreateSymbolFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。