Class PolarFileInfo
- Namespace
- PolarStudioGlobals
- Assembly
- PolarStudioGlobals.dll
This class returns info about one item in a PolarFileInfos collection and provides some basic manipulation methods.
public class PolarFileInfo
- Inheritance
-
PolarFileInfo
- Inherited Members
- Extension Methods
Constructors
PolarFileInfo(string)
Constructor to create a single PolarFileInfo for a specific path.
public PolarFileInfo(string pPath)
Parameters
pPath
string
Fields
IsDirectory
Returns True if the item is a folder (directory).
public bool IsDirectory
Field Value
Properties
Attributes
Returns the attributes of the file/folder.
public FileAttributes Attributes { get; }
Property Value
DirectoryInfo
Returns the underlying DirectoryInfo for a directory (folder).
public DirectoryInfo DirectoryInfo { get; }
Property Value
FileDateTime
Returns the date/time of the file/folder (for files last modified, for folders created).
public DateTime FileDateTime { get; }
Property Value
FileInfo
Returns the underlying FileInfo for a file.
public FileInfo FileInfo { get; }
Property Value
FileName
Returns the file/folder name.
public string FileName { get; }
Property Value
FilePath
Returns the containing path (excluding the file/folder name)
public string FilePath { get; }
Property Value
FileSize
Returns the size of the file. (0 for folders).
public long FileSize { get; }
Property Value
FullPath
Returns the full path (including the file/folder name)
public string FullPath { get; }
Property Value
Methods
Copy(string)
Copies the file to a new location. Does not work on folders.
public bool Copy(string pNewFileName)
Parameters
pNewFileName
stringThe new file name (location).
Returns
- bool
True if successful, False otherwise (does not throw exceptions).
DeleteFile(bool)
Deletes a file or folder.
public bool DeleteFile(bool pRecursive = false)
Parameters
pRecursive
boolThis parameter can be passed as True to recursively delete a folder and all of its sub folders and contents.
Returns
- bool
True if successful, False otherwise (does not throw exceptions).
GetSelectionInfo()
Gets a selection from a folder (one or more files) for more complex operations.
public PolarFileInfo_Selection GetSelectionInfo()
Returns
- PolarFileInfo_Selection
A PolarFileInfo_Selection object with the selected files.
Rename(string)
Renames (moves) a file or folder.
public bool Rename(string pNewFileName)
Parameters
pNewFileName
stringThe new name/location of the file or folder.
Returns
- bool
True if successful, False otherwise (does not throw exceptions).