Misc changes

This commit is contained in:
Lukasz Baldyga committed 2020-11-15 05:49:19 +00:00
1 parent 33c20bdaf6
commit 18196654b6
3 files changed
+8 -7

No files matched your search

@@ -40,8 +40,7 @@ namespace Advanced_Software_Engineering {
/// <summary> /// <summary>
/// Creates a new Commander instance without a context. Should only be used for testing purpouses. /// Creates a new Commander instance without a context. Should only be used for testing purpouses.
/// </summary> /// </summary>
/// <param name="command">empty string</param> public Commander() {
public Commander(string command = "") {
Console.WriteLine("Warning! No graphics context!!!"); Console.WriteLine("Warning! No graphics context!!!");
} }
@@ -141,8 +141,9 @@ namespace Advanced_Software_Engineering {
throw new Exception("Cannot have less than two points in a line"); throw new Exception("Cannot have less than two points in a line");
} }
GraphicsPath path = new GraphicsPath(); GraphicsPath path = new GraphicsPath {
path.FillMode = FillMode.Winding; FillMode = FillMode.Winding
};
path.AddLines(points); path.AddLines(points);
path.AddLine(points[0], points.Last()); //Add final line path.AddLine(points[0], points.Last()); //Add final line
@@ -68,9 +68,10 @@ namespace Advanced_Software_Engineering {
} }
private void saveFileAs() { private void saveFileAs() {
SaveFileDialog saveFileDialog = new SaveFileDialog(); SaveFileDialog saveFileDialog = new SaveFileDialog {
saveFileDialog.OverwritePrompt = true; OverwritePrompt = true,
saveFileDialog.DefaultExt = ".txt"; DefaultExt = ".txt"
};
if (fileName != "") saveFileDialog.FileName = fileName; if (fileName != "") saveFileDialog.FileName = fileName;
saveFileDialog.ValidateNames = true; saveFileDialog.ValidateNames = true;