Interface IIconService
Responsible for Icon Management
Namespace: Simplic.Icon
Assembly: Simplic.Icon.dll
Syntax
public interface IIconService
Methods
| Improve this Doc View SourceDelete(Icon)
Deletes an icon from db, cache and file system
Declaration
bool Delete(Icon icon)
Parameters
Type | Name | Description |
---|---|---|
Icon | icon |
Returns
Type | Description |
---|---|
System.Boolean | true if successful |
Delete(Guid)
Deletes an icon from db, cache and file system
Declaration
bool Delete(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Icon Id |
Returns
Type | Description |
---|---|
System.Boolean | true if successful |
GenerateChecksum(IList<Byte[]>)
Generates a checksum looping through all bytes it has given asa parameter
Declaration
string GenerateChecksum(IList<byte[]> icons)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<System.Byte[]> | icons | List of bytes |
Returns
Type | Description |
---|---|
System.String | Checksum hash |
GetAll()
Gets all icons in the database
Declaration
IEnumerable<Icon> GetAll()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Icon> | A list of Icon |
GetById(Guid)
Gets a byte array of an icon of a given Guid
Declaration
byte[] GetById(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Icon Id |
Returns
Type | Description |
---|---|
System.Byte[] | Icon as Byte[] |
GetByIdAsIcon(Guid)
Gets an icon object of a given Guid
Declaration
Icon GetByIdAsIcon(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Icon Id |
Returns
Type | Description |
---|---|
Icon | Icon |
GetByIdAsImage(Guid)
Gets a image of an icon of a given Guid
Declaration
BitmapImage GetByIdAsImage(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Icon Id |
Returns
Type | Description |
---|---|
System.Windows.Media.Imaging.BitmapImage | Icon as System.Windows.Media.Imaging.BitmapImage |
GetByName(String)
Gets a byte array of an icon of a given name
Declaration
byte[] GetByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Icon name |
Returns
Type | Description |
---|---|
System.Byte[] | Icon as Byte[] |
GetByNameAsImage(String)
Returns a System.Windows.Media.Imaging.BitmapImage by a given name of an icon
Declaration
BitmapImage GetByNameAsImage(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Icon name to be searched |
Returns
Type | Description |
---|---|
System.Windows.Media.Imaging.BitmapImage | System.Windows.Media.Imaging.BitmapImage by a given name of an icon |
GetSystemIcon(String, SystemIconSize, Boolean)
Get system icon by file extension
Declaration
Icon GetSystemIcon(string name, SystemIconSize size = SystemIconSize.Large, bool linkOverlay = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | File extension |
SystemIconSize | size | Icon size |
System.Boolean | linkOverlay | Using an icon overlay |
Returns
Type | Description |
---|---|
System.Drawing.Icon | Icon system (system drawing) |
GetSystemIconAsImage(String, SystemIconSize, Boolean)
Get system icon by file extension or system name as image
Declaration
Image GetSystemIconAsImage(string name, SystemIconSize size = SystemIconSize.Large, bool linkOverlay = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | System icon name or file extension |
SystemIconSize | size | Icon size |
System.Boolean | linkOverlay | Using an icon overlay |
Returns
Type | Description |
---|---|
System.Windows.Controls.Image | Icon as image (system drawing) |
Save(Icon)
Inserts or updates an icon
Declaration
bool Save(Icon icon)
Parameters
Type | Name | Description |
---|---|---|
Icon | icon | Icon object to save |
Returns
Type | Description |
---|---|
System.Boolean | true if successful |
SaveChecksumToDb(String)
Saves the checksum value to the database (in the configuration table)
Declaration
void SaveChecksumToDb(string checksum)
Parameters
Type | Name | Description |
---|---|---|
System.String | checksum | Checksum hash to be saved |
Search(String)
Gets a list of icons filtered out by their name
Declaration
IEnumerable<Icon> Search(string searchText)
Parameters
Type | Name | Description |
---|---|---|
System.String | searchText |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Icon> |
SyncFilesFromDatabase()
Compares checksums between db and filesystem. If they differ, reads all the icons from the database and writes them down and creates a new checksum
Declaration
bool SyncFilesFromDatabase()
Returns
Type | Description |
---|---|
System.Boolean | true if successful |