Beispiel #1
0
        protected override Task <string?> GetDefaultFileAsync(IProjectTreeProvider provider, IProjectTree root)
        {
            string?projectPath = provider.GetRootedAddNewItemDirectory(root);

            if (projectPath == null)  // Root has DisableAddItem
            {
                return(Task.FromResult <string?>(null));
            }

            string path = Path.Combine(projectPath, _fileName);

            return(Task.FromResult <string?>(path));
        }
        protected override async Task <string?> GetDefaultFileAsync(IProjectTreeProvider provider, IProjectTree root)
        {
            string?projectPath = provider.GetRootedAddNewItemDirectory(root);

            if (projectPath == null)  // Root has DisableAddItem
            {
                return(null);
            }

            string?folderName = await GetDefaultAppDesignerFolderNameAsync();

            if (string.IsNullOrEmpty(folderName))
            {
                return(null); // Developer has set the AppDesigner path to empty
            }
            return(Path.Combine(projectPath, folderName));
        }
 private string?GetFilePath(IProjectTreeProvider provider, IProjectTree node)
 {
     return(_isFolder ? provider.GetRootedAddNewItemDirectory(node) : provider.GetPath(node));
 }