本文整理汇总了C#中ProjectElement.AddDiskFile方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectElement.AddDiskFile方法的具体用法?C# ProjectElement.AddDiskFile怎么用?C# ProjectElement.AddDiskFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectElement
的用法示例。
在下文中一共展示了ProjectElement.AddDiskFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadRootFiles
protected virtual void LoadRootFiles(ProjectElement project, XmlDocument lDoc, string lProjectDir, string lProjectLangTag)
{
string query = "VisualStudioProject/Files/File";
XmlNodeList files = lDoc.SelectNodes(query);
int count = files.Count;
for (int i = 0; i < count; i++)
{
System.Xml.XmlNode fileNode = files[i];
System.Xml.XmlNode relPath = fileNode.Attributes.GetNamedItem("RelativePath");
string lFilePath = Path.Combine(lProjectDir, relPath.Value);
project.AddDiskFile(lFilePath);
}
}
示例2: LoadFilesFromPath
private void LoadFilesFromPath(ProjectElement project, string path)
{
string[] files = Directory.GetFiles(path);
foreach (string filePath in files)
{
SourceFile proxy = project.AddDiskFile(filePath);
proxy.BuildProjectSymbols();
}
string[] directories = Directory.GetDirectories(path);
foreach (string directory in directories)
{
LoadFilesFromPath(project, directory);
}
}
示例3: LoadFiles
protected virtual void LoadFiles(ProjectElement project, XmlDocument lDoc, string lProjectDir, string lProjectLangTag)
{
string lFilesQuery = GetFilesQuery(lProjectLangTag);
XmlNodeList lFiles = lDoc.SelectNodes(lFilesQuery);
int lCount = lFiles.Count;
for (int i = 0; i < lCount; i++)
{
System.Xml.XmlNode lFileNode = lFiles[i];
System.Xml.XmlNode lRelPath = lFileNode.Attributes.GetNamedItem(STR_RelPath);
string lFilePath = Path.Combine(lProjectDir, lRelPath.Value);
SourceFile proxy = project.AddDiskFile(lFilePath);
proxy.BuildProjectSymbols();
}
}
示例4: LoadBuildItems
private void LoadBuildItems(ProjectElement project, string projectDir, IEnumerable<BuildItem> items)
{
if (project == null || string.IsNullOrEmpty(projectDir) || items == null)
{
return;
}
foreach (BuildItem item in items)
{
string spec = item.FinalItemSpec;
string filePath = Path.Combine(projectDir, spec);
SourceFile proxy = project.AddDiskFile(filePath);
proxy.BuildProjectSymbols();
}
}