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


C# TargetFramework.IsCompatibleWithFramework方法代码示例

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


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

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

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

示例3: GetAssemblyForVersion

		// Given the full name of an assembly, returns the corresponding full assembly name
		// in the specified target CLR version, or null if it doesn't exist in that version.
		public SystemAssembly GetAssemblyForVersion (string fullName, string packageName, TargetFramework fx)
		{
			Initialize ();

			fullName = NormalizeAsmName (fullName);
			
			//get the SystemAssembly for the current fullname, NOT the new target fx
			//in order to be able to check whether it's a framework assembly
			SystemAssembly asm = GetAssemblyFromFullName (fullName, packageName, null);

			if (asm == null)
				return null;
			
			var fxAsms = asm.AllSameName ().Where (a => a.Package.IsFrameworkPackage);
			
			//if the asm is not a framework asm, we don't upgrade it automatically
			if (!fxAsms.Any ()) {
				// Return null if the package is not compatible with the requested version
				if (fx.IsCompatibleWithFramework (asm.Package.TargetFramework))
					return asm;
				else
					return null;
			}
			
			foreach (var fxAsm in fxAsms) {
				if (fx.IsExtensionOfFramework (fxAsm.Package.TargetFramework))
					return fxAsm;
			}

			// We have to find the assembly with the same name in the target fx
			string fname = Path.GetFileName ((string) fxAsms.First ().Location);
			
			foreach (var pair in assemblyFullNameToAsm) {
				foreach (var fxAsm in pair.Value.AllSameName ()) {
					var rpack = fxAsm.Package;
					if (rpack.IsFrameworkPackage && fx.IsExtensionOfFramework (rpack.TargetFramework) && Path.GetFileName (fxAsm.Location) == fname)
						return fxAsm;
				}
			}
			return null;
		}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:43,代码来源:AssemblyContext.cs

示例4: FindInstalledAssembly

		// Returns the installed version of the given assembly name
		// (it returns the full name of the installed assembly).
		public string FindInstalledAssembly (string fullname, string package, TargetFramework fx)
		{
			Initialize ();
			fullname = NormalizeAsmName (fullname);
			
			SystemAssembly fasm = GetAssemblyFromFullName (fullname, package, fx);
			if (fasm != null)
				return fullname;
			
			// Try to find a newer version of the same assembly, preferring framework assemblies
			if (fx == null) {
				string best = null;
				foreach (SystemAssembly asm in FindNewerAssembliesSameName (fullname)) {
					if (package == null || asm.Package.Name == package) {
						if (asm.Package.IsFrameworkPackage)
							return asm.FullName;
						else
							best = asm.FullName;
					}
				}
				return best;
			}
			
			string bestMatch = null;
			foreach (SystemAssembly asm in FindNewerAssembliesSameName (fullname)) {
				if (asm.Package.IsFrameworkPackage) {
					if (fx.IsExtensionOfFramework (asm.Package.TargetFramework))
						if (package == null || asm.Package.Name == package)
							return asm.FullName;
				} else if (fx.IsCompatibleWithFramework (asm.Package.TargetFramework)) {
					if (package != null && asm.Package.Name == package)
						return asm.FullName;
					bestMatch = asm.FullName;
				}
			}
			return bestMatch;
		}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:39,代码来源:AssemblyContext.cs

示例5: GetPackages

		public IEnumerable<SystemPackage> GetPackages (TargetFramework fx)
		{
			foreach (SystemPackage pkg in packages) {
				if (pkg.TargetFramework == fx.Id) {
					yield return pkg;
				}
				else if (pkg.IsBaseCorePackage) {
					if (pkg.TargetFramework == fx.BaseCoreFramework)
						yield return pkg;
				}
				else if (pkg.IsFrameworkPackage) {
					if (fx.IsCompatibleWithFramework (pkg.TargetFramework)) {
						TargetFramework packageFx = Runtime.SystemAssemblyService.GetTargetFramework (pkg.TargetFramework);
						if (packageFx.BaseCoreFramework == fx.BaseCoreFramework)
							yield return pkg;
					}
				}
				else if (fx.IsCompatibleWithFramework (pkg.TargetFramework))
					yield return pkg;
			}
		}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:21,代码来源:AssemblyContext.cs

示例6: GetPackages

		public IEnumerable<SystemPackage> GetPackages (TargetFramework fx)
		{
			foreach (SystemPackage pkg in packages) {
				if (pkg.IsFrameworkPackage) {
					if (fx.IncludesFramework (pkg.TargetFramework))
						yield return pkg;
				} else {
					if (fx.IsCompatibleWithFramework (pkg.TargetFramework))
						yield return pkg;
				}		
			}
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:12,代码来源:AssemblyContext.cs


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