Ejemplo n.º 1
0
        private int InternalInsertPoint(int i, PointF p)
        {
            if (i < 0)
            {
                throw new ArgumentException("GoPolygon.InsertPoint given an invalid index, less than zero");
            }
            if (i > myPointsCount)
            {
                i = myPointsCount;
            }
            ResetPath();
            int num = myPoints.Length;

            checked
            {
                if (myPointsCount >= num)
                {
                    PointF[] destinationArray = new PointF[Math.Max(num * 2, myPointsCount + 1)];
                    Array.Copy(myPoints, 0, destinationArray, 0, num);
                    myPoints = destinationArray;
                }
                if (myPointsCount > i)
                {
                    Array.Copy(myPoints, i, myPoints, i + 1, myPointsCount - i);
                }
                myPointsCount++;
                myPoints[i] = p;
                if (!base.Initializing)
                {
                    base.InvalidBounds = true;
                }
                Changed(1401, i, null, GoObject.MakeRect(p), i, null, GoObject.MakeRect(p));
                return(i);
            }
        }
Ejemplo n.º 2
0
 private void InternalSetPoint(int i, PointF p)
 {
     if (i >= 0 && i < myPointsCount)
     {
         PointF pointF = myPoints[i];
         if (pointF != p)
         {
             ResetPath();
             myPoints[i] = p;
             if (!base.Initializing)
             {
                 base.InvalidBounds = true;
             }
             Changed(1403, i, null, GoObject.MakeRect(pointF), i, null, GoObject.MakeRect(p));
         }
         return;
     }
     throw new ArgumentException("GoPolygon.SetPoint given an invalid index");
 }
Ejemplo n.º 3
0
 private void InternalRemovePoint(int i)
 {
     checked
     {
         if (i >= 0 && i < myPointsCount)
         {
             ResetPath();
             PointF p = myPoints[i];
             if (myPointsCount > i + 1)
             {
                 Array.Copy(myPoints, i + 1, myPoints, i, myPointsCount - i - 1);
             }
             myPointsCount--;
             if (!base.Initializing)
             {
                 base.InvalidBounds = true;
             }
             Changed(1402, i, null, GoObject.MakeRect(p), i, null, GoObject.MakeRect(p));
         }
     }
 }