本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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;
}