GH_AsynchFileData

References
This class provides asynchronous methods to keep tabs on a file.

Constructors

GH_AsynchFileData

#
public GH_AsynchFileData(string filePath, bool harvestThumbnail, FileChangedDelegate callback)
Asynchronous constructor. File properties will be loaded asychronously.
filePath (string)Location of file
harvestThumbnail (bool)If true, thumbnail data will be loaded.
callback (GH_AsynchFileData.FileChangedDelegate)Callback delegate for file changes.

Fields

FilePath

#
public readonly string FilePath
Gets the location this instance is watching.

IsLocal

#
public readonly bool IsLocal
Gets whether Grasshopper thinks the file it is watching is on a local machine.

Properties

Callback

#
public GH_AsynchFileData.FileChangedDelegate Callback { get; set; }
Gets or sets the callback delegate to be used when properties are updated.

FileCreated

#
public DateTime FileCreated { get; }
Gets the date at which the file was created.

FileExists

#
public bool FileExists { get; }
Gets whether the file exists. Note that this property returns false if DataExists=False, regardless of whether the file exists.

FileLastChanged

#
public DateTime FileLastChanged { get; }
Gets the date at which the file was last changed.

FileSize

#
public long FileSize { get; }
Gets the size of the file.

FileThumbnail

#
public Bitmap FileThumbnail { get; }
Gets the thumbnail bitmap associated with the file.

HarvestThumbnail

#
public bool HarvestThumbnail { get; set; }
Gets or sets whether the thumbnail ought to be parsed. At the moment this only makes sense for GH/GHX files.

IsFileData

#
public bool IsFileData { get; }
Gets whether the data has been retrieved at least once.

Methods

Dispose

#
public void Dispose()

UpdateProperties

#
public void UpdateProperties()
Updates all file properties on the thread on which this method is called.