Private
Public Access
Documented DrawPreview
This commit is contained in:
1 parent
cc1c44a6b3
commit
ada5166a12
1 file changed
+25
-1
@@ -17,7 +17,7 @@ namespace Advanced_Software_Engineering
|
|||||||
Commander commander;
|
Commander commander;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The draw preview window.
|
/// The draw preview window. Spawns the basic DrawPreview.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This window is responsible for showing what has been drawn.
|
/// This window is responsible for showing what has been drawn.
|
||||||
@@ -31,6 +31,12 @@ namespace Advanced_Software_Engineering
|
|||||||
commander = new Commander(graphics);
|
commander = new Commander(graphics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The draw preview window. Spawns the DrawPreview with commands locked.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This window is responsible for showing what has been drawn.
|
||||||
|
/// </remarks>
|
||||||
public Draw_Preview(string commands) {
|
public Draw_Preview(string commands) {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
SettingsAndHelperFunctions.NumberOfWindows++;
|
SettingsAndHelperFunctions.NumberOfWindows++;
|
||||||
@@ -65,23 +71,41 @@ namespace Advanced_Software_Engineering
|
|||||||
textBox1.Text = "";
|
textBox1.Text = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Submit commands to the commander to execute on the form.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="comamnds">Commands seperated by new lines</param>
|
||||||
public void SubmitCommands(string comamnds) {
|
public void SubmitCommands(string comamnds) {
|
||||||
commander.ProcessCommandsAndExecute(comamnds);
|
commander.ProcessCommandsAndExecute(comamnds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes all the commands from the form
|
||||||
|
/// </summary>
|
||||||
public void RemoveAllCommands() {
|
public void RemoveAllCommands() {
|
||||||
commander.RemoveAllCommands();
|
commander.RemoveAllCommands();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enables the textbox and submit button to allow the user to interract with the preview directly
|
||||||
|
/// </summary>
|
||||||
public void ReleaseCommandLock() {
|
public void ReleaseCommandLock() {
|
||||||
textBox1.Enabled = true;
|
textBox1.Enabled = true;
|
||||||
button1.Enabled = true;
|
button1.Enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Describes all of the current commands stored inside commander.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A string with all the command descriptions</returns>
|
||||||
public string DescribeAllCommands() {
|
public string DescribeAllCommands() {
|
||||||
return commander.ExplainCommands();
|
return commander.ExplainCommands();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns weather there were any errors in the commander. Commander will have 0 commands if there is one bad command.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A boolean describing the success of command phrasing</returns>
|
||||||
public bool IsSuccess() {
|
public bool IsSuccess() {
|
||||||
return commander.GetNumberOfCommands() > 0;
|
return commander.GetNumberOfCommands() > 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user