void m_editEvents_OnDeleteFeature(IObject obj)
        {
            // check if the deleted feature participates in a relation
            //   applies to point, lines, and polygons
            //   if it does participate in a relation ask the user if it is ok to delete

            IFeatureClass currentObjectFeatureClass = obj.Class as IFeatureClass;

            if ((currentObjectFeatureClass == null) || (currentObjectFeatureClass.EXTCLSID == null))
            {
                return;
            }

            // check if the current feature class being edited is acutally an OpenStreetMap feature class
            // all other feature class should not be touched by this extension
            UID osmEditorExtensionCLSID = currentObjectFeatureClass.EXTCLSID;

            if (osmEditorExtensionCLSID.Value.ToString().Equals("{65CA4847-8661-45eb-8E1E-B2985CA17C78}", StringComparison.InvariantCultureIgnoreCase) == false)
            {
                return;
            }


            // at this point we are only handling geometry types
            //   relation types are using a separate UI
            IFeature deletedFeature = obj as IFeature;

            if (deletedFeature == null)
            {
                return;
            }

            // block changing features that are supporting features for multi-part geometries (relations)
            if (deletedFeature.Shape is IPolygon || deletedFeature.Shape is IPolyline)
            {
                int memberOFFieldIndex = deletedFeature.Fields.FindField("osmMemberOf");
                int membersFieldIndex  = deletedFeature.Fields.FindField("osmMembers");
                int osmIDFieldIndex    = deletedFeature.Fields.FindField("OSMID");

                int osmID = 0;

                if (osmIDFieldIndex > -1)
                {
                    object osmIDValue = deletedFeature.get_Value(osmIDFieldIndex);

                    if (osmIDValue != DBNull.Value)
                    {
                        osmID = Convert.ToInt32(osmIDValue);
                    }
                }

                if (membersFieldIndex > -1)
                {
                    ESRI.ArcGIS.OSM.OSMClassExtension.member[] relationMembers = _osmUtility.retrieveMembers(deletedFeature, membersFieldIndex);

                    if (relationMembers != null)
                    {
                        if (relationMembers.Length > 0)
                        {
                            string abortMessage = String.Format(resourceManager.GetString("OSMEditor_FeatureInspector_multipartdeleteparentconflictmessage"), osmID);
                            MessageBox.Show(abortMessage, resourceManager.GetString("OSMEditor_FeatureInspector_relationconflictcaption"), MessageBoxButtons.OK, MessageBoxIcon.Stop);
                            m_editor3.AbortOperation();
                        }
                    }
                }


                if (memberOFFieldIndex > -1)
                {
                    List <string> isMemberOfList = _osmUtility.retrieveIsMemberOf(deletedFeature, memberOFFieldIndex);
                    Dictionary <string, string> dictofParentsAndTypes = _osmUtility.parseIsMemberOfList(isMemberOfList);

                    StringBuilder typeAndIDString = new StringBuilder();
                    foreach (var item in dictofParentsAndTypes)
                    {
                        switch (item.Value)
                        {
                        case "rel":
                            typeAndIDString.Append(resourceManager.GetString("OSMEditor_FeatureInspector_relationidtext") + item.Key + ",");
                            break;

                        case "ply":
                            typeAndIDString.Append(resourceManager.GetString("OSMEditor_FeatureInspector_polygonidtext") + item.Key + ",");
                            break;

                        case "ln":
                            typeAndIDString.Append(resourceManager.GetString("OSMEditor_FeatureInspector_polylineidtext") + item.Key + ",");
                            break;

                        case "pt":
                            typeAndIDString.Append(resourceManager.GetString("OSMEditor_FeatureInspector_pointidtext") + item.Key + ",");
                            break;

                        default:
                            break;
                        }
                    }

                    if (typeAndIDString.Length > 0)
                    {
                        string parentsString = typeAndIDString.ToString(0, typeAndIDString.Length - 1);
                        string abortMessage  = String.Format(resourceManager.GetString("OSMEditor_FeatureInspector_relationsconflictmessage"), osmID, parentsString);
                        MessageBox.Show(abortMessage, resourceManager.GetString("OSMEditor_FeatureInspector_relationconflictcaption"), MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        m_editor3.AbortOperation();
                        return;
                    }
                }
            }
            else if (deletedFeature.Shape is IPoint)
            {
                // if we are dealing with points to be deleted then we'll determine the connectedness via a spatial query and then the attributes indicating that
                // the higher order feature is part of a relation
                IFeatureClass lineFeatureClass = ESRI.ArcGIS.OSM.OSMClassExtension.OpenStreetMapClassExtension.findMatchingFeatureClass(deletedFeature, esriGeometryType.esriGeometryPolyline);

                ISpatialFilter searchPointFilter = new SpatialFilterClass();
                searchPointFilter.Geometry   = deletedFeature.Shape;
                searchPointFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelTouches;

                TestRelationMembership(deletedFeature, lineFeatureClass, searchPointFilter);

                IFeatureClass polygonFeatureClass = ESRI.ArcGIS.OSM.OSMClassExtension.OpenStreetMapClassExtension.findMatchingFeatureClass(deletedFeature, esriGeometryType.esriGeometryPolygon);

                TestRelationMembership(deletedFeature, polygonFeatureClass, searchPointFilter);
            }

            string featureClassName = ((IDataset)obj.Class).Name;

            // find the correspoding relation table
            int baseIndex                  = featureClassName.IndexOf("_osm_");
            int deleteOSMIDFieldIndex      = obj.Fields.FindField("OSMID");
            int deleteIsMemberOfFieldIndex = obj.Fields.FindField("osmMemberOf");

            if (baseIndex > -1)
            {
                string relationTableName = featureClassName.Substring(0, baseIndex) + "_osm_relation";

                IFeatureWorkspace featureWorkspace = m_editor3.EditWorkspace as IFeatureWorkspace;

                ITable relationTable           = featureWorkspace.OpenTable(relationTableName);
                int    relationOSMIDFieldIndex = relationTable.Fields.FindField("OSMID");

                List <string> memberOfList = _osmUtility.retrieveIsMemberOf(deletedFeature, deleteIsMemberOfFieldIndex);

                Dictionary <string, string> isMemberOfIdsAndTypes = _osmUtility.parseIsMemberOfList(memberOfList);

                if (memberOfList.Count > 0)
                {
                    // the deleted feature is referenced by a relation
                    // check with the user if it is ok to delete
                    // if OK then we are dealing with the delete upon stop editing, if cancel undo the delete
                    string relationsString = String.Empty;
                    int    relationCount   = 0;
                    foreach (var memberOfItem in isMemberOfIdsAndTypes)
                    {
                        if (memberOfItem.Value == "rel")
                        {
                            relationCount   = relationCount + 1;
                            relationsString = relationsString + memberOfItem.Key + ",";
                        }
                    }

                    string errorMessage = String.Empty;

                    if (relationCount > 1)
                    {
                        errorMessage = string.Format(resourceManager.GetString("OSMEditor_FeatureInspector_relationsconflictmessage"), deletedFeature.get_Value(deleteOSMIDFieldIndex), relationsString.Substring(0, relationsString.Length - 1));
                    }
                    else
                    {
                        errorMessage = string.Format(resourceManager.GetString("OSMEditor_FeatureInspector_relationconflictmessage"), deletedFeature.get_Value(deleteOSMIDFieldIndex), relationsString.Substring(0, relationsString.Length - 1));
                    }

                    if (MessageBox.Show(errorMessage, resourceManager.GetString("OSMEditor_FeatureInspector_relationconflictcaption"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.Cancel)
                    {
                        m_editor3.AbortOperation();
                    }
                }
            }
        }