Exemplo n.º 1
0
/* Evandro
 *      public override void SaveToStream(System.Runtime.Serialization.SerializationInfo info, int orderNumber)
 *      {
 *          info.AddValue(
 *              String.Format(CultureInfo.InvariantCulture,
 *              "{0}{1}",
 *              entryStart, orderNumber),
 *              startPoint);
 *
 *          info.AddValue(
 *              String.Format(CultureInfo.InvariantCulture,
 *              "{0}{1}",
 *              entryEnd, orderNumber),
 *              endPoint);
 *
 *          base.SaveToStream (info, orderNumber);
 *      }
 *
 *      public override void LoadFromStream(SerializationInfo info, int orderNumber)
 *      {
 *          startPoint = (Point)info.GetValue(
 *              String.Format(CultureInfo.InvariantCulture,
 *              "{0}{1}",
 *              entryStart, orderNumber),
 *              typeof(Point));
 *
 *          endPoint = (Point)info.GetValue(
 *              String.Format(CultureInfo.InvariantCulture,
 *              "{0}{1}",
 *              entryEnd, orderNumber),
 *              typeof(Point));
 *
 *          base.LoadFromStream (info, orderNumber);
 *      }
 */

        /// <summary>
        /// Invalidate object.
        /// When object is invalidated, path used for hit test
        /// is released and should be created again.
        /// </summary>
        protected void Invalidate()
        {
            if (AreaPath != null)
            {
                AreaPath.Dispose();
                AreaPath = null;
            }

            if (AreaPen != null)
            {
                AreaPen.Dispose();
                AreaPen = null;
            }

            if (AreaRegion != null)
            {
                AreaRegion.Dispose();
                AreaRegion = null;
            }
        }