コード例 #1
0
		public override void OnClick()
		{
			if (m_mapControl == null)
			{
				MessageBox.Show("Error: Map control is null for this command");
				return;
			}

			// Get the NALayer that was right-clicked on in the table of contents
			// m_MapControl.CustomProperty was set in frmMain.axTOCControl1_OnMouseDown
			var naLayer = m_mapControl.CustomProperty as INALayer3;
			if (naLayer == null)
			{
				MessageBox.Show("Error: NALayer was not set as the CustomProperty of the map control");
				return;
			}

			// Show the Property Page form for the NALayer
			var props = new frmNALayerProperties();
			if (props.ShowModal(naLayer))
			{
				// Notify the ActiveView that the contents have changed so the TOC and NAWindow know to refresh themselves.
				m_mapControl.ActiveView.ContentsChanged();
			}
		}
コード例 #2
0
        public override void OnClick()
        {
            if (m_mapControl == null)
            {
                MessageBox.Show("Error: Map control is null for this command");
                return;
            }

            // Get the NALayer that was right-clicked on in the table of contents
            // m_MapControl.CustomProperty was set in frmMain.axTOCControl1_OnMouseDown
            var naLayer = m_mapControl.CustomProperty as INALayer3;

            if (naLayer == null)
            {
                MessageBox.Show("Error: NALayer was not set as the CustomProperty of the map control");
                return;
            }

            // Show the Property Page form for the NALayer
            var props = new frmNALayerProperties();

            if (props.ShowModal(naLayer))
            {
                // Notify the ActiveView that the contents have changed so the TOC and NAWindow know to refresh themselves.
                m_mapControl.ActiveView.ContentsChanged();
            }
        }
コード例 #3
0
        public override void OnClick()
        {
            // Show the Property Page form for the NALayer

            // Get the NALayer that was right-clicked on in the table of contents
            // m_MapControl.CustomProperty was set in frmMain.axTOCControl1_OnMouseDown
            INALayer             naLayer = (INALayer)m_mapControl.CustomProperty;
            frmNALayerProperties props   = new frmNALayerProperties();

            if (props.ShowModal(naLayer))
            {
                // Notify the ActiveView that the contents have changed so the TOC and NAWindow know to refresh themselves.
                m_mapControl.ActiveView.ContentsChanged();
            }
        }