Select to view content in your preferred language

onchangeselection event please someone help...

566
0
10-31-2010 07:18 AM
yatendrajaiswal
Emerging Contributor
I have written code on ieditevents for onchangeselection.
It is the same sample given in
http://edndoc.esri.com/arcobjects/9.2/ComponentHelp/esriEditor/Abbreviation_Example.htm
I am trying to remove features from first selection and allow user to create new selection on map and count the new selected features on Icommand.
but on second selection given sample is not working.
please someone correct my code if I am doing something wrong or guide me alternate solution for the same.


{
mxdoc = GetMxDocument(m_application);
MessageBox.Show("first selection" + mxdoc.FocusMap.SelectionCount);
UID puid = new UID();
puid.Value = "esriEditor.Editor";
m_editor = m_application.FindExtensionByCLSID(puid) as IEditor;

IEditEvents_Event m_editorEvents;
IEditEvents2_Event m_editorEvents2;
mxdoc.FocusMap.ClearSelection();
m_editorEvents = m_editor as IEditEvents_Event;
m_editorEvents2 = m_editor as IEditEvents2_Event;

IEditEvents_OnSelectionChangedEventHandler editEvents_OnSelectionChangedEventHandler = new IEditEvents_OnSelectionChangedEventHandler(this.On SelectionChanged);
m_editorEvents.OnSelectionChanged += editEvents_OnSelectionChangedEventHandler;

}

public void OnSelectionChanged()
{
System.Windows.Forms.MessageBox.Show("Second Selection count: " + m_editor.SelectionCount);
System.Windows.Forms.MessageBox.Show("second map count" + mxdoc.FocusMap.SelectionCount);

rest of my code..........It updates my attribute table view...
}
I wrote this code and it worked 4-5 times but now its not working...
thanks in advance...
0 Kudos
0 Replies