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

C# Assemblies.TargetFramework类代码示例

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

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



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

示例1: GetAssemblyLocation

		public override string GetAssemblyLocation (string assemblyName, string package, TargetFramework fx)
		{
			string loc = base.GetAssemblyLocation (assemblyName, package, fx);
			if (loc != null)
				return loc;
			
			string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
			
			string name;
			
			int i = assemblyName.IndexOf (',');
			if (i == -1)
				name = assemblyName;
			else
				name = assemblyName.Substring (0,i).Trim ();

			// Look in initial path
			if (!string.IsNullOrEmpty (baseDirectory)) {
				string localPath = Path.Combine (baseDirectory, name);
				if (File.Exists (localPath))
					return localPath;
			}
			
			// Look in assembly directories
			foreach (string path in GetAssemblyDirectories ()) {
				string localPath = Path.Combine (path, name);
				if (File.Exists (localPath))
					return localPath;
			}

			// Look in the gac
			return GetGacFile (assemblyName, true);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:33,代码来源:RuntimeAssemblyContext.cs


示例2: GetPackages

		public IEnumerable<SystemPackage> GetPackages (TargetFramework fx)
		{
			foreach (IAssemblyContext ctx in sources) {
				foreach (SystemPackage p in ctx.GetPackages (fx))
					yield return p;
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:ComposedAssemblyContext.cs


示例3: CreatePortableProfileViewModel

		PortableProfileViewModel CreatePortableProfileViewModel (
			TargetFramework fx,
			IEnumerable<TargetFrameworkMoniker> selectedTargetFrameworks)
		{
			bool enabled = selectedTargetFrameworks.Contains (fx.Id);
			return new PortableProfileViewModel (fx, enabled);
		}
开发者ID:PlayScriptRedux,项目名称:monodevelop,代码行数:7,代码来源:GtkReferenceAssembliesOptionsPanelWidget.cs


示例4: SupportsFramework

		public override bool SupportsFramework (TargetFramework framework)
		{
			if (!framework.IsCompatibleWithFramework (TargetFrameworkMoniker.PORTABLE_4_0))
				return false;
			else
				return base.SupportsFramework (framework);
		}
开发者ID:gary-b,项目名称:monodevelop,代码行数:7,代码来源:PortableDotNetProject.cs


示例5: SupportsFramework

		public override bool SupportsFramework (TargetFramework framework)
		{
			// DotNetAssemblyProject can only generate assemblies for the regular framework.
			// Special frameworks such as Moonlight or MonoTouch must subclass DotNetProject directly.
			if (!framework.IsCompatibleWithFramework (TargetFrameworkMoniker.NET_1_1))
				return false;
			else
				return base.SupportsFramework (framework);
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:9,代码来源:DotNetAssemblyProject.cs


示例6: 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


示例7: PortableRuntimeOptionsPanelWidget

        public PortableRuntimeOptionsPanelWidget(PortableDotNetProject project, IEnumerable<ItemConfiguration> configurations)
        {
            this.target = project.TargetFramework;
            this.project = project;
            this.Build ();

            // Aggregate all SupportedFrameworks from .NETPortable TargetFrameworks
            targetFrameworks = GetPortableTargetFrameworks ().ToList ();
            targetFrameworks.Sort (CompareFrameworks);
            supportedFrameworks = new SortedDictionary<string, List<SupportedFramework>> ();

            if (!targetFrameworks.Contains (project.TargetFramework)) {
                missingFramework = project.TargetFramework;
                targetFrameworks.Insert (0, project.TargetFramework);
            }

            foreach (var fx in targetFrameworks) {
                foreach (var sfx in fx.SupportedFrameworks) {
                    List<SupportedFramework> list;

                    if (!supportedFrameworks.TryGetValue (sfx.DisplayName, out list)) {
                        list = new List<SupportedFramework> ();
                        supportedFrameworks.Add (sfx.DisplayName, list);
                    }

                    list.Add (sfx);
                }
            }

            // Now create a list of config options from our supported frameworks
            options = new List<OptionCombo> ();
            foreach (var fx in supportedFrameworks) {
                var combo = new OptionCombo (fx.Key);

                var dict = new SortedDictionary<string, OptionComboItem> ();
                foreach (var sfx in fx.Value) {
                    var label = GetDisplayName (sfx);

                    OptionComboItem item;
                    if (!dict.TryGetValue (label, out item)) {
                        item = new OptionComboItem (label, sfx);
                        dict.Add (label, item);
                    }

                    item.Targets.Add (sfx.TargetFramework);
                }

                combo.Items = dict.Values.ToList ();

                options.Add (combo);
            }

            CreateUI ();

            CurrentProfileChanged (project.TargetFramework);
        }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:56,代码来源:PortableRuntimeOptionsPanel.cs


示例8: SupportsFramework

		public override bool SupportsFramework (TargetFramework framework)
		{
			if (framework.Id.Identifier == TargetFrameworkMoniker.ID_PORTABLE && framework.Id.Version == "4.0")
				return true;

			if (!framework.CanReferenceAssembliesTargetingFramework (TargetFrameworkMoniker.PORTABLE_4_0))
				return false;

			return base.SupportsFramework (framework);
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:10,代码来源:PortableDotNetProject.cs


示例9: GetFxVersion

		internal static string GetFxVersion (TargetFramework fx)
		{
			switch (fx.Id) {
			case "SL2.0":
				return "2.0";
			case "SL3.0":
				return "3.0";
			default:
				throw new InvalidOperationException ("Cannot handle unknown target framework '" + fx.Id +"'");
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:11,代码来源:MoonlightFrameworkBackend.cs


示例10: SupportedFramework

		internal SupportedFramework (TargetFramework target)
		{
			MinimumVersionDisplayName = string.Empty;
			MinimumVersion = NoMinumumVersion;
			MaximumVersion = NoMaximumVersion;
			DisplayName = string.Empty;
			Identifier = string.Empty;
			Profile = string.Empty;
			
			TargetFramework = target;
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:11,代码来源:SupportedFramework.cs


示例11: 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


示例12: LoadFrom

		public void LoadFrom (FilePath assemblyPath)
		{
			FileName = assemblyPath;
			
			var tid = Runtime.SystemAssemblyService.GetTargetFrameworkForAssembly (Runtime.SystemAssemblyService.DefaultRuntime, assemblyPath);
			if (tid != null)
				targetFramework = Runtime.SystemAssemblyService.GetTargetFramework (tid);
			
			AssemblyDefinition adef = AssemblyDefinition.ReadAssembly (assemblyPath);
			MdbReaderProvider mdbProvider = new MdbReaderProvider ();
			try {
				ISymbolReader reader = mdbProvider.GetSymbolReader (adef.MainModule, assemblyPath);
				adef.MainModule.ReadSymbols (reader);
			} catch {
				// Ignore
			}
			var files = new HashSet<FilePath> ();
			
			foreach (TypeDefinition type in adef.MainModule.Types) {
				foreach (MethodDefinition met in type.Methods) {
					if (met.HasBody && met.Body.Instructions != null && met.Body.Instructions.Count > 0) {
						SequencePoint sp = met.Body.Instructions[0].SequencePoint;
						if (sp != null)
							files.Add (sp.Document.Url);
					}
				}
			}
			
			FilePath rootPath = FilePath.Empty;
			foreach (FilePath file in files) {
				AddFile (file, BuildAction.Compile);
				if (rootPath.IsNullOrEmpty)
					rootPath = file.ParentDirectory;
				else if (!file.IsChildPathOf (rootPath))
					rootPath = FindCommonRoot (rootPath, file);
			}
			
			if (!rootPath.IsNullOrEmpty)
				BaseDirectory = rootPath;
/*
			foreach (AssemblyNameReference aref in adef.MainModule.AssemblyReferences) {
				if (aref.Name == "mscorlib")
					continue;
				string asm = assemblyPath.ParentDirectory.Combine (aref.Name);
				if (File.Exists (asm + ".dll"))
					References.Add (new ProjectReference (ReferenceType.Assembly, asm + ".dll"));
				else if (File.Exists (asm + ".exe"))
					References.Add (new ProjectReference (ReferenceType.Assembly, asm + ".exe"));
				else
					References.Add (new ProjectReference (ReferenceType.Package, aref.FullName));
			}*/
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:52,代码来源:CompiledAssemblyProject.cs


示例13: 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


示例14: 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


示例15: 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


示例16: 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


示例17: 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


示例18: InitProfiles

		static void InitProfiles ()
		{
			// Profile 1 (.NETFramework + Silverlight + WindowsPhone + Xbox)
			NetPortableProfile1 = Runtime.SystemAssemblyService.GetTargetFramework (new TargetFrameworkMoniker (".NETPortable", "4.0", "Profile1"));
			SupportedFramework NetFramework = new SupportedFramework (NetPortableProfile1, ".NETFramework", ".NET Framework", "*", new Version (4, 0), "4");
			SupportedFramework Silverlight = new SupportedFramework (NetPortableProfile1, "Silverlight", "Silverlight", "", new Version (4, 0), "4");
			SupportedFramework WindowsPhone = new SupportedFramework (NetPortableProfile1, "Silverlight", "Windows Phone", "WindowsPhone*", new Version (4, 0), "7");
			SupportedFramework Xbox = new SupportedFramework (NetPortableProfile1, "Xbox", "Xbox 360", "*", new Version (4, 0), "");
			
			NetPortableProfile1.SupportedFrameworks.Add (NetFramework);
			NetPortableProfile1.SupportedFrameworks.Add (Silverlight);
			NetPortableProfile1.SupportedFrameworks.Add (WindowsPhone);
			NetPortableProfile1.SupportedFrameworks.Add (Xbox);

			// Profile 2 (.NETFramework + Silverlight + WindowsPhone)
			NetPortableProfile2 = Runtime.SystemAssemblyService.GetTargetFramework (new TargetFrameworkMoniker (".NETPortable", "4.0", "Profile2"));
			NetFramework = new SupportedFramework (NetPortableProfile2, ".NETFramework", ".NET Framework", "*", new Version (4, 0), "4");
			Silverlight = new SupportedFramework (NetPortableProfile2, "Silverlight", "Silverlight", "", new Version (4, 0), "4");
			WindowsPhone = new SupportedFramework (NetPortableProfile2, "Silverlight", "Windows Phone", "WindowsPhone*", new Version (4, 0), "7");
			
			NetPortableProfile2.SupportedFrameworks.Add (NetFramework);
			NetPortableProfile2.SupportedFrameworks.Add (Silverlight);
			NetPortableProfile2.SupportedFrameworks.Add (WindowsPhone);

			// Profile 3 (.NETFramework + Silverlight)
			NetPortableProfile3 = Runtime.SystemAssemblyService.GetTargetFramework (new TargetFrameworkMoniker (".NETPortable", "4.0", "Profile3"));
			NetFramework = new SupportedFramework (NetPortableProfile3, ".NETFramework", ".NET Framework", "*", new Version (4, 0), "4");
			Silverlight = new SupportedFramework (NetPortableProfile3, "Silverlight", "Silverlight", "", new Version (4, 0), "4");
			
			NetPortableProfile3.SupportedFrameworks.Add (NetFramework);
			NetPortableProfile3.SupportedFrameworks.Add (Silverlight);

			// Profile 4 (Silverlight + WindowsPhone)
			NetPortableProfile4 = Runtime.SystemAssemblyService.GetTargetFramework (new TargetFrameworkMoniker (".NETPortable", "4.0", "Profile4"));
			Silverlight = new SupportedFramework (NetPortableProfile4, "Silverlight", "Silverlight", "", new Version (4, 0), "4");
			WindowsPhone = new SupportedFramework (NetPortableProfile4, "Silverlight", "Windows Phone", "WindowsPhone*", new Version (4, 0), "7");

			NetPortableProfile4.SupportedFrameworks.Add (Silverlight);
			NetPortableProfile4.SupportedFrameworks.Add (WindowsPhone);
		}
开发者ID:halleyxu,项目名称:monodevelop,代码行数:40,代码来源:PortableRuntimeOptionsPanel.cs


示例19: Load

		internal static Framework Load (TargetFramework target, string path)
		{
			Framework fx = new Framework (target);
			
			using (var reader = XmlReader.Create (path)) {
				if (!reader.ReadToDescendant ("Framework"))
					throw new Exception ("Missing Framework element");
				
				if (!reader.HasAttributes)
					throw new Exception ("Framework element does not contain any attributes");
				
				while (reader.MoveToNextAttribute ()) {
					switch (reader.Name) {
					case "MaximumVersion":
						fx.MaximumVersion = ParseVersion (reader.Value, NoMaximumVersion);
						break;
					case "MinimumVersion":
						fx.MinimumVersion = ParseVersion (reader.Value, NoMinumumVersion);
						break;
					case "Profile":
						fx.Profile = reader.Value;
						break;
					case "Identifier":
						fx.Identifier = reader.Value;
						break;
					case "MinimumVersionDisplayName":
						fx.MinimumVersionDisplayName = reader.Value;
						break;
					case "DisplayName":
						fx.DisplayName = reader.Value;
						break;
					}
				}
			}
			
			return fx;
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:37,代码来源:Framework.cs


示例20: OnSave

		protected internal override void OnSave (IProgressMonitor monitor)
		{
			// Make sure the fx version is sorted out before saving
			// to avoid changes in project references while saving 
			if (targetFramework == null)
				targetFramework = Runtime.SystemAssemblyService.GetTargetFramework (GetDefaultTargetFrameworkForFormat (FileFormat));
			base.OnSave (monitor);
		}
开发者ID:John-Colvin,项目名称:monodevelop,代码行数:8,代码来源:DotNetProject.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Assemblies.TargetRuntime类代码示例发布时间:2022-05-26
下一篇:
C# Core.PropertyChangedEventArgs类代码示例发布时间: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