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


C# ProjectReference.GetReferencedFileNames方法代码示例

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


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

示例1: ProjectRefToString

		string ProjectRefToString (ProjectReference pr, MakefileVar refVar)
		{
			string [] tmp = pr.GetReferencedFileNames (ConfigurationSelector.Default);
			if (tmp == null || tmp.Length == 0)
				//Reference not found, ignoring
				return null;

			return AsmRefToString (tmp [0], refVar, true);
		}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:9,代码来源:MakefileData.cs

示例2: GacRefToString

		string GacRefToString (ProjectReference pr, Dictionary<string, bool> hasAcSubstPackages, MakefileVar refVar)
		{
			//Gac ref can be a full name OR a path!
			//FIXME: Use GetReferencedFileName and GetPackageFromPath ?
			string fullname = pr.Reference;
			SystemPackage pkg = pr.Package;
			if (pkg == null) {
				//reference could be a path
				pkg = assemblyContext.GetPackageFromPath (Path.GetFullPath (pr.Reference));
				if (pkg != null) {
					//Path
					try {
						fullname = AssemblyName.GetAssemblyName (pr.Reference).FullName;
						//If this throws : Invalid assembly!
						//let it fall through and be emitted as a asm ref
					} catch (FileNotFoundException) {
						pkg = null;
					} catch (BadImageFormatException) {
						pkg = null;
					}
				}
			}

			if (pkg == null)
				return AsmRefToString (pr.GetReferencedFileNames (ConfigurationSelector.Default) [0], refVar, false);

			// Reference is from a package

			if (pkg.IsCorePackage)
				//pkg:mono, Eg. System, System.Data etc
				return fullname.Split (new char [] {','}, 2) [0];

			//Ref is from a non-core package
			string varname = null;
			if (UseAutotools)
				//Check whether ref'ed in configure.in
				varname = ConfiguredPackages.GetVarNameFromName (pkg.Name);
			
			if (varname == null) {
				//Package not referenced in configure.in
				//Or not a autotools based project,
				//so emit -pkg:

				if (!hasAcSubstPackages.ContainsKey (pkg.Name)) {
					if (UseAutotools) {
						//Warn only if UseAutotools
						string msg = GettextCatalog.GetString (
							"A reference to the pkg-config package '{0}' is being emitted to the Makefile, " +
							"because at least one assembly from the package is used in the project '{1}'. However, " +
							"this dependency is not specified in the configure.in file, so you might need to " +
							"add it to ensure that the project builds successfully on other systems.", pkg.Name, pr.OwnerProject.Name);
						LoggingService.LogWarning (msg);
						monitor.ReportWarning (msg);
					}

					hasAcSubstPackages [pkg.Name] = false;
				}
			} else {
				// If the package as AC_SUBST(FOO_LIBS) defined, then
				// emit FOO_LIBS, else emit -pkg:foo
				if (ConfiguredPackages.HasAcSubst (varname + "_LIBS")) {
					hasAcSubstPackages [varname] = true;
				} else {
					hasAcSubstPackages [pkg.Name] = false;
				}
			}

			return null;
		}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:69,代码来源:MakefileData.cs

示例3: GenerateReferenceStub

		static string GenerateReferenceStub (IProgressMonitor monitor, ConfigurationSelector configurationSelector, DotNetProjectConfiguration configuration, ProjectReference reference)
		{
			StringBuilder result = new StringBuilder ();
			foreach (string fileName in reference.GetReferencedFileNames (configurationSelector)) {
				string name = Path.GetFileNameWithoutExtension (Path.GetFileName (fileName));
				string outputName = Path.Combine (configuration.OutputDirectory, name + ".jar");
				if (!System.IO.File.Exists (outputName)) {
					monitor.Log.WriteLine (String.Format (GettextCatalog.GetString ("Generating {0} reference stub ..."), name));
					monitor.Log.WriteLine ("ikvmstub \"" + fileName + "\"");
					ProcessWrapper p = Runtime.ProcessService.StartProcess ("ikvmstub", "\"" + fileName + "\"", configuration.OutputDirectory, monitor.Log, monitor.Log, null);
					p.WaitForExit ();
					if (p.ExitCode != 0) {
						monitor.ReportError ("Stub generation failed.", null);
						if (File.Exists (outputName)) {
							try {
								File.Delete (outputName);
							} catch {
								// Ignore
							}
						}
					}
				}
				AppendClasspath (result, outputName);
			}
			return result.ToString ();
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:26,代码来源:IKVMCompilerManager.cs

示例4: GetNUnitVersion

		public static NUnitVersion? GetNUnitVersion (ProjectReference p)
		{
			if (p.Reference.IndexOf ("GuiUnit", StringComparison.OrdinalIgnoreCase) != -1 || p.Reference.StartsWith ("nunitlite", StringComparison.OrdinalIgnoreCase))
				return NUnitVersion.NUnit2;
			if (p.Reference.IndexOf ("nunit.framework", StringComparison.OrdinalIgnoreCase) != -1) {
				var selector = p.Project?.DefaultConfiguration.Selector;
				if (selector == null)
					return NUnitVersion.Unknown;

				var f = p.GetReferencedFileNames (selector).FirstOrDefault ();
				if (f != null && File.Exists (f)) {
					try {
						var aname = new AssemblyName (SystemAssemblyService.GetAssemblyName (f));
						if (aname.Version.Major == 2)
							return NUnitVersion.NUnit2;
						else
							return NUnitVersion.NUnit3;
					} catch (Exception ex) {
						LoggingService.LogError ("Could not get assembly version", ex);
					}
				}
			}
			return null;
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:24,代码来源:NUnitProjectTestSuite.cs

示例5: IsFromPackage

		//HACK: we don't have the info to do this properly, really the package management addin should handle this
		static bool IsFromPackage (ProjectReference r)
		{
			if (r.ReferenceType != ReferenceType.Assembly) {
				return false;
			}
			var packagesDir = r.Project.ParentSolution.BaseDirectory.Combine ("packages");
			return r.GetReferencedFileNames(null).Any (f => ((FilePath)f).IsChildPathOf (packagesDir));
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:9,代码来源:PortableRuntimeOptionsPanel.cs


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