C# Class vimage.Config

Show file Open project: Torrunt/vimage Class Usage Examples

Public Properties

Property Type Description
AltDown bool
ContextMenu List
ContextMenu_Animation List
Control_Close List
Control_Copy List
Control_CopyAsImage List
Control_Delete List
Control_Drag List
Control_FitToMonitorAlt List
Control_FitToMonitorAuto List
Control_FitToMonitorHeight List
Control_FitToMonitorWidth List
Control_Flip List
Control_NextFrame List
Control_NextImage List
Control_OpenAtLocation List
Control_OpenConfig List
Control_OpenContextMenu List
Control_OpenDuplicateImage List
Control_PauseAnimation List
Control_PrevFrame List
Control_PrevImage List
Control_RandomImage List
Control_ReloadConfig List
Control_ResetImage List
Control_RotateAntiClockwise List
Control_RotateClockwise List
Control_ToggleAlwaysOnTop List
Control_ToggleBackgroundForTransparency List
Control_ToggleSmoothing List
Control_ZoomAlt List
Control_ZoomFaster List
CtrlDown bool
CustomActionBindings List
CustomActions List
ShiftDown bool

Public Methods

Method Description
Config ( ) : System
ControlToString ( object code ) : string

Converts Keyboard.Key or Mouse.Button to their string name.

ControlsToString ( List controls ) : string

Converts list of controls (Keyboard.Key and Mouse.Button) to their string names seperated by commas.

Init ( ) : void
IsControl ( Keyboard keyCode, List Control ) : bool

Returns true if Keyboard.Key is one of Control bindings.

IsControl ( Mouse code, List Control ) : bool

Returns true if Mouse.Button is one of Control bindings.

IsControl ( object code, List Control ) : bool

Returns true if code is one of Control bindings.

KeyToString ( Keyboard key ) : string

Converts SFML Keyboard.Key to upper-case string.

Load ( string configFile ) : void

Loads and parses a config txt file. If it doesn't exist, a default one will be made.

MouseButtonToString ( int code ) : string
Save ( string configFile ) : void

Saves settings to config txt file.

SetControls ( List controls ) : void
SetDefaultContextMenu ( ) : void
SetDefaultControls ( ) : void
SetDefaultCustomActions ( ) : void
StringToControls ( string str ) : List
StringToKey ( string str ) : Keyboard.Key

Converts upper-case string to SFML Keyboard.Key.

StringToMouseButton ( string str ) : int

Converts upper-case string to SFML Mouse.Button (as an int + offset).

UpdateControl ( string name, int bind ) : List

Private Methods

Method Description
ReadSection ( StreamReader reader, List setting, string sectionName = "" ) : string
RemoveSpaces ( string str ) : string
VariableAmountOfStrings ( int amount, string s ) : string
WriteComment ( StreamWriter writer, string comment = "" ) : void
WriteContextMenuItems ( StreamWriter writer, List items, int depth = 1 ) : void
WriteContextMenuSetup ( StreamWriter writer, string name, List contextMenu ) : void
WriteControl ( StreamWriter writer, string name, List controls ) : void
WriteCustomActionBindings ( StreamWriter writer, string name, List customActionBindings ) : void
WriteCustomActions ( StreamWriter writer, string name, List customActions ) : void
WriteSetting ( StreamWriter writer, string name, bool value, string comment = "" ) : void
WriteSetting ( StreamWriter writer, string name, int value, string comment = "" ) : void
WriteSetting ( StreamWriter writer, string name, string value, string comment = "" ) : void

Method Details

Config() public method

public Config ( ) : System
return System

ControlToString() public static method

Converts Keyboard.Key or Mouse.Button to their string name.
public static ControlToString ( object code ) : string
code object
return string

ControlsToString() public static method

Converts list of controls (Keyboard.Key and Mouse.Button) to their string names seperated by commas.
public static ControlsToString ( List controls ) : string
controls List
return string

Init() public method

public Init ( ) : void
return void

IsControl() public static method

Returns true if Keyboard.Key is one of Control bindings.
public static IsControl ( Keyboard keyCode, List Control ) : bool
keyCode Keyboard
Control List
return bool

IsControl() public static method

