C# Class BaconGame.GamePresenter

Controls presentation and layout of an IGameMainForm
Show file Open project: Revelations/BaconApp Class Usage Examples

Public Methods

Method Description
AddQuestion ( ) : void

Creates a new blank question and appends it to the question view.

ClearTextFields ( ) : void

Clears each of the text and combo boxes in the view.

ConfirmDelete ( ) : bool

Brings up a confirmation of question deletion dialog.

CreateNeededQuestionFiles ( ) : void

Creates missing question files from the html files present on the server.

DepopulateQuestionView ( ) : void

Clears the question view.

DownloadSync ( ) : void

Opens a sync dialog to download necessary files.

GamePresenter ( IGameMainForm view ) : Common.System

Constructor accepting a single argument.

LoadTextFields ( ) : void

Loads the contents of the currently selected question into the text and combo boxes.

PopulateFileView ( ) : void

Populates the file view with any question files stored in the local directory.

PopulateQuestionView ( string questionFile ) : void

Populates the question view with questions, based on the selected question file.

RemoveQuestion ( ) : void

Deletes a selected question and removes it from the question box.

SaveOpen ( ) : void

Saves any open questions and question files.

SaveQuestion ( int index ) : void

Saves the question at a given index of the question view.

SaveQuestionFile ( string fileName ) : void

Saves the set of currently selected questions to a file.

ShowError ( string error ) : void

Shows an error dialog to the user.

UpdateAnswer ( ) : void

Updates the modified answer to a question in the question view.

UploadSync ( ) : void

Opens a sync dialog to upload necessary files.

UploadSync ( FormClosingEventArgs e ) : void

Opens a sync dialog to upload necessary files on form exit. First displays a confirmation to the user.

Private Methods

Method Description
AddQuestionToView ( Question q ) : void

Adds a single question to the question view.

InitComboBox ( Question q ) : void

Populates the combo box with a list of possible answers to select from.

Method Details

AddQuestion() public method

Creates a new blank question and appends it to the question view.
public AddQuestion ( ) : void
return void

ClearTextFields() public method

Clears each of the text and combo boxes in the view.
public ClearTextFields ( ) : void
return void

ConfirmDelete() public method

Brings up a confirmation of question deletion dialog.
public ConfirmDelete ( ) : bool
return bool

CreateNeededQuestionFiles() public method

Creates missing question files from the html files present on the server.
public CreateNeededQuestionFiles ( ) : void
return void

DepopulateQuestionView() public method

Clears the question view.
public DepopulateQuestionView ( ) : void
return void

DownloadSync() public method

Opens a sync dialog to download necessary files.
public DownloadSync ( ) : void
return void

GamePresenter() public method

Constructor accepting a single argument.
public GamePresenter ( IGameMainForm view ) : Common.System
view IGameMainForm The form that this presenter controls the layout for.
return Common.System

LoadTextFields() public method

Loads the contents of the currently selected question into the text and combo boxes.
public LoadTextFields ( ) : void
return void

PopulateFileView() public method

Populates the file view with any question files stored in the local directory.
public PopulateFileView ( ) : void
return void

PopulateQuestionView() public method

Populates the question view with questions, based on the selected question file.
public PopulateQuestionView ( string questionFile ) : void
questionFile string The currently open question file.
return void

RemoveQuestion() public method

Deletes a selected question and removes it from the question box.
public RemoveQuestion ( ) : void
return void

SaveOpen() public method

Saves any open questions and question files.
public SaveOpen ( ) : void
return void

SaveQuestion() public method

Saves the question at a given index of the question view.
public SaveQuestion ( int index ) : void
index int Listview item index of the question to save.
return void

SaveQuestionFile() public method

Saves the set of currently selected questions to a file.
public SaveQuestionFile ( string fileName ) : void
fileName string Name of the file.
return void

ShowError() public method

Shows an error dialog to the user.
public ShowError ( string error ) : void
error string String to display.
return void

UpdateAnswer() public method

Updates the modified answer to a question in the question view.
public UpdateAnswer ( ) : void
return void

UploadSync() public method

Opens a sync dialog to upload necessary files.
public UploadSync ( ) : void
return void

UploadSync() public method

Opens a sync dialog to upload necessary files on form exit. First displays a confirmation to the user.
public UploadSync ( FormClosingEventArgs e ) : void
e System.Windows.Forms.FormClosingEventArgs Form closing event args.
return void