コード例 #1
0
        }     //end method

        //TODO: CREATE NEW GETSTART METHOD
        private bool SetStart(MainWindow main, TextBox txtbox)
        {
            try {
                string[] xANDy = Unhash(txtbox.Text).Split(',');
                xPos = int.Parse(xANDy[0]);
                yPos = int.Parse(xANDy[1]);
                return(true);
            } catch (Exception) {
                ExceptionClass ex = new ExceptionClass();
                ex.FeedMessage("The Coordinates Entered Is Not Correct", "Error");
                exceptionCount++;

                if (exceptionCount >= 3)
                {
                    main.Close();
                }//end if

                return(false);
            } //end try/catch
        }     //end method
コード例 #2
0
        }     //end method

        //TODO: CREATE NEW GETSTART METHOD
        private bool SetStart(TextBox txtbox)
        {
            try {
                string[] xANDy = Unhash(txtbox.Text).Split(',');
                xPos = int.Parse(xANDy[0]);
                yPos = int.Parse(xANDy[1]);
                if (xPos < 0 || yPos < 0)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            } catch (Exception) {
                ExceptionClass ex = new ExceptionClass();
                ex.FeedMessage("The Coordinates Entered Is Not Correct", "Error");
                exceptionCount++;

                return(false);
            } //end try/catch
        }     //end method