C# Class Artemis.DAL.ProfileProvider

显示文件 Open project: SpoinkyNL/Artemis

Public Methods

Method Description
AddOrUpdate ( ProfileModel prof ) : void

Adds or update the given profile. Updates occur when a profile with the same name and game exist.

DeleteProfile ( ProfileModel prof ) : void
ExportProfile ( ProfileModel prof, string path ) : void

Exports the given profile to the provided path in XML

GetAll ( ) : List

Get all profiles

GetAll ( EffectModel game, KeyboardProvider keyboard ) : List

Get all profiles matching the provided game

InsertGif ( IEnumerable profileModels, string layerName, Bitmap gifFile, string fileName ) : void
LoadProfileIfValid ( string path ) : ProfileModel

Attempts to load a profile from a given path

RenameProfile ( ProfileModel profile, string name ) : void

Renames the profile on the model and filesystem

Private Methods

Method Description
CheckProfiles ( ) : void

Makes sure the profile directory structure is in order and places default profiles

InstallDefaults ( ) : void

Unpacks the default profiles into the profile directory

ReadProfiles ( ) : void

Method Details

AddOrUpdate() public static method

Adds or update the given profile. Updates occur when a profile with the same name and game exist.
public static AddOrUpdate ( ProfileModel prof ) : void
prof Artemis.Profiles.ProfileModel The profile to add or update
return void

DeleteProfile() public static method

public static DeleteProfile ( ProfileModel prof ) : void
prof Artemis.Profiles.ProfileModel
return void

ExportProfile() public static method

Exports the given profile to the provided path in XML
public static ExportProfile ( ProfileModel prof, string path ) : void
prof Artemis.Profiles.ProfileModel The profile to export
path string The path to save the profile to
return void

GetAll() public static method

Get all profiles
public static GetAll ( ) : List
return List

GetAll() public static method

Get all profiles matching the provided game
public static GetAll ( EffectModel game, KeyboardProvider keyboard ) : List
game Artemis.Models.EffectModel The game to match
keyboard Artemis.DeviceProviders.KeyboardProvider The keyboard to match
return List

InsertGif() public static method

public static InsertGif ( IEnumerable profileModels, string layerName, Bitmap gifFile, string fileName ) : void
profileModels IEnumerable
layerName string
gifFile System.Drawing.Bitmap
fileName string
return void

LoadProfileIfValid() public static method

Attempts to load a profile from a given path
public static LoadProfileIfValid ( string path ) : ProfileModel
path string The absolute path to load the profile from
return Artemis.Profiles.ProfileModel

RenameProfile() public static method

Renames the profile on the model and filesystem
public static RenameProfile ( ProfileModel profile, string name ) : void
profile Artemis.Profiles.ProfileModel The profile to rename
name string The new name
return void