C# Class vimage.Config

Mostra 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_oe static_oe property

public static bool AltDown
return bool

ContextMenu public_oe property

public List ContextMenu
return List

ContextMenu_Animation public_oe property

public List ContextMenu_Animation
return List

Control_Close public_oe property

public List Control_Close
return List

Control_Copy public_oe property

public List Control_Copy
return List

Control_CopyAsImage public_oe property

public List Control_CopyAsImage
return List

Control_Delete public_oe property

public List Control_Delete
return List

Control_Drag public_oe property

public List Control_Drag
return List

Control_FitToMonitorAlt public_oe property

public List Control_FitToMonitorAlt
return List

Control_FitToMonitorAuto public_oe property

public List Control_FitToMonitorAuto
return List

Control_FitToMonitorHeight public_oe property

public List Control_FitToMonitorHeight
return List

Control_FitToMonitorWidth public_oe property

public List Control_FitToMonitorWidth
return List

Control_Flip public_oe property

public List Control_Flip
return List

Control_NextFrame public_oe property

public List Control_NextFrame
return List

Control_NextImage public_oe property

public List Control_NextImage
return List

Control_OpenAtLocation public_oe property

public List Control_OpenAtLocation
return List

Control_OpenConfig public_oe property

public List Control_OpenConfig
return List

Control_OpenContextMenu public_oe property

public List Control_OpenContextMenu
return List

Control_OpenDuplicateImage public_oe property

public List Control_OpenDuplicateImage
return List

Control_PauseAnimation public_oe property

public List Control_PauseAnimation
return List

Control_PrevFrame public_oe property

public List Control_PrevFrame
return List

Control_PrevImage public_oe property

public List Control_PrevImage
return List

Control_RandomImage public_oe property

public List Control_RandomImage
return List

Control_ReloadConfig public_oe property

public List Control_ReloadConfig
return List

Control_ResetImage public_oe property

public List Control_ResetImage
return List

Control_RotateAntiClockwise public_oe property

public List Control_RotateAntiClockwise
return List

Control_RotateClockwise public_oe property

public List Control_RotateClockwise
return List

Control_ToggleAlwaysOnTop public_oe property

public List Control_ToggleAlwaysOnTop
return List

Control_ToggleBackgroundForTransparency public_oe property

public List Control_ToggleBackgroundForTransparency
return List

Control_ToggleSmoothing public_oe property

public List Control_ToggleSmoothing
return List

Control_ZoomAlt public_oe property

public List Control_ZoomAlt
return List

Control_ZoomFaster public_oe property

public List Control_ZoomFaster
return List

CtrlDown public_oe static_oe property

public static bool CtrlDown
return bool

CustomActionBindings public_oe property

public List CustomActionBindings
return List

CustomActions public_oe property

public List CustomActions
return List

ShiftDown public_oe static_oe property

public static bool ShiftDown
return bool