/// <summary> /// Deactivates a feature as part of deserialization from the database. /// </summary> /// <param name="f">The feature that needs to be deactivated</param> internal override void Deactivate(Feature f) { // When a line is deactivated during the course of regular editing work, // any topological constructs will be removed when the model is cleaned // at the end of the edit. During deserialization, the model doesn't get // cleaned, so remove any topological stuff now. LineFeature line = (f as LineFeature); if (line != null) { line.RemoveTopology(); } base.Deactivate(f); }
/// <summary> /// Ensures that a persistent field has been associated with a spatial feature. /// </summary> /// <param name="field">A tag associated with the item</param> /// <param name="feature">The feature to assign to the field (not null).</param> /// <returns> /// True if a matching field was processed. False if the field is not known to this /// class (may be known to another class in the type hierarchy). /// </returns> public bool ApplyFeatureRef(DataField field, Feature feature) { switch (field) { case DataField.Line: { m_Line = (LineFeature)feature; m_Line.RemoveTopology(); m_Line.IsInactive = true; return(true); } case DataField.CloseTo: { m_CloseTo = (PointFeature)feature; return(true); } } return(false); }
public void ApplyFeatureRefArray(DataField field, ForwardRefArrayItem[] featureRefs) { Debug.Assert(field == DataField.Delete); foreach (var item in featureRefs) { if (item.ArrayIndex < 0 || item.ArrayIndex >= m_Deletions.Count) { throw new IndexOutOfRangeException(); } m_Deletions[item.ArrayIndex] = item.Feature; // As DeserializationFactory.Deactivate... LineFeature line = (item.Feature as LineFeature); if (line != null) { line.RemoveTopology(); } item.Feature.IsInactive = true; } }
/// <summary> /// Ensures that a persistent field has been associated with a spatial feature. /// </summary> /// <param name="field">A tag associated with the item</param> /// <param name="feature">The feature to assign to the field (not null).</param> /// <returns> /// True if a matching field was processed. False if the field is not known to this /// class (may be known to another class in the type hierarchy). /// </returns> public bool ApplyFeatureRef(DataField field, Feature feature) { switch (field) { case DataField.Line: { m_Line = (LineFeature)feature; m_Line.RemoveTopology(); m_Line.IsInactive = true; return true; } case DataField.CloseTo: { m_CloseTo = (PointFeature)feature; return true; } } return false; }