本文整理汇总了C#中ProjectItem.FileName方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectItem.FileName方法的具体用法?C# ProjectItem.FileName怎么用?C# ProjectItem.FileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectItem
的用法示例。
在下文中一共展示了ProjectItem.FileName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveDependencies
public void RemoveDependencies(ProjectItem projectItem)
{
var filename = projectItem.FileName();
if (Dependencies.ContainsKey(filename))
Dependencies.Remove(filename);
RemoveDependenciesForFile(projectItem);
}
示例2: CheckDependencies
public bool CheckDependencies(ProjectItem projectItem)
{
var filename = projectItem.FileName();
var engine = EngineResolver.GetEngineByFilename(filename);
if (engine == null)
return false;
var contents = FileHandler.GetContents(filename);
SaveDependencies(projectItem, filename, contents, engine);
return true;
}
示例3: Run
public IEnumerable<FileAssociation> Run(ProjectItem projectItem)
{
var filename = projectItem.FileName();
var engine = EngineResolver.GetEngineByFilename(filename);
var result = new List<FileAssociation>();
TaskList.Remove(filename);
if (engine != null)
result.AddRange(ProcessEngine(projectItem, filename, engine));
var associations = RunDependencies(filename);
if (associations != null)
result.AddRange(associations);
return result;
}
示例4: CheckForConfigRefresh
public void CheckForConfigRefresh(ProjectItem projectItem)
{
string fullFileName = projectItem.FileName();
if (this.dependentFiles.ContainsKey(fullFileName)) {
foreach (string configFile in this.dependentFiles[fullFileName]
.Distinct(StringComparer.InvariantCultureIgnoreCase) // prevent the same config file from being fired multiple times
.ToArray()) {
// ToArray to prevent "Collection Modified" exceptions
this.Refresh(configFile);
}
}
if (projectItem.ProjectItems != null) {
foreach (ProjectItem projectItemInner in projectItem.ProjectItems.Cast<ProjectItem>().ToArray()) {
// ToArray to prevent "Collection Modified" exceptions
this.CheckForConfigRefresh(projectItemInner);
}
}
}
示例5: ProjectItemsEvents_ItemRenamed
private void ProjectItemsEvents_ItemRenamed(ProjectItem projectItem, string oldFileName)
{
if (EngineManager.IsTransformed(projectItem.FileName()))
{
// Now a chirp file
this.ProjectItemsEvents_ItemAdded(projectItem);
} else if (EngineManager.IsTransformed(oldFileName)) {
try {
VSProjectItemManager.DeleteAllItems(projectItem.ProjectItems);
this.tasks.Remove(oldFileName);
} catch (Exception e) {
this.OutputWindowWriteText("Exception was thrown when trying to rename file.\n" + e.ToString());
}
}
}
示例6: ProjectItemsEvents_ItemRemoved
private void ProjectItemsEvents_ItemRemoved(ProjectItem projectItem)
{
string fileName = projectItem.FileName();
this.tasks.Remove(fileName);
if (T4Engine.Handles(fileName) > 0) {
this.T4Engine.Run(fileName, projectItem);
}
}
示例7: ItemClosed
public void ItemClosed(ProjectItem projectItem)
{
Chirp.TaskList.Remove(projectItem.FileName());
}
示例8: ReloadFileDependencies
/// <summary>
/// build a dictionary that has the files that could change as the key.
/// for the value it is a LIST of config files that need updated if it does change.
/// so, when a .less.css file changes, we look in the list and rebuild any of the configs associated with it.
/// if a config file changes...this rebuild all of this....
/// </summary>
/// <param name="projectItem">project Item</param>
internal void ReloadFileDependencies(ProjectItem projectItem)
{
string configFileName = projectItem.FileName();
// remove all current dependencies for this config file...
foreach (string key in this.dependentFiles.Keys.ToArray()) {
List<string> files = this.dependentFiles[key];
if (files.Remove(configFileName) && files.Count == 0) {
this.dependentFiles.Remove(key);
}
}
IEnumerable<string> dependents;
if (IsLessFile(configFileName))
{
var root = System.IO.Path.GetDirectoryName(projectItem.ContainingProject.FullName);
var text = System.IO.File.ReadAllText(configFileName);
var imports = LessEngine.FindDependencies(configFileName, text, root);
dependents = imports.Where(x => x.IsFile).Select(x => x.LocalPath);
} else {
var fileGroups = this.LoadConfigFileGroups(configFileName);
dependents = fileGroups.SelectMany(x => x.Files).Select(x => x.Path);
}
foreach (var file in dependents) {
if (!this.dependentFiles.ContainsKey(file)) {
this.dependentFiles.Add(file, new List<string> { configFileName });
} else {
this.dependentFiles[file].Add(configFileName);
}
}
}