Example #1
0
 void setTopBottom(int row)
 {
     if (row < 3)
     {
         _topBottom = eTopBottom.Top;
     }
     else
     {
         if (row < 6)
         {
             _topBottom = eTopBottom.Center;
         }
         else
         {
             _topBottom = eTopBottom.Bottom;
         }
     }
 }
Example #2
0
        eRegion GetRegion(int row, int col)
        {
            eRegion eReturn = eRegion.NotSet;

            _leftRight = eLeftRight.NotSet;
            _topBottom = eTopBottom.NotSet;
            SetLeftRight(col);
            setTopBottom(row);
            switch (_leftRight)
            {
            case eLeftRight.Left:
                ///////////////////////
                // LEFT-RIGHT = LEFT //
                ///////////////////////
                switch (_topBottom)
                {
                case eTopBottom.Top:
                    eReturn = eRegion.TopLeft;
                    break;

                case eTopBottom.Center:
                    eReturn = eRegion.CenterLeft;
                    break;

                case eTopBottom.Bottom:
                    eReturn = eRegion.LowerLeft;
                    break;

                default:
                    throw new Exception("Invalid eTopBottom value in cValidationLists.GetRegion()");
                }
                break;



            case eLeftRight.Center:
                /////////////////////////
                // LEFT-RIGHT = CENTER //
                /////////////////////////
                switch (_topBottom)
                {
                case eTopBottom.Top:
                    eReturn = eRegion.TopCenter;
                    break;

                case eTopBottom.Center:
                    eReturn = eRegion.Center;
                    break;

                case eTopBottom.Bottom:
                    eReturn = eRegion.LowerCenter;
                    break;

                default:
                    throw new Exception("Invalid eTopBottom value in cValidationLists.GetRegion()");
                }

                break;

            case eLeftRight.Right:
                switch (_topBottom)
                {
                ////////////////////////
                // LEFT-RIGHT = RIGHT //
                ////////////////////////
                case eTopBottom.Top:
                    eReturn = eRegion.TopRight;
                    break;

                case eTopBottom.Center:
                    eReturn = eRegion.CenterRight;
                    break;

                case eTopBottom.Bottom:
                    eReturn = eRegion.LowerRight;
                    break;

                default:
                    throw new Exception("Invalid eTopBottom value in cValidationLists.GetRegion()");
                }
                break;

            default:
                throw new Exception("Invalid LeftRight enum value in cValiationLists.GetRegion()");
            } // END SWITCH
            return(eReturn);
        }