Exemple #1
0
        /// <summary>
        /// Производит отписку от событий главной формы и удаляет элемены с MapPanel
        /// </summary>
        public void Dispose()
        {
            mapWindow.MainPanel.MouseLeftButtonDown  -= mouseLMBHandler;
            mapWindow.MainPanel.MouseRightButtonDown -= mouseRMBHandler;

            mapWindow.MapPanel.Children.Remove(APointMarker.GetPath());
            mapWindow.MapPanel.Children.Remove(BPointMarker.GetPath());
            mapWindow.MapPanel.Children.Remove(CPointMarker.GetPath());
            mapWindow.MapPanel.Children.Remove(ABDistanceLine.GetPath());
            mapWindow.MapPanel.Children.Remove(BCDistanceLine.GetPath());
            mapWindow.MapPanel.Children.Remove(CADistanceLine.GetPath());
            //mapWindow.MapPanel.Children.Remove(studAPointMarker.GetPath());
            //mapWindow.MapPanel.Children.Remove(studBPointMarker.GetPath());
            //mapWindow.MapPanel.Children.Remove(studCPointMarker.GetPath());
            //mapWindow.MapPanel.Children.Remove(studABDistanceLine.GetPath());
            //mapWindow.MapPanel.Children.Remove(studBCDistanceLine.GetPath());
            //mapWindow.MapPanel.Children.Remove(studCADistanceLine.GetPath());

            if (studentCalculations != null)
            {
                if (studentCalculations.geodDiff != null)
                {
                    studentCalculations.geodDiff.Close();
                }

                studentCalculations.Close();
            }
            mapWindow.CurrentModeControl.Resources.Remove(this);
        }
        /// <summary>
        /// Производит отписку от событий главной формы и удаляет элемены с MapPanel
        /// </summary>
        public void Dispose()
        {
            mapWindow.MainPanel.MouseLeftButtonDown  -= mouseLMBHandler;
            mapWindow.MainPanel.MouseRightButtonDown -= mouseRMBHandler;

            mapWindow.MapPanel.Children.Remove(firstPointMarker.GetPath());
            mapWindow.MapPanel.Children.Remove(secondPointMarker.GetPath());
            mapWindow.MapPanel.Children.Remove(distanceViewer.GetPath());

            mapWindow.CurrentModeControl.Resources.Remove(this);
        }