C# Class SIL.FieldWorks.Common.Framework.PictureHolder

PictureHolder is a holding place for pictures that are useful to various windows through the lifetime of the application, and which should be disposed only when the whole application shuts down.
Inheritance: IDisposable
显示文件 Open project: sillsdev/FieldWorks Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void
GetComPicture ( string imagePath ) : IPicture

Get the image stored at the specified path as an IPicture. The PictureHolder remains responsible to dispose or release the picture as needed, typically when the application exits, so the client may keep and use it indefinitely.

GetPicture ( string key, Image source ) : IPicture

Get an IPicture corresponding to the specified key. If one is not known, obtain it from the source image, and save it for next time. The PictureHolder remains responsible for disposing or releasing the picture in either case.

ReleasePicture ( string key ) : void

Release any data that might prevent deleting the specified picture file

Protected Methods

Method Description
Dispose ( bool disposing ) : void

As a special case, this class does not HAVE to be disposed if it does not allow pictures.

Private Methods

Method Description
ReleasePicture ( IPicture picture ) : void

Method Details

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

As a special case, this class does not HAVE to be disposed if it does not allow pictures.
protected Dispose ( bool disposing ) : void
disposing bool
return void

GetComPicture() public method

Get the image stored at the specified path as an IPicture. The PictureHolder remains responsible to dispose or release the picture as needed, typically when the application exits, so the client may keep and use it indefinitely.
public GetComPicture ( string imagePath ) : IPicture
imagePath string
return IPicture

GetPicture() public method

Get an IPicture corresponding to the specified key. If one is not known, obtain it from the source image, and save it for next time. The PictureHolder remains responsible for disposing or releasing the picture in either case.
public GetPicture ( string key, Image source ) : IPicture
key string
source Image
return IPicture

ReleasePicture() public method

Release any data that might prevent deleting the specified picture file
public ReleasePicture ( string key ) : void
key string
return void