private void WireSelectionEvent()
        {
            try
            {
                if (m_naWindowEventSource == null)
                {
                    return;
                }

                if (m_mapEventSource != null)
                {
                    UnWireSelectionEvent();
                }

                m_mapEventSource = ActiveMap;
                if (m_mapEventSource == null)
                {
                    return;
                }

                UpdateSelectionEIDArrayParameterValues();

                //Create an instance of the delegate, add it to SelectionChanged event
                m_ActiveViewEventsSelectionChanged = new ESRI.ArcGIS.Carto.IActiveViewEvents_SelectionChangedEventHandler(OnActiveViewEventsSelectionChanged);
                ((ESRI.ArcGIS.Carto.IActiveViewEvents_Event)(m_mapEventSource)).SelectionChanged += m_ActiveViewEventsSelectionChanged;
            }
            catch (Exception ex)
            {
                string msg = SubsetHelperUI.GetFullExceptionMessage(ex);
                MessageBox.Show(msg, "Wire Selection Event");
            }
        }
Beispiel #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //write events
            m_Map            = axMapControl1.Map;
            activeViewEvents = m_Map as IActiveViewEvents_Event;

            m_ActiveViewEventsSelectionChanged = new ESRI.ArcGIS.Carto.IActiveViewEvents_SelectionChangedEventHandler(OnActiveViewEventsSelectionChanged);
            activeViewEvents.SelectionChanged += m_ActiveViewEventsSelectionChanged;
        }
		private void WireSelectionEvent()
		{
			try
			{
				if (m_naWindowEventSource == null)
					return;

				if (m_mapEventSource != null)
					UnWireSelectionEvent();

				m_mapEventSource = ActiveMap;
				if (m_mapEventSource == null)
					return;

				UpdateSelectionEIDArrayParameterValues();

				//Create an instance of the delegate, add it to SelectionChanged event
				m_ActiveViewEventsSelectionChanged = new ESRI.ArcGIS.Carto.IActiveViewEvents_SelectionChangedEventHandler(OnActiveViewEventsSelectionChanged);
				((ESRI.ArcGIS.Carto.IActiveViewEvents_Event)(m_mapEventSource)).SelectionChanged += m_ActiveViewEventsSelectionChanged;
			}
			catch (Exception ex)
			{
				string msg = SubsetHelperUI.GetFullExceptionMessage(ex);
				MessageBox.Show(msg, "Wire Selection Event");
			}
		}