/// <summary> /// Performs processing that should be performed to conclude an editing operation /// (either during initial execution, or when loading during application startup). /// Features that were created will initially get indexed via a call to <see cref="CadastralMapModel.AddToIndex"/>. /// Followed by calls to <see cref="AddReferences"/> and <see cref="PrepareForIntersect"/>. /// If the call is being made as part of an editing session (not application startup), a call to /// <see cref="CadastralMapModel.CleanEdit"/> will be made, and the edit will be saved to the database. /// </summary> protected void Complete() { // Is this method being called as part of application startup? bool isStartup = !Object.ReferenceEquals(m_Session, CadastralMapModel.Current.WorkingSession); // Index features that were created (and ensure the map extent has been // expanded to include the new features) Feature[] feats = Features; // If we're not doing startup, attempt to associate new features with database attributes (when // we're doing startup, we do all the deserialzation, then do all attribute matching in one big swoop) if (!isStartup) { AttributeData.Load(feats); MapModel.AddToIndex(feats); // Ensure user-perceived ID objects have been indexed too MapModel.AddFeatureIds(feats); } // Point referenced features to this editing operation AddReferences(); // Mark any new topological lines as "moved" so that they will be // intersected with the map PrepareForIntersect(feats); if (!isStartup) { // Ensure the map structure has been updated to account for the new data. MapModel.CleanEdit(); // Save the edit m_Session.SaveOperation(this); } }