cross-platform-generator
Public Member Functions | Properties | Private Member Functions | Private Attributes
cpg.VariableEditor Class Reference

Back end for the variable editor. More...

Inheritance diagram for cpg.VariableEditor:

Public Member Functions

 VariableEditor (Variable variable, VariableList owner)
 Constructor for the editor sets the appropriate datacontext and sets up callbacks. More...
 

Properties

Variable result [get, private set]
 the variable with all modifications applied
 

Private Member Functions

void List_editor_OnListItemChanged (ListEditor sender, string new_value, string old_value)
 Callback for when the value of a list item changes. More...
 
void SetupVariable (VariableTypes type)
 Sets up a new variable. More...
 
void type_selector_SelectionChanged (object sender, SelectionChangedEventArgs e)
 Callback for when the type the variable was changed. More...
 
void name_value_FinalTextChanged (object sender, TextChangedEventArgs e)
 Callback for when the name of the varable was changed. More...
 
bool ValidateString (string value)
 Checks if a string contaains an invalid charcater. Used for validating the name of varibles. More...
 
void OkButton_Click (object sender, RoutedEventArgs e)
 Callback for when the 'ok' button is pressed. this closes the editor and sets the dialg result to true. More...
 
void CancelButton_Click (object sender, RoutedEventArgs e)
 Callback for when the 'cancel' button is pressed. this closes the editor and sets the dialg result to false. More...
 

Private Attributes

Variable base_
 The variable that is being edited.
 
readonly string invalid_chars = "@:\\|&#!*()[] {};'.<>?/$%~-+"
 List of chars that are forbidden in the textboxes.
 
readonly VariableList owner_
 The owner of the variable we're editing.
 
ulong [] ascii_mask
 Mask of invalid ascii characters created from the invalid chars string. used for validation.
 

Detailed Description

Back end for the variable editor.

Author
Stan Pepels

Constructor & Destructor Documentation

◆ VariableEditor()

cpg.VariableEditor.VariableEditor ( Variable  variable,
VariableList  owner 
)
inline

Constructor for the editor sets the appropriate datacontext and sets up callbacks.

Parameters
[in]varaiable(cpg.Variable) Varibale to edit.
[in]owner(spg.VariableList) The owner of the variable we're editing.

Member Function Documentation

◆ CancelButton_Click()

void cpg.VariableEditor.CancelButton_Click ( object  sender,
RoutedEventArgs  e 
)
inlineprivate

Callback for when the 'cancel' button is pressed. this closes the editor and sets the dialg result to false.

Parameters
[in]sender(object) The sender of the event.
[in]e(RoutedEventArgs) Arguments send with the event

◆ List_editor_OnListItemChanged()

void cpg.VariableEditor.List_editor_OnListItemChanged ( ListEditor  sender,
string  new_value,
string  old_value 
)
inlineprivate

Callback for when the value of a list item changes.

Parameters
[in]sender(ListEditor) The list editor that edited the variable
[in]new_value(string) The new value of the list item.
[in]old_value(string) The previous value of the list item.
Remarks
This method is only called when the variable is a list.

◆ name_value_FinalTextChanged()

void cpg.VariableEditor.name_value_FinalTextChanged ( object  sender,
TextChangedEventArgs  e 
)
inlineprivate

Callback for when the name of the varable was changed.

Parameters
[in]sender(object) The sender of the event.
[in]e(cpg.TextChangedEventArgs) The new and old value for the name.

◆ OkButton_Click()

void cpg.VariableEditor.OkButton_Click ( object  sender,
RoutedEventArgs  e 
)
inlineprivate

Callback for when the 'ok' button is pressed. this closes the editor and sets the dialg result to true.

Parameters
[in]sender(object) The sender of the event.
[in]e(RoutedEventArgs) Arguments send with the event

◆ SetupVariable()

void cpg.VariableEditor.SetupVariable ( VariableTypes  type)
inlineprivate

Sets up a new variable.

Parameters
[in]type(cpg.VariableTypes) The type of variable to be created.

◆ type_selector_SelectionChanged()

void cpg.VariableEditor.type_selector_SelectionChanged ( object  sender,
SelectionChangedEventArgs  e 
)
inlineprivate

Callback for when the type the variable was changed.

Parameters
[in]sender(object) The sender of the event.
[in]e(SelectionChangedEventArgs) Information about how the selection changed.

◆ ValidateString()

bool cpg.VariableEditor.ValidateString ( string  value)
inlineprivate

Checks if a string contaains an invalid charcater. Used for validating the name of varibles.

Parameters
[in]value(string) The string to be validated.
Returns
(bool) results in true if the string does not contain any invalid characters.

The documentation for this class was generated from the following file: