C# 클래스 Utilities.IO.Extensions.DirectoryInfoExtensions

Extension methods for System.IO.DirectoryInfo
파일 보기 프로젝트 열기: feanz/Utilities

공개 메소드들

메소드 설명
CopyTo ( this source, string destination, bool recursive = true, CopyOptions options = CopyOptions.CopyAlways ) : DirectoryInfo

Copies a directory to another location

DeleteAll ( this directory ) : void

Deletes directory and all content found within it

DeleteFiles ( this directory, bool recursive = false ) : DirectoryInfo

Deletes files from a directory

DeleteFilesNewerThan ( this directory, System.DateTime compareDate, bool recursive = false ) : DirectoryInfo

Deletes files newer than the specified date

DeleteFilesOlderThan ( this directory, System.DateTime compareDate, bool recursive = false ) : DirectoryInfo

Deletes files older than the specified date

SetAttributes ( this directory, FileAttributes attributes, bool recursive = false ) : DirectoryInfo

Sets a directory's attributes

Size ( this directory, string searchPattern = "*", bool recursive = false ) : long

Gets the size of all files within a directory

메소드 상세

CopyTo() 공개 정적인 메소드

Copies a directory to another location
public static CopyTo ( this source, string destination, bool recursive = true, CopyOptions options = CopyOptions.CopyAlways ) : DirectoryInfo
source this Source directory
destination string Destination directory
recursive bool Should the copy be recursive
options CopyOptions Options used in copying
리턴 System.IO.DirectoryInfo

DeleteAll() 공개 정적인 메소드

Deletes directory and all content found within it
public static DeleteAll ( this directory ) : void
directory this Directory info object
리턴 void

DeleteFiles() 공개 정적인 메소드

Deletes files from a directory
public static DeleteFiles ( this directory, bool recursive = false ) : DirectoryInfo
directory this Directory to delete the files from
recursive bool Should this be recursive?
리턴 System.IO.DirectoryInfo

DeleteFilesNewerThan() 공개 정적인 메소드

Deletes files newer than the specified date
public static DeleteFilesNewerThan ( this directory, System.DateTime compareDate, bool recursive = false ) : DirectoryInfo
directory this Directory to look within
compareDate System.DateTime The date to compare to
recursive bool Is this a recursive call
리턴 System.IO.DirectoryInfo

DeleteFilesOlderThan() 공개 정적인 메소드

Deletes files older than the specified date
public static DeleteFilesOlderThan ( this directory, System.DateTime compareDate, bool recursive = false ) : DirectoryInfo
directory this Directory to look within
compareDate System.DateTime The date to compare to
recursive bool Is this a recursive call
리턴 System.IO.DirectoryInfo

SetAttributes() 공개 정적인 메소드

Sets a directory's attributes
public static SetAttributes ( this directory, FileAttributes attributes, bool recursive = false ) : DirectoryInfo
directory this Directory
attributes FileAttributes Attributes to set
recursive bool Determines if this is a recursive call
리턴 System.IO.DirectoryInfo

Size() 공개 정적인 메소드

Gets the size of all files within a directory
public static Size ( this directory, string searchPattern = "*", bool recursive = false ) : long
directory this Directory
searchPattern string Search pattern used to tell what files to include (defaults to all)
recursive bool determines if this is a recursive call or not
리턴 long