Esempio n. 1
0
        void MapControl_Disposed(object sender, EventArgs e)
        {
            UnregisterClientEvents(Client);

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

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

            if (regionTiles != null)
            {
                lock (regionTiles)
                {
                    foreach (Image img in regionTiles.Values)
                    {
                        img?.Dispose();
                    }
                    regionTiles.Clear();
                }
                regionTiles = null;
            }
        }
Esempio n. 2
0
        void MapControl_Disposed(object sender, EventArgs e)
        {
            UnregisterClientEvents(Client);

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

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

            if (regionTiles != null)
            {
                lock (regionTiles)
                {
                    foreach (Image img in regionTiles.Values)
                        if (img != null)
                            img.Dispose();
                    regionTiles.Clear();
                }
                regionTiles = null;
            }
        }
Esempio n. 3
0
        public MapControl(RadegastInstance instance)
        {
            Zoom = 1.0f;
            InitializeComponent();
            Disposed     += new EventHandler(MapControl_Disposed);
            this.Instance = instance;

            downloader = new ParallelDownloader();

            background         = Color.FromArgb(4, 4, 75);
            textFont           = new Font(FontFamily.GenericSansSerif, 8.0f, FontStyle.Bold);
            textBrush          = new SolidBrush(Color.FromArgb(255, 200, 200, 200));
            dotBrush           = new SolidBrush(Color.FromArgb(255, 30, 210, 30));
            blackPen           = new Pen(Color.Black, 2.0f);
            textBackgroudBrush = new SolidBrush(Color.Black);

            repaint = new System.Threading.Timer(RepaintTick, null, 1000, 1000);

            Instance.ClientChanged += new EventHandler <ClientChangedEventArgs>(Instance_ClientChanged);
            RegisterClientEvents();
        }
Esempio n. 4
0
        public MapControl(RadegastInstance instance)
        {
            Zoom = 1.0f;
            InitializeComponent();
            Disposed += new EventHandler(MapControl_Disposed);
            this.Instance = instance;

            downloader = new ParallelDownloader();

            background = Color.FromArgb(4, 4, 75);
            textFont = new Font(FontFamily.GenericSansSerif, 8.0f, FontStyle.Bold);
            textBrush = new SolidBrush(Color.FromArgb(255, 200, 200, 200));
            dotBrush = new SolidBrush(Color.FromArgb(255, 30, 210, 30));
            blackPen = new Pen(Color.Black, 2.0f);
            textBackgroudBrush = new SolidBrush(Color.Black);

            repaint = new System.Threading.Timer(RepaintTick, null, 1000, 1000);

            Instance.ClientChanged += new EventHandler<ClientChangedEventArgs>(Instance_ClientChanged);
            RegisterClientEvents();
        }