• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Assemblies.TargetRuntime类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Initialize

		internal void Initialize ()
		{
			CreateFrameworks ();
			runtimes = new List<TargetRuntime> ();
			foreach (ITargetRuntimeFactory factory in AddinManager.GetExtensionObjects ("/MonoDevelop/Core/Runtimes", typeof(ITargetRuntimeFactory))) {
				foreach (TargetRuntime runtime in factory.CreateRuntimes ()) {
					runtimes.Add (runtime);
					if (runtime.IsRunning)
						DefaultRuntime = CurrentRuntime = runtime;
				}
			}
			
			// Don't initialize until Current and Default Runtimes are set
			foreach (TargetRuntime runtime in runtimes) {
				runtime.Initialized += HandleRuntimeInitialized;
			}

			if (CurrentRuntime == null)
				LoggingService.LogFatalError ("Could not create runtime info for current runtime");

			CurrentRuntime.StartInitialization ();
			
			LoadUserAssemblyContext ();
			userAssemblyContext.Changed += delegate {
				SaveUserAssemblyContext ();
			};
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:27,代码来源:SystemAssemblyService.cs


示例2: CanDebugRuntime

		public static bool CanDebugRuntime (TargetRuntime runtime)
		{
			var mrun = runtime as MonoTargetRuntime;
			if (mrun == null)
				return false;
			
			return mrun.AssemblyContext.GetAssemblyLocation ("Mono.Debugger.Soft", null) != null;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:8,代码来源:SoftDebuggerEngine.cs


示例3: MonoMacExecutionCommand

		public MonoMacExecutionCommand (TargetRuntime runtime, TargetFramework framework, FilePath appPath, 
		                                FilePath launchScript, bool debugMode)
		{
			this.AppPath = appPath;
			this.LaunchScript = launchScript;
			this.Framework = framework;
			this.Runtime = runtime;
			this.DebugMode = debugMode;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:9,代码来源:MonoMacExecutionCommand.cs


示例4: MonoDroidExecutionCommand

		public MonoDroidExecutionCommand (string packageName, FilePath apkPath,
			TargetRuntime runtime, TargetFramework framework, bool debugMode)
		{
			this.PackageName = packageName;
			this.ApkPath = apkPath;
			this.Runtime = runtime;
			this.Framework = framework;
			this.DebugMode = debugMode;
			
			DebugPort = MonoDroidSettings.DebuggerPort;
			OutputPort = MonoDroidSettings.DebuggerOutputPort;
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:12,代码来源:MonoDroidExecutionCommand.cs


示例5: GetSystemWebDom

		static ICompilation GetSystemWebDom (TargetRuntime runtime, TargetFramework targetFramework)
		{
			string file = runtime.AssemblyContext.GetAssemblyNameForVersion (sysWebAssemblyName, targetFramework);
			if (string.IsNullOrEmpty (file))
				throw new Exception ("System.Web assembly name not found for framework " + targetFramework.Id);
			file = runtime.AssemblyContext.GetAssemblyLocation (file, targetFramework);
			if (string.IsNullOrEmpty (file))
				throw new Exception ("System.Web assembly file not found for framework " + targetFramework.Id);
			var dom = new SimpleCompilation (TypeSystemService.LoadAssemblyContext (runtime, targetFramework, file));
			if (dom == null)
				throw new Exception ("System.Web parse database not found for framework " + targetFramework.Id + " file '" + file + "'");
			return dom;
		}
开发者ID:head-thrash,项目名称:monodevelop,代码行数:13,代码来源:WebTypeManager.cs


示例6: IPhoneExecutionCommand

		public IPhoneExecutionCommand (TargetRuntime runtime, TargetFramework framework, FilePath appPath, 
		                               FilePath logDirectory, bool debugMode, IPhoneSimulatorTarget target, 
		                               IPhoneSdkVersion minimumOSVersion, TargetDevice supportedDevices)
		{
			this.AppPath = appPath;
			this.LogDirectory = logDirectory;
			this.Framework = framework;
			this.Runtime = runtime;
			this.DebugMode = debugMode;
			this.SimulatorTarget = target;
			this.MinimumOSVersion = minimumOSVersion;
			this.SupportedDevices = supportedDevices;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:13,代码来源:IPhoneExecutionCommand.cs


示例7: GetSystemWebDom

		static ProjectDom GetSystemWebDom (TargetRuntime runtime, TargetFramework targetFramework)
		{
			string file = runtime.AssemblyContext.GetAssemblyNameForVersion (sysWebAssemblyName, targetFramework);
			if (string.IsNullOrEmpty (file))
				throw new Exception ("System.Web assembly name not found for framework " + targetFramework.Id);
			file = runtime.AssemblyContext.GetAssemblyLocation (file, targetFramework);
			if (string.IsNullOrEmpty (file))
				throw new Exception ("System.Web assembly file not found for framework " + targetFramework.Id);
			ProjectDom dom = ProjectDomService.GetAssemblyDom (runtime, file);
			if (dom == null)
				throw new Exception ("System.Web parse database not found for framework " + targetFramework.Id + " file '" + file + "'");
			return dom;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:13,代码来源:WebTypeManager.cs


示例8: Initialize

		protected override void Initialize (TargetRuntime runtime, TargetFramework framework)
		{
			base.Initialize (runtime, framework);
			fxVersion = GetFxVersion (framework);
			
			foreach (var dir in GetMoonDirectories ()) {
				var fxdir = dir.Combine (fxVersion);
				var buildVersion = fxdir.Combine ("buildversion");
				if (Directory.Exists (fxdir) && Directory.Exists (fxdir + "-redist") && File.Exists (buildVersion)) {
					if (LoadVersionString (buildVersion) && RegisterRedistAssemblies (dir))
						this.location = dir;
					break;
				}
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:15,代码来源:MoonlightFrameworkBackend.cs


示例9: Initialize

		protected override void Initialize (TargetRuntime runtime, TargetFramework framework)
		{
			if (framework.Id.Identifier != "Silverlight")
				throw new InvalidOperationException (string.Format ("Cannot handle unknown framework {0}", framework.Id));
			
			base.Initialize (runtime, framework);
			fxVersion = framework.Id.Version;
			
			foreach (var dir in GetMoonDirectories ()) {
				var fxdir = dir.Combine (fxVersion);
				var buildVersion = fxdir.Combine ("buildversion");
				if (Directory.Exists (fxdir) && Directory.Exists (fxdir + "-redist") && File.Exists (buildVersion)) {
					if (LoadVersionString (buildVersion) && RegisterRedistAssemblies (dir))
						this.location = dir;
					break;
				}
			}
		}
开发者ID:stewartwhaley,项目名称:monodevelop,代码行数:18,代码来源:MoonlightFrameworkBackend.cs


示例10: GetCompilerName

 static string GetCompilerName(TargetRuntime runtime, TargetFramework fx)
 {
     string fsc = runtime.GetToolPath (fx, "fsc");
     if (fsc != null) {
         return fsc;}
     else {
         string message = GettextCatalog.GetString ("F# compiler not found for {0}.", fx.Name);
         LoggingService.LogError (message);
         throw new Exception (message);
     }
 }
开发者ID:vasili,项目名称:FSharpBinding,代码行数:11,代码来源:FSharpBindingCompilerManager.cs


示例11: Initialize

		internal protected virtual void Initialize (TargetRuntime runtime, TargetFramework framework)
		{
			this.runtime = runtime;
			this.framework = framework;
		}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:5,代码来源:TargetFrameworkBackend.cs


示例12: GetProjectBuilder

		internal static async Task<RemoteProjectBuilder> GetProjectBuilder (TargetRuntime runtime, string minToolsVersion, string file, string solutionFile, int customId, bool lockBuilder = false)
		{
			using (await buildersLock.EnterAsync ())
			{
				//attempt to use 14.0 builder first if available
				string toolsVersion = "14.0";
				string binDir = runtime.GetMSBuildBinPath ("14.0");
				if (binDir == null) {
					toolsVersion = "12.0";
					binDir = runtime.GetMSBuildBinPath ("12.0");
					if (binDir == null) {
						//fall back to 4.0, we know it's always available
						toolsVersion = "4.0";
					}
				}

				// Check the ToolsVersion we found can handle the project
				// The check is only done for the .NET framework since Mono doesn't really have the concept of ToolsVersion.
				// On Mono we'll just try to build with whatever is installed.
				Version tv, mtv;
				if (runtime is MsNetTargetRuntime && Version.TryParse (toolsVersion, out tv) && Version.TryParse (minToolsVersion, out mtv) && tv < mtv) {
					string error = null;
					if (minToolsVersion == "12.0")
						error = "MSBuild 2013 is not installed. Please download and install it from " +
						"http://www.microsoft.com/en-us/download/details.aspx?id=40760";
					throw new InvalidOperationException (error ?? string.Format (
						"Runtime '{0}' does not have MSBuild '{1}' ToolsVersion installed",
						runtime.Id, toolsVersion)
					);
				}

				//one builder per solution
				string builderKey = runtime.Id + " # " + solutionFile + " # " + customId;

				RemoteBuildEngine builder = null;

				if (lockBuilder) {
					foreach (var b in builders.GetBuilders (builderKey)) {
						if (b.Lock ()) {
							builder = b;
							break;
						}
						b.Unlock ();
					}
				} else
					builder = builders.GetBuilders (builderKey).FirstOrDefault ();
				
				if (builder != null) {
					builder.ReferenceCount++;
					return new RemoteProjectBuilder (file, builder);
				}

				return await Task.Run (() => {
					//always start the remote process explicitly, even if it's using the current runtime and fx
					//else it won't pick up the assembly redirects from the builder exe
					var exe = GetExeLocation (runtime, toolsVersion);

					MonoDevelop.Core.Execution.RemotingService.RegisterRemotingChannel ();
					var pinfo = new ProcessStartInfo (exe) {
						UseShellExecute = false,
						CreateNoWindow = true,
						RedirectStandardError = true,
						RedirectStandardInput = true,
					};
					runtime.GetToolsExecutionEnvironment ().MergeTo (pinfo);

					Process p = null;

					try {
						IBuildEngine engine;
						if (!runLocal) {
							p = runtime.ExecuteAssembly (pinfo);

							// The builder app will write the build engine reference
							// after reading the process id from the standard input
							ManualResetEvent ev = new ManualResetEvent (false);
							string responseKey = "[MonoDevelop]";
							string sref = null;
							p.ErrorDataReceived += (sender, e) => {
								if (e.Data == null) {
									if (string.IsNullOrEmpty (sref))
										LoggingService.LogError ("The MSBuild builder exited before initializing");
									return;
								}

								if (e.Data.StartsWith (responseKey, StringComparison.Ordinal)) {
									sref = e.Data.Substring (responseKey.Length);
									ev.Set ();
								} else
									Console.WriteLine (e.Data);
							};
							p.BeginErrorReadLine ();
							p.StandardInput.WriteLine (Process.GetCurrentProcess ().Id.ToString ());
							if (!ev.WaitOne (TimeSpan.FromSeconds (5)))
								throw new Exception ("MSBuild process could not be started");

							byte [] data = Convert.FromBase64String (sref);
							MemoryStream ms = new MemoryStream (data);
							BinaryFormatter bf = new BinaryFormatter ();
							engine = (IBuildEngine)bf.Deserialize (ms);
//.........这里部分代码省略.........
开发者ID:drasticactions,项目名称:monodevelop,代码行数:101,代码来源:MSBuildProjectService.cs


示例13: GetNewestInstalledToolsVersion

		static string GetNewestInstalledToolsVersion (TargetRuntime runtime, bool requiresMicrosoftBuild, out string binDir)
		{
			string [] supportedToolsVersions;
			if ((requiresMicrosoftBuild || Runtime.Preferences.BuildWithMSBuild) && !Platform.IsWindows)
				supportedToolsVersions = new [] { "15.0"};
			else
				supportedToolsVersions = new [] { "14.0", "12.0", "4.0" };

			foreach (var toolsVersion in supportedToolsVersions) {
				binDir = runtime.GetMSBuildBinPath (toolsVersion);
				if (binDir != null) {
					return toolsVersion;
				}
			}
			throw new Exception ("Did not find MSBuild for runtime " + runtime.Id);
		}
开发者ID:PlayScriptRedux,项目名称:monodevelop,代码行数:16,代码来源:MSBuildProjectService.cs


示例14: ParseAssemblyUri

		public static bool ParseAssemblyUri (string uri, out TargetRuntime runtime, out TargetFramework fx, out string file)
		{
			if (uri.StartsWith (assemblyPrefix)) {
				runtime = null;
				fx = null;
				int curOffset = assemblyPrefix.Length;
				int i = uri.IndexOf (':', curOffset);
				if (i != -1) {
					string rid = uri.Substring (assemblyPrefix.Length, i - assemblyPrefix.Length);
					runtime = Runtime.SystemAssemblyService.GetTargetRuntime (rid);
					curOffset = i + 1;
				}
				i = Math.Max (uri.IndexOfAny (separators, curOffset), curOffset);
				if (uri[i - 1] == ':' && i == curOffset + 2)
					i = curOffset;
				file = uri.Substring (i);
				if (runtime == null)
					runtime = Runtime.SystemAssemblyService.DefaultRuntime;
				if (fx == null)
					fx = TargetFramework.Default;
				return true;
			}
			file = null;
			runtime = null;
			fx = null;
			return false;
		}
开发者ID:Poiros,项目名称:monodevelop,代码行数:27,代码来源:ProjectDomService.cs


示例15: LoadAssembly

		public static string LoadAssembly (TargetRuntime runtime, string file)
		{
			string name = "Assembly:" + runtime.Id + ":" + Path.GetFullPath (file);
			if (GetDom (name, true) != null)
				return name;
			else
				return null;
		}
开发者ID:Poiros,项目名称:monodevelop,代码行数:8,代码来源:ProjectDomService.cs


示例16: CreateBackendForRuntime

		internal TargetFrameworkBackend CreateBackendForRuntime (TargetRuntime runtime)
		{
			if (FrameworkNode == null)
				return null;
			
			lock (FrameworkNode) {
				if (FrameworkNode.ChildNodes == null)
					return null;
			}
			
			foreach (TypeExtensionNode node in FrameworkNode.ChildNodes) {
				TargetFrameworkBackend backend = (TargetFrameworkBackend) node.CreateInstance (typeof (TargetFrameworkBackend));
				if (backend.SupportsRuntime (runtime))
					return backend;
			}
			return null;
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:17,代码来源:TargetFramework.cs


示例17: GetProjectBuilder

		public static RemoteProjectBuilder GetProjectBuilder (TargetRuntime runtime, TargetFramework fx, string file)
		{
			lock (builders) {
				string binDir = runtime.GetMSBuildBinPath (fx);
				
				RemoteBuildEngine builder;
				if (builders.TryGetValue (runtime, out builder)) {
					builder.ReferenceCount++;
					return new RemoteProjectBuilder (file, binDir, builder);
				}
				
				if (runtime.IsRunning) {
					if (currentBuildEngine == null)
						currentBuildEngine = new RemoteBuildEngine (null, new BuildEngine ());
					return new RemoteProjectBuilder (file, binDir, currentBuildEngine);
				}
				else {
					MonoDevelop.Core.Execution.RemotingService.RegisterRemotingChannel ();
					string exe = typeof(ProjectBuilder).Assembly.Location;
					ProcessStartInfo pinfo = new ProcessStartInfo (exe);
					runtime.GetToolsExecutionEnvironment (fx).MergeTo (pinfo);
					pinfo.UseShellExecute = false;
					pinfo.RedirectStandardError = true;
					pinfo.RedirectStandardInput = true;
					
					Process p = null;
					try {
						p = runtime.ExecuteAssembly (pinfo, fx);
						p.StandardInput.WriteLine (Process.GetCurrentProcess ().Id.ToString ());
						string sref = p.StandardError.ReadLine ();
						byte[] data = Convert.FromBase64String (sref);
						MemoryStream ms = new MemoryStream (data);
						BinaryFormatter bf = new BinaryFormatter ();
						builder = new RemoteBuildEngine (p, (IBuildEngine) bf.Deserialize (ms));
					} catch {
						if (p != null) {
							try {
								p.Kill ();
							} catch { }
						}
						throw;
					}
				}
				builders [runtime] = builder;
				builder.ReferenceCount = 1;
				return new RemoteProjectBuilder (file, binDir, builder);
			}
		}
开发者ID:natosha,项目名称:monodevelop,代码行数:48,代码来源:MSBuildProjectService.cs


示例18: GetExeLocation

		static string GetExeLocation (TargetRuntime runtime, string toolsVersion)
		{
			FilePath sourceExe = typeof(ProjectBuilder).Assembly.Location;

			if ((runtime is MsNetTargetRuntime) && int.Parse (toolsVersion.Split ('.')[0]) >= 4)
				toolsVersion = "dotnet." + toolsVersion;

			if (toolsVersion == REFERENCED_MSBUILD_TOOLS)
				return sourceExe;
			
			var exe = sourceExe.ParentDirectory.Combine ("MSBuild", toolsVersion, sourceExe.FileName);
			if (File.Exists (exe))
				return exe;
			
			throw new InvalidOperationException ("Unsupported MSBuild ToolsVersion '" + toolsVersion + "'");
		}
开发者ID:John-Colvin,项目名称:monodevelop,代码行数:16,代码来源:MSBuildProjectService.cs


示例19: GetAssemblyDom

		public static ProjectDom GetAssemblyDom (TargetRuntime runtime, string assemblyName)
		{
			return GetDom ("Assembly:" + runtime.Id + ":" + assemblyName);
		}
开发者ID:Poiros,项目名称:monodevelop,代码行数:4,代码来源:ProjectDomService.cs


示例20: AssemblyCodeCompletionDatabase

		public AssemblyCodeCompletionDatabase (TargetRuntime runtime, TargetFramework fx, string assemblyFile, ParserDatabase pdb): this (runtime, fx, assemblyFile, pdb, false)
		{
		}
开发者ID:tech-uday-mca,项目名称:monodevelop,代码行数:3,代码来源:AssemblyCodeCompletionDatabase.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Execution.ExecutionCommand类代码示例发布时间:2022-05-26
下一篇:
C# Assemblies.TargetFramework类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap