<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: EditOperation Automaticly started with Event &amp;quot;OnDeleteFeature&amp;quot;? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450401#M12231</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello agray&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for your quick answer. I made everything you said. I handled the event and throwed an exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately nothing happend.. but my feature was deleted anyway.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Private Sub EsriEditor_OnDeleteFeature(ByVal obj As ESRI.ArcGIS.Geodatabase.IObject) Handles EsriEditorEvents.OnDeleteFeature

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If CType(obj, IFeature).Class.AliasName = "Protected" Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Throw New Exception("This feature mustn't be deleted!")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 20:06:26 GMT</pubDate>
    <dc:creator>LionelMartz</dc:creator>
    <dc:date>2021-12-11T20:06:26Z</dc:date>
    <item>
      <title>EditOperation Automaticly started with Event &amp;quot;OnDeleteFeature&amp;quot;?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450399#M12229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello everyone again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've just a little question to make sure, that everything doesn't work just by a fluke.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm handling the Events "OnVertexAdded" and "OnDeleteFeature". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my OnDeleteFeature-handling it can be, that the delete-Operation is invalid. In this case, I call the editor.AbortOperation-method. That works fine. Does that mean, the ArcGIS is starting itself an edit operation? I Think this, because I also can't start an edit Operation in this event-handling without getting an Error. In contrast to the OnVertexAdded-event, where it is possible to start an Edit Operation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the API there is written, that the user must start an stop Operations while he's editing within an editor editing session. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, it's a bit confusing for me..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the answers!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lionel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 13:13:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450399#M12229</guid>
      <dc:creator>LionelMartz</dc:creator>
      <dc:date>2011-03-24T13:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: EditOperation Automaticly started with Event "OnDeleteFeature"?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450400#M12230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are listening to OnDeleteFeature from the ArcMap editor extension, you should not abort the operation.&amp;nbsp; OnCreate, OnChange, OnDelete all happen inside an edit operation.&amp;nbsp; You should never try to stop or abort an operation from inside the listener.&amp;nbsp; If you need to void the operation, throw an exception with a message you want the user the see.&amp;nbsp; The exception will be caught in esri code and the esri code will abort the operation and show the user the message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/000100000340000000.htm"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/000100000340000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;"Do not call AbortOperation inside any editor event, including BeforeStopOperation."&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 16:13:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450400#M12230</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2011-03-24T16:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: EditOperation Automaticly started with Event "OnDeleteFeature"?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450401#M12231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello agray&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for your quick answer. I made everything you said. I handled the event and throwed an exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately nothing happend.. but my feature was deleted anyway.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Private Sub EsriEditor_OnDeleteFeature(ByVal obj As ESRI.ArcGIS.Geodatabase.IObject) Handles EsriEditorEvents.OnDeleteFeature

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If CType(obj, IFeature).Class.AliasName = "Protected" Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Throw New Exception("This feature mustn't be deleted!")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:06:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450401#M12231</guid>
      <dc:creator>LionelMartz</dc:creator>
      <dc:date>2021-12-11T20:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: EditOperation Automaticly started with Event "OnDeleteFeature"?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450402#M12232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, Lionel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I got the same thing as you. Throwed an exception, but my feature was deleted without any message. Did you find a solution? Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 16:33:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450402#M12232</guid>
      <dc:creator>HXiao</dc:creator>
      <dc:date>2011-11-17T16:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: EditOperation Automaticly started with Event "OnDeleteFeature"?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450403#M12233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;the event listener needs to be on the class extension event for the feature class you are editing not the editor events.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 17:20:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450403#M12233</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2011-11-17T17:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: EditOperation Automaticly started with Event "OnDeleteFeature"?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450404#M12234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello agray,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply. I could not follow you yet. Do you mind giving a piece of code to help understand the difference?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 00:46:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450404#M12234</guid>
      <dc:creator>HXiao</dc:creator>
      <dc:date>2011-11-18T00:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: EditOperation Automaticly started with Event "OnDeleteFeature"?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450405#M12235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;the code is a little scattered but I do this in an extension in vb.net, principle is the same for c#&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;class level member variable:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Private m_PointObjectClassEvents As IObjectClassEvents_Event&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In a method called on start editing, if the featureclass is found&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'LayerPoint previousle obtained&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; m_PointObjectClassEvents = DirectCast(m_LayerPoint.FeatureClass, IObjectClassEvents_Event)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; AddHandler m_PointObjectClassEvents.OnChange, AddressOf PointChange&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Private Sub PointChange(ByVal obj As IObject)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Maybe check some conditions&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Throw New ApplicationException("Message to the user")&amp;nbsp; 'this abort the edit and the exception &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'message is shown to the user&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In a stop editing event or other appropriate event&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; RemoveHandler m_PointObjectClassEvents.OnDelete, AddressOf PointChange&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 15:01:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editoperation-automaticly-started-with-event-amp/m-p/450405#M12235</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2011-11-18T15:01:12Z</dc:date>
    </item>
  </channel>
</rss>

