C# Class WinRTXamlToolkit.IO.Extensions.StorageItemExtensions

Extension methods for IStorageItem (StorageFile and others).
显示文件 Open project: xyzzer/WinRTXamlToolkit

Public Methods

Method Description
GetFreeSpaceAsync ( this sf ) : Task

Returns the free space of the storage associate with the given storage item.

GetSizeAsync ( this file ) : Task

Gets the file size in bytes.

GetSizeString ( this sizeInB ) : string

Gets the file size string given size in bytes.

GetSizeString ( this sizeInB, double promoteLimit = 1024, double decimalLimit = 10, string separator = " " ) : string

Gets the file size string given size in bytes.

Method Details

GetFreeSpaceAsync() public static method

Returns the free space of the storage associate with the given storage item.
public static GetFreeSpaceAsync ( this sf ) : Task
sf this Storage item
return Task

GetSizeAsync() public static method

Gets the file size in bytes.
public static GetSizeAsync ( this file ) : Task
file this The file.
return Task

GetSizeString() public static method

Gets the file size string given size in bytes.
public static GetSizeString ( this sizeInB ) : string
sizeInB this The size in B.
return string

GetSizeString() public static method

Gets the file size string given size in bytes.
public static GetSizeString ( this sizeInB, double promoteLimit = 1024, double decimalLimit = 10, string separator = " " ) : string
sizeInB this The size in B.
promoteLimit double Specifies the number of units at which to promote to the next unit. Default is 1024. E.g. if the value is 1024 - for sizeInB of 1023 the result is 1023B, while for 1024 - 1kB.
decimalLimit double Defines the minimum number of units for which to produce results without decimal places. For lower values - results will include decimal places. Default is 10 which yields 9.8kB or 9.9kB, but yields "10kB" for both 10240B and 11263B.
separator string Separator between the value and the unit. Space by default. Typically should be either space or empty string.
return string