示例#1
0
        /// <summary>
        /// Ensures this feature is clean after some sort of edit. If this feature has been marked
        /// for deletion (either deletion through a <see cref="DeletionOperation"/>, or because
        /// the creating edit is being rolled back), this ensures that any associated ID object
        /// no longer refers to this feature.
        /// <para/>
        /// Any override should first do it's stuff, then call this implementation.
        /// </summary>
        internal virtual void Clean()
        {
            // Return if this feature hasn't been marked for deletion
            if (!IsUndoing)
            {
                return;
            }

            // If this feature is active, but it doesn't appear to be indexed,
            // do it now. This is a bit of a kludge, meant to cover the fact
            // that lines are erroneously dropping out of the index after making
            // updates.
            //if (this.IsInactive == false && this.IsIndexed == false)
            //    this.MapModel.EditingIndex.AddFeature(this);

            // Return if there is no feature ID.
            if (m_Id == null)
            {
                return;
            }

            // Cut the reference that the ID makes to this feature (the ID
            // may continue to point to other features).
            m_Id.CutReference(this);

            // Remove the the ID from its enclosing ID packet
            NativeId nid = (m_Id as NativeId);

            if (nid != null)
            {
                nid.IdGroup.ReleaseId(nid);
            }
        }