src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/SpecialFileProviders/AbstractSpecialFileProvider.cs
/// <summary>
/// Find a file with the given file name. The algorithm used is :
///       Look under the appdesigner folder for files that normally live there.
///       Look under the project root for all files.
/// </summary>
Find a file with the given file name. The algorithm used is :
Look under the appdesigner folder for files that normally live there.
Look under the project root for all files.
Find a file with the given file name . The algorithm used is : Look under the appdesigner folder for files that normally live there . Look under the project root for all files .
protected virtual async Task<IProjectTree> FindFileAsync(string specialFileName)
        {
            IProjectTree rootNode = _projectTree.CurrentTree;
            IProjectTree specialFileNode;
            if (CreatedByDefaultUnderAppDesignerFolder)
            {
                IProjectTree appDesignerFolder = await GetAppDesignerFolderAsync(createIfNotExists: false).ConfigureAwait(false);
                if (appDesignerFolder != null)
                {
                    specialFileNode = FindFileWithinNode(appDesignerFolder, specialFileName);
                    if (specialFileNode != null)
                    {
                        return specialFileNode;
                    }
                }
            }
            specialFileNode = FindFileWithinNode(rootNode, specialFileName);
            if (specialFileNode != null)
            {
                return specialFileNode;
            }
            return null;
        }
protected virtual async Task < IProjectTree > FindFileAsync ( string specialFileName ) { IProjectTree rootNode = _projectTree . CurrentTree ; IProjectTree specialFileNode ; if ( CreatedByDefaultUnderAppDesignerFolder ) { IProjectTree appDesignerFolder = await GetAppDesignerFolderAsync ( createIfNotExists : false ) . ConfigureAwait ( false ) ; if ( appDesignerFolder != null ) { specialFileNode = FindFileWithinNode ( appDesignerFolder , specialFileName ) ; if ( specialFileNode != null ) { return specialFileNode ; } } } specialFileNode = FindFileWithinNode ( rootNode , specialFileName ) ; if ( specialFileNode != null ) { return specialFileNode ; } return null ; }
Find a file with the given file name.
Find a file with the given file name .
// First, we look in the AppDesigner folder. // Now try the root folder.
specialFileName
string