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


C# FileProjectItem.SetEvaluatedMetadata方法代码示例

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


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

示例1: CreateFileProjectItemUsingPathRelativeToProject

 FileProjectItem CreateFileProjectItemUsingPathRelativeToProject(ItemType itemType, string include)
 {
     var fileItem = new FileProjectItem(MSBuildProject, itemType) {
         Include = include
     };
     if (IsLink(include)) {
         fileItem.SetEvaluatedMetadata("Link", Path.GetFileName(include));
     }
     return fileItem;
 }
开发者ID:ichengzi,项目名称:SharpDevelop,代码行数:10,代码来源:Project.cs

示例2: CreateProjectItems

		List<ProjectItem> CreateProjectItems()
		{
			List<ProjectItem> items = new List<ProjectItem>();
			
			// Web references item.
			if (!ProjectContainsWebReferencesFolder(project)) {
				WebReferencesProjectItem webReferencesItem = new WebReferencesProjectItem(project);
				webReferencesItem.Include = "Web References\\";
				items.Add(webReferencesItem);
			}
			
			// Web reference url.
			webReferenceUrl = new WebReferenceUrl(project);
			webReferenceUrl.Include = url;
			webReferenceUrl.UpdateFromURL = url;
			webReferenceUrl.RelPath = relativePath;
			webReferenceUrl.Namespace = proxyNamespace;
			items.Add(webReferenceUrl);
			
			// References.
			foreach (DictionaryEntry entry in protocol.References) {
				DiscoveryReference discoveryRef = entry.Value as DiscoveryReference;
				if (discoveryRef != null) {
					FileProjectItem item = new FileProjectItem(project, ItemType.None);
					item.Include = Path.Combine(relativePath, discoveryRef.DefaultFilename);
					items.Add(item);
				}
			}
			
			// Proxy
			FileProjectItem proxyItem = new FileProjectItem(project, ItemType.Compile);
			proxyItem.Include = GetProxyFileName();
			proxyItem.SetEvaluatedMetadata("AutoGen", "True");
			proxyItem.SetEvaluatedMetadata("DesignTime", "True");
			proxyItem.DependentUpon = "Reference.map";
			items.Add(proxyItem);
			
			// Reference map.
			FileProjectItem mapItem = new FileProjectItem(project, ItemType.None);
			mapItem.Include = Path.Combine(relativePath, "Reference.map");
			mapItem.SetEvaluatedMetadata("Generator", "MSDiscoCodeGenerator");
			mapItem.SetEvaluatedMetadata("LastGenOutput", "Reference.cs");
			items.Add(mapItem);
			
			// System.Web.Services reference.
			if (!ProjectContainsWebServicesReference(project)) {
				ReferenceProjectItem webServicesReferenceItem = new ReferenceProjectItem(project, "System.Web.Services");
				items.Add(webServicesReferenceItem);
			}
			return items;
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:51,代码来源:WebReference.cs

示例3: CopyFileHere

		/// <summary>
		/// Copies or moves a file node (and the corresponding file, if applicable) to this directory,
		/// discarding its DependentUpon value.
		/// </summary>
		/// <param name="fileNode">The file node to copy or move.</param>
		/// <param name="performMove">true to move the file node, false to copy it.</param>
		public void CopyFileHere(FileNode node, bool performMove)
		{
			if (node.FileNodeStatus == FileNodeStatus.None) {
				AddExistingItemsToProject.CopyFile(node.FileName, this, false);
				if (performMove) {
					FileService.RemoveFile(node.FileName, false);
				}
			} else if (node.IsLink) {
				string relFileName = FileUtility.GetRelativePath(Project.Directory, node.FileName);
				FileNode fileNode = new FileNode(node.FileName, FileNodeStatus.InProject);
				FileProjectItem fileProjectItem = new FileProjectItem(Project, Project.GetDefaultItemType(node.FileName));
				fileProjectItem.Include = relFileName;
				fileProjectItem.SetEvaluatedMetadata("Link", Path.Combine(RelativePath, Path.GetFileName(node.FileName)));
				fileNode.ProjectItem = fileProjectItem;
				fileNode.InsertSorted(this);
				ProjectService.AddProjectItem(Project, fileProjectItem);
				if (performMove) {
					ProjectService.RemoveProjectItem(node.Project, node.ProjectItem);
					node.Remove();
				}
			} else {
				CopyFileHere(node.FileName, performMove);
			}
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:30,代码来源:DirectoryNode.cs

示例4: EnsureOutputFileIsInProject

		public FileProjectItem EnsureOutputFileIsInProject(FileProjectItem baseItem, string outputFileName, bool isPrimaryOutput)
		{
			if (baseItem == null)
				throw new ArgumentNullException("baseItem");
			if (baseItem.Project != project)
				throw new ArgumentException("baseItem is not from project this CustomToolContext belongs to");
			
			WorkbenchSingleton.AssertMainThread();
			bool saveProject = false;
			if (isPrimaryOutput) {
				if (baseItem.GetEvaluatedMetadata("LastGenOutput") != Path.GetFileName(outputFileName)) {
					saveProject = true;
					baseItem.SetEvaluatedMetadata("LastGenOutput", Path.GetFileName(outputFileName));
				}
			}
			FileProjectItem outputItem = project.FindFile(outputFileName);
			if (outputItem == null) {
				outputItem = new FileProjectItem(project, ItemType.Compile);
				outputItem.FileName = outputFileName;
				outputItem.DependentUpon = Path.GetFileName(baseItem.FileName);
				outputItem.SetEvaluatedMetadata("AutoGen", "True");
				ProjectService.AddProjectItem(project, outputItem);
				FileService.FireFileCreated(outputFileName, false);
				saveProject = true;
				ProjectBrowserPad.RefreshViewAsync();
			}
			if (saveProject)
				project.Save();
			return outputItem;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:30,代码来源:CustomTool.cs


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