FromPath() public static méthode

public static FromPath ( IProject project, IProjectFolder parent, string filePath ) : File
project IProject
parent IProjectFolder
filePath string
Résultat File
        public static void PopulateFiles(FileSystemProject project, IProjectFolder folder)
        {
            var files = Directory.EnumerateFiles(folder.Location);

            files = files.Where(f => !IsExcluded(project.ExcludedFiles, project.CurrentDirectory.MakeRelativePath(f).ToAvalonPath()) && f != project.Location);

            foreach (var file in files)
            {
                var sourceFile = File.FromPath(project, folder, file.ToPlatformPath().NormalizePath());
                project.SourceFiles.InsertSorted(sourceFile);
                folder.Items.InsertSorted(sourceFile);
            }
        }
        public void AddFile(string fullPath)
        {
            var folder = FindFolder(Path.GetDirectoryName(fullPath) + "\\");

            var sourceFile = File.FromPath(this, folder, fullPath.ToPlatformPath());

            SourceFiles.InsertSorted(sourceFile);

            if (folder.Location == Project.CurrentDirectory)
            {
                Project.Items.InsertSorted(sourceFile);
                sourceFile.Parent = Project;
            }
            else
            {
                folder.Items.InsertSorted(sourceFile);
                sourceFile.Parent = folder;
            }

            FileAdded?.Invoke(this, new EventArgs());
        }