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


C# Assemblies.TargetFramework类代码示例

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


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


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