public void Deactivate()
 {
     //Prevent circular reference
     if (m_pSelection != null)
     {
         m_pSelection = null;
     }
 }
Beispiel #2
0
 public void Activate(ESRI.ArcGIS.CatalogUI.IGxApplication Application, ESRI.ArcGIS.Catalog.IGxCatalog Catalog)
 {
     m_pApp       = Application;
     m_pCatalog   = Catalog;
     m_pSelection = (GxSelection)Catalog.Selection;
     m_pSelection.OnSelectionChanged += new IGxSelectionEvents_OnSelectionChangedEventHandler(m_pSelection_OnSelectionChanged);
     frmGxStyleView.GxStyleView       = this;
     Refresh();
 }
        public void Activate(ESRI.ArcGIS.CatalogUI.IGxApplication Application, ESRI.ArcGIS.Catalog.IGxCatalog Catalog)
        {
            try
            {
                //Get selection
                m_pSelection = (GxSelection)Application.Selection;
                m_pSelection.OnSelectionChanged += new IGxSelectionEvents_OnSelectionChangedEventHandler(OnSelectionChanged);
                // get data from the MyProject's settings.
                // please change accordingly
                m_path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                m_path = System.IO.Path.Combine(m_path, @"ArcGIS\data\world");
                if (!Directory.Exists(m_path))
                {
                    throw new Exception(string.Format("Fix code to point to your sample data: {0} was not found", m_path));
                }

                //Add data to map control
                frmExtentView.AxMapControl1.AddShapeFile(m_path, "world30");
                frmExtentView.AxMapControl1.Extent = frmExtentView.AxMapControl1.FullExtent;

                //Create and setup the fill symbol that will be used to draw the dataset's extent
                // rectangle if it is not cached
                if (m_pFillSymbol == null)
                {
                    m_pFillSymbol = new SimpleFillSymbol();

                    IColor      pColor      = null;
                    ILineSymbol pLineSymbol = null;
                    pColor              = new RgbColor();
                    pColor.NullColor    = true;
                    m_pFillSymbol.Color = pColor;

                    pLineSymbol           = new SimpleLineSymbol();
                    pColor.NullColor      = false;
                    pColor.RGB            = 200; //Red
                    pLineSymbol.Color     = pColor;
                    pLineSymbol.Width     = 2;
                    m_pFillSymbol.Outline = pLineSymbol;
                }

                //Draw extent
                Refresh();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.ToString());
            }
        }
Beispiel #4
0
        public void Activate(ESRI.ArcGIS.CatalogUI.IGxApplication Application, ESRI.ArcGIS.Catalog.IGxCatalog Catalog)
        {
            try
            {
                //Get selection
                m_pSelection = (GxSelection)Application.Selection;
                m_pSelection.OnSelectionChanged += new IGxSelectionEvents_OnSelectionChangedEventHandler(OnSelectionChanged);
                // get data from the MyProject's settings.
                // please change accordingly
                m_path = Properties.Settings.Default.DataLocation;
                //Add data to map control
                frmExtentView.AxMapControl1.AddShapeFile(m_path, "world30");
                frmExtentView.AxMapControl1.Extent = frmExtentView.AxMapControl1.FullExtent;

                //Create and setup the fill symbol that will be used to draw the dataset's extent
                // rectangle if it is not cached
                if (m_pFillSymbol == null)
                {
                    m_pFillSymbol = new SimpleFillSymbol();

                    IColor      pColor      = null;
                    ILineSymbol pLineSymbol = null;
                    pColor              = new RgbColor();
                    pColor.NullColor    = true;
                    m_pFillSymbol.Color = pColor;

                    pLineSymbol           = new SimpleLineSymbol();
                    pColor.NullColor      = false;
                    pColor.RGB            = 200; //Red
                    pLineSymbol.Color     = pColor;
                    pLineSymbol.Width     = 2;
                    m_pFillSymbol.Outline = pLineSymbol;
                }

                //Draw extent
                Refresh();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.ToString());
            }
        }