Returns true if Mouse.Button is one of Control bindings.
public static IsControl ( Mouse code, List Control ) : bool
code Mouse
Control List
return bool

IsControl() public static method

Returns true if code is one of Control bindings.
public static IsControl ( object code, List Control ) : bool
code object
Control List
return bool

KeyToString() public static method

Converts SFML Keyboard.Key to upper-case string.
public static KeyToString ( Keyboard key ) : string
key Keyboard
return string

Load() public method

Loads and parses a config txt file. If it doesn't exist, a default one will be made.
public Load ( string configFile ) : void
configFile string
return void

MouseButtonToString() public static method

public static MouseButtonToString ( int code ) : string
code int
return string

Save() public method

Saves settings to config txt file.
public Save ( string configFile ) : void
configFile string
return void

SetControls() public static method

public static SetControls ( List controls ) : void
controls List
return void

SetDefaultContextMenu() public method

public SetDefaultContextMenu ( ) : void
return void

SetDefaultControls() public method

public SetDefaultControls ( ) : void
return void

SetDefaultCustomActions() public method

public SetDefaultCustomActions ( ) : void
return void

StringToControls() public static method

public static StringToControls ( string str ) : List
str string
return List

StringToKey() public static method

Converts upper-case string to SFML Keyboard.Key.
public static StringToKey ( string str ) : Keyboard.Key
str string
return Keyboard.Key

StringToMouseButton() public static method

Converts upper-case string to SFML Mouse.Button (as an int + offset).
public static StringToMouseButton ( string str ) : int
str string
return int

UpdateControl() public method

public UpdateControl ( string name, int bind ) : List
name string
bind int
return List

Property Details

AltDown public static property

public static bool AltDown
return bool

ContextMenu public property

public List ContextMenu
return List

ContextMenu_Animation public property

public List ContextMenu_Animation
return List

Control_Close public property

public List Control_Close
return List

Control_Copy public property

public List Control_Copy
return List

Control_CopyAsImage public property

public List Control_CopyAsImage
return List

Control_Delete public property

public List Control_Delete
return List

Control_Drag public property

public List Control_Drag
return List

Control_FitToMonitorAlt public property

public List Control_FitToMonitorAlt
return List

Control_FitToMonitorAuto public property

public List Control_FitToMonitorAuto
return List

Control_FitToMonitorHeight public property

public List Control_FitToMonitorHeight
return List

Control_FitToMonitorWidth public property

public List Control_FitToMonitorWidth
return List

Control_Flip public property

public List Control_Flip
return List

Control_NextFrame public property

public List Control_NextFrame
return List

Control_NextImage public property

public List Control_NextImage
return List

Control_OpenAtLocation public property

public List Control_OpenAtLocation
return List

Control_OpenConfig public property

public List Control_OpenConfig
return List

Control_OpenContextMenu public property

public List Control_OpenContextMenu
return List

Control_OpenDuplicateImage public property

public List Control_OpenDuplicateImage
return List

Control_PauseAnimation public property

public List Control_PauseAnimation
return List

Control_PrevFrame public property

public List Control_PrevFrame
return List

Control_PrevImage public property

public List Control_PrevImage
return List

Control_RandomImage public property

public List Control_RandomImage
return List

Control_ReloadConfig public property

public List Control_ReloadConfig
return List

Control_ResetImage public property

public List Control_ResetImage
return List

Control_RotateAntiClockwise public property

public List Control_RotateAntiClockwise
return List

Control_RotateClockwise public property

public List Control_RotateClockwise
return List

Control_ToggleAlwaysOnTop public property

public List Control_ToggleAlwaysOnTop
return List

Control_ToggleBackgroundForTransparency public property

public List Control_ToggleBackgroundForTransparency
return List

Control_ToggleSmoothing public property

public List Control_ToggleSmoothing
return List

Control_ZoomAlt public property

public List Control_ZoomAlt
return List

Control_ZoomFaster public property

public List Control_ZoomFaster
return List

CtrlDown public static property

public static bool CtrlDown
return bool

CustomActionBindings public property

public List CustomActionBindings
return List

CustomActions public property

public List CustomActions
return List

ShiftDown public static property

public static bool ShiftDown
return bool