Browse Source

unified instance variable documentation style to ///<summary>... and added documentation to the three instance variables of the Line class

Vincenz Mechler 5 years ago
parent
commit
8813bb3741

+ 4 - 0
SketchAssistant/SketchAssistant/FileImporterException.cs

@@ -8,7 +8,11 @@ namespace SketchAssistant
 {
     class FileImporterException : Exception
     {
+        /// <summary>
+        /// the clean and formatted message to show to the user
+        /// </summary>
         String showMessage;
+
         public FileImporterException(String message, String hint, int lineNumber) : base (message)
         {
             showMessage = "Could not import file:\n\n" + message + (hint == null ? "" : "\n(Hint: " + hint + ")") + (lineNumber == -1 ? "" : "\n\n-line: " + lineNumber );

+ 43 - 15
SketchAssistant/SketchAssistant/Form1.cs

@@ -26,21 +26,27 @@ namespace SketchAssistant
         /**********************************/
         /*** CLASS VARIABLES START HERE ***/
         /**********************************/
-        
-        //Different Program States
+
+        /// <summary>
+        /// Different Program States
+        /// </summary>
         public enum ProgramState
         {
             Idle,
             Draw,
             Delete
         }
-        //Current Program State
+        /// <summary>
+        /// Current Program State
+        /// </summary>
         private ProgramState currentState;
         /// <summary>
         /// instance of FileImporter to handle drawing imports
         /// </summary>
         private FileImporter fileImporter;
-        //Dialog to select a file.
+        /// <summary>
+        /// Dialog to select a file.
+        /// </summary>
         OpenFileDialog openFileDialogLeft = new OpenFileDialog();
         /// <summary>
         /// Image loaded on the left
@@ -50,28 +56,50 @@ namespace SketchAssistant
         /// the graphic shown in the left window, represented as a list of polylines
         /// </summary>
         private List<Line> templatePicture;
-        //Image on the right
+        /// <summary>
+        /// Image on the right
+        /// </summary>
         Image rightImage = null;
-        //Current Line being Drawn
+        /// <summary>
+        /// Current Line being Drawn
+        /// </summary>
         List<Point> currentLine;
-        //All Lines in the current session
+        /// <summary>
+        /// All Lines in the current session
+        /// </summary>
         List<Tuple<bool,Line>> lineList = new List<Tuple<bool, Line>>();
-        //Whether the Mouse is currently pressed in the rightPictureBox
+        /// <summary>
+        /// Whether the Mouse is currently pressed in the rightPictureBox
+        /// </summary>
         bool mousePressed = false;
-        //The Position of the Cursor in the right picture box
+        /// <summary>
+        /// The Position of the Cursor in the right picture box
+        /// </summary>
         Point currentCursorPosition;
-        //The Previous Cursor Position in the right picture box
+        /// <summary>
+        /// The Previous Cursor Position in the right picture box
+        /// </summary>
         Point previousCursorPosition;
-        //Queue for the cursorPositions
+        /// <summary>
+        /// Queue for the cursorPositions
+        /// </summary>
         Queue<Point> cursorPositions = new Queue<Point>();
-        //The graphic representation of the right image
+        /// <summary>
+        /// The graphic representation of the right image
+        /// </summary>
         Graphics graph = null;
-        //Deletion Matrixes for checking postions of lines in the image
+        /// <summary>
+        /// Deletion Matrixes for checking postions of lines in the image
+        /// </summary>
         bool[,] isFilledMatrix;
         HashSet<int>[,] linesMatrix;
-        //Size of deletion area
+        /// <summary>
+        /// Size of deletion area
+        /// </summary>
         uint deletionSize = 2;
-        //History of Actions
+        /// <summary>
+        /// History of Actions
+        /// </summary>
         ActionHistory historyOfActions;
 
         /******************************************/

+ 9 - 0
SketchAssistant/SketchAssistant/Line.cs

@@ -9,8 +9,17 @@ namespace SketchAssistant
 {
     public class Line
     {
+        /// <summary>
+        /// list saving all the points of the line in the order of the path from start to end point
+        /// </summary>
         private List<Point> linePoints;
+        /// <summary>
+        /// unique identifier of this Line object
+        /// </summary>
         private int identifier;
+        /// <summary>
+        /// flag showing if this is only a temporary line
+        /// </summary>
         private bool isTemporary;
 
         /// <summary>