Beispiel #5
0
        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            IGxSelection gxSelection;

            this.Clear();
            if (this.listView1.SelectedItems.Count > 0)
            {
                if (this.GxCatalog == null)
                {
                    gxSelection = new GxSelection();
                }
                else
                {
                    gxSelection = this.GxCatalog.Selection;
                    gxSelection.Clear(null);
                }
                int count = this.listView1.SelectedItems.Count - 1;
                for (int i = 0; i < this.listView1.SelectedItems.Count; i++)
                {
                    ListViewItem item = this.listView1.SelectedItems[i];
                    if (item.Tag != null)
                    {
                        gxSelection.Select(item.Tag as IGxObject, true, (i == count ? false : true));
                    }
                }
                if (gxSelection.Count > 1)
                {
                    this.AddItem("Catalog_Copy", false);
                    this.AddItem("Catalog_Paste", false);
                    this.AddItem("Catalog_Delete", true);
                }
                else if (gxSelection.Count == 1)
                {
                    IGxObject firstObject = gxSelection.FirstObject;
                    if (firstObject is IGxContextMenuWap)
                    {
                        (firstObject as IGxContextMenuWap).Init(this);
                    }
                }
            }
        }
 public void Activate(ESRI.ArcGIS.CatalogUI.IGxApplication Application, ESRI.ArcGIS.Catalog.IGxCatalog Catalog)
 {
     m_pSelection = (GxSelection) Application.Selection;
     m_pSelection.OnSelectionChanged += new IGxSelectionEvents_OnSelectionChangedEventHandler(OnSelectionChanged);
     Refresh();
 }
 public void Deactivate()
 {
     //Prevent circular reference
     if (m_pSelection != null)
         m_pSelection = null;
 }
 public void Activate(ESRI.ArcGIS.CatalogUI.IGxApplication Application, ESRI.ArcGIS.Catalog.IGxCatalog Catalog)
 {
     m_pSelection = (GxSelection)Application.Selection;
     m_pSelection.OnSelectionChanged += new IGxSelectionEvents_OnSelectionChangedEventHandler(OnSelectionChanged);
     Refresh();
 }
 public void Activate(ESRI.ArcGIS.CatalogUI.IGxApplication Application, ESRI.ArcGIS.Catalog.IGxCatalog Catalog)
 {
     m_pApp = Application;
     m_pCatalog = Catalog;
     m_pSelection = (GxSelection)Catalog.Selection;
     m_pSelection.OnSelectionChanged += new IGxSelectionEvents_OnSelectionChangedEventHandler(m_pSelection_OnSelectionChanged);
     frmGxStyleView.GxStyleView = this;
     Refresh();
 }
        public void Activate(ESRI.ArcGIS.CatalogUI.IGxApplication Application, ESRI.ArcGIS.Catalog.IGxCatalog Catalog)
        {
            try
            {
                //Get selection
                m_pSelection = (GxSelection) Application.Selection;
                m_pSelection.OnSelectionChanged += new IGxSelectionEvents_OnSelectionChangedEventHandler(OnSelectionChanged);
                // get data from the MyProject's settings.
                // please change accordingly
                m_path = Properties.Settings.Default.DataLocation;
                //Add data to map control
                frmExtentView.AxMapControl1.AddShapeFile(m_path, "world30");
                frmExtentView.AxMapControl1.Extent = frmExtentView.AxMapControl1.FullExtent;

                //Create and setup the fill symbol that will be used to draw the dataset's extent
                // rectangle if it is not cached
                if (m_pFillSymbol == null)
                {
                    m_pFillSymbol = new SimpleFillSymbol();

                    IColor pColor = null;
                    ILineSymbol pLineSymbol = null;
                    pColor = new RgbColor();
                    pColor.NullColor = true;
                    m_pFillSymbol.Color = pColor;

                    pLineSymbol = new SimpleLineSymbol();
                    pColor.NullColor = false;
                    pColor.RGB = 200; //Red
                    pLineSymbol.Color = pColor;
                    pLineSymbol.Width = 2;
                    m_pFillSymbol.Outline = pLineSymbol;
                }

                //Draw extent
                Refresh();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.ToString());
            }
        }