System.IO.FileSystem.DirectoryExists C# (CSharp) Méthode

DirectoryExists() public abstract méthode

public abstract DirectoryExists ( string fullPath ) : bool
fullPath string
Résultat bool
        public abstract bool DirectoryExists(string fullPath);
        public abstract void MoveDirectory(string sourceFullPath, string destFullPath);

Usage Example

Exemple #1
0
        public void ExportTo(string directory, Topic root, Func<Topic, string> pathing)
        {
            var fileSystem = new FileSystem();

            string sourceContent = _settings.Root.AppendPath("content");
            if (fileSystem.DirectoryExists(sourceContent))
            {
                fileSystem.CopyToDirectory(sourceContent, directory.AppendPath("content"));
            }

            root.AllTopicsInOrder().Each(topic =>
            {
                var path = pathing(topic);
                var parentDirectory = path.ParentUrl();

                if (parentDirectory.IsNotEmpty())
                {
                    fileSystem.CreateDirectory(directory.AppendPath(parentDirectory));
                }
                

                var text = _generator.Generate(topic);

                // Hoakum
                topic.Substitutions.Each((key, value) =>
                {
                    text = text.Replace(key, value);
                });

                fileSystem.WriteStringToFile(directory.AppendPath(path), text);
            });
        }
All Usage Examples Of System.IO.FileSystem::DirectoryExists