AvalonStudio.Projects.File.FromPath C# (CSharp) Méthode

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 File FromPath(IProject project, IProjectFolder parent, string filePath)
        {
            return new File { Project = project, Parent = parent, FilePath = filePath.ToPlatformPath() };
        }

Usage Example

        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);
            }
        }
All Usage Examples Of AvalonStudio.Projects.File::FromPath