agimbits

IInvalidArea2 does not work?

Discussion created by agimbits on Nov 29, 2011
Latest reply on Dec 1, 2011 by agimbits
Hello all!

I am developing an editing tool and wish to refresh user's display that user can see immediately results. In the tutorials i was looking at say i should use IInvalidArea2 object. So i did:

#define IInvalidArea2 object
private IInvalidArea2 m_refreshArea;

#some code here

#add envelopes of my geometries (i am going geomentries in loop, so this line would be called many times)
m_refreshArea.Add(mergedGeom.Envelope);

#in the end 
m_refreshArea.Display = m_editor.Display;
m_refreshArea.Invalidate((short)esriScreenCache.esriAllScreenCaches);


but... nothing really happens

After playing with IInvalidArea and googling, i did not find anything better but to use...


private IEnvelope m_editedFeature;

#some code here

#add envelopes
m_editedFeature.Union(mergedGeom.Envelope);

#at the end
IActiveView activeView = m_editor.Map as IActiveView;
                            (m_editor.Map as IActiveView).PartialRefresh(esriViewDrawPhase.esriViewGeography,
                                                      (m_editor as IEditLayers).CurrentLayer,
                                                      m_editedFeature);


This works perfectly!
But why IInvalidArea does not work???
(according to tutorials it is the default way to refresh dispay).

p.s. I am using C# ArcObjects, Arc10, VS10
p.p.s I also tried IInvalidArea3 instead of 2nd version, the same effect - nothing is refreshed...

Outcomes