示例#1
0
        /// <summary>
        /// Do stuff when a user has just completed an edit.
        /// </summary>
        internal void OnFinishOp()
        {
            ISpatialDisplay display = EditingController.Current.ActiveDisplay;
            IDrawStyle      style   = EditingController.Current.DrawStyle;
            bool            doPost  = false; // Need to post-process the list?

            foreach (CheckItem check in m_Results)
            {
                // Note the current result. Skip if has been fixed.
                CheckType oldTypes = check.Types;
                if (oldTypes == CheckType.Null)
                {
                    continue;
                }

                // Get the current state of the check & restrict to those results that
                // the user wants to see
                CheckType newTypes = check.ReCheck();
                newTypes &= m_Options;

                // If a change has arisen, paint out those results that no longer apply,
                // and update the result.

                if (newTypes != oldTypes)
                {
                    check.PaintOut(display, style, newTypes);
                    check.Types = newTypes;

                    // If we just fixed a polygon with no enclosing polygon, remember to post-process
                    // the results once we're through the loop.
                    doPost = ((oldTypes & CheckType.NotEnclosed) != 0 && (newTypes & CheckType.NotEnclosed) == 0);
                }
            }

            // If we eliminated at least one "no polygon enclosing polygon"
            // problem, do a post check to look for any single occurence of
            // another problem with the same type. If we find one, mark it
            // as fixed too (but don't remove it from the list, since that
            // might screw up the review dialog).
            if (doPost)
            {
                FileCheckQuery.PostCheck(m_Results, false);
            }

            // Tell the status dialog.
            if (m_Status != null)
            {
                m_Status.OnFinishOp();
            }

            // Ensure screen immediately reflects any changes
            Render(display, style);
        }
示例#2
0
        /// <summary>
        /// Checks the current map.
        /// </summary>
        /// <returns>The number of objects checked (-1 if the map currently has an
        /// active operation in progress).</returns>
        int CheckMap()
        {
            Debug.Assert(m_Status != null);

            // Reset current set of problems.
            KillResults();

            // Return if the map has an active operation.
            CadastralMapModel map = CadastralMapModel.Current;

            if (map.IsCommittingEdit)
            {
                MessageBox.Show("Cannot make check because an edit appears to be in progress.");
                return(-1);
            }

            ISpatialDisplay display = EditingController.Current.ActiveDisplay;
            Control         c       = display.MapPanel;

            try
            {
                c.Cursor = Cursors.WaitCursor;
                FileCheckQuery check = new FileCheckQuery(map, m_Options, OnCheck);
                m_Results = check.Result;
                return(check.NumChecked);
            }

            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return(-1);
            }

            finally
            {
                c.Cursor = Cursors.Default;
            }
        }
示例#3
0
        /// <summary>
        /// Checks the current map.
        /// </summary>
        /// <returns>The number of objects checked (-1 if the map currently has an
        /// active operation in progress).</returns>
        int CheckMap()
        {
            Debug.Assert(m_Status!=null);

            // Reset current set of problems.
            KillResults();

            // Return if the map has an active operation.
            CadastralMapModel map = CadastralMapModel.Current;
            if (map.IsCommittingEdit)
            {
                MessageBox.Show("Cannot make check because an edit appears to be in progress.");
                return -1;
            }

            ISpatialDisplay display = EditingController.Current.ActiveDisplay;
            Control c = display.MapPanel;

            try
            {
                c.Cursor = Cursors.WaitCursor;
                FileCheckQuery check = new FileCheckQuery(map, m_Options, OnCheck);
                m_Results = check.Result;
                return check.NumChecked;
            }

            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return -1;
            }

            finally
            {
                c.Cursor = Cursors.Default;
            }
        }