Пример #1
0
 /// <summary>
 /// 关闭标牌
 /// </summary>
 public void CloseMapLabel()
 {
     if (mapLabel != null)
     {
         if (mapLabel.InvokeRequired)
         {
             mapLabel.Invoke(new Action(delegate
             {
                 mapLabel.DisposeLabel();
                 mapLabel  = null;
                 isTipInit = false;
             }));
         }
         else
         {
             mapLabel.DisposeLabel();
             mapLabel  = null;
             isTipInit = false;
         }
     }
     lableVisible = false;
 }
Пример #2
0
        /// <summary>
        /// 释放资源
        /// </summary>
        public override void Dispose()
        {
            base.Dispose();

            this.BelongLayer = null;

            try
            {
                if (FlashPen != null)
                {
                    FlashPen.Dispose();
                    FlashPen = null;
                }

                if (flashTimer != null)
                {
                    flashTimer.Stop();
                    flashTimer.Dispose();
                    flashTimer = null;
                }

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

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

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

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

                if (mapLabel != null)
                {
                    if (mapLabel.InvokeRequired)
                    {
                        mapLabel.Invoke(new Action(delegate
                        {
                            mapLabel.Visible = false;
                            mapLabel.DisposeLabel();
                            mapLabel.Dispose();
                            mapLabel = null;
                        }));
                    }
                    else
                    {
                        mapLabel.Visible = false;
                        mapLabel.DisposeLabel();
                        mapLabel.Dispose();
                        mapLabel = null;
                    }
                }
                BelongLayer = null;
            }
            catch
            {
            }
        }