Esempio n. 1
0
 private void CatalogView_Load(object sender, EventArgs e)
 {
     if (!base.DesignMode)
     {
         if (this.GxCatalog == null)
         {
             this.GxCatalog = new GxCatalog();
         }
         this.kTreeView1.GxCatalog = this.GxCatalog;
         this.kTreeView1.InitTreeView();
         string name = (this.GxCatalog as IGxObject).Name;
         this.imageComboBoxEdit1.Properties.SmallImages = this.imageList1;
         this.listView1.LargeImageList = this.imageList1;
         this.listView1.SmallImageList = this.imageList1;
         ImageComboBoxItemEx imageComboBoxItemEx = new ImageComboBoxItemEx(name, this.GxCatalog,
                                                                           this.GetImageIndex(this.GxCatalog as IGxObject), 0)
         {
             Tag = this.GxCatalog
         };
         this.imageComboBoxEdit1.Properties.Items.Add(imageComboBoxItemEx);
         IEnumGxObject children = (this.GxCatalog as IGxObjectContainer).Children;
         children.Reset();
         for (IGxObject i = children.Next(); i != null; i = children.Next())
         {
             imageComboBoxItemEx = new ImageComboBoxItemEx(i.Name, i.FullName, this.GetImageIndex(i), 1)
             {
                 Tag = i
             };
             this.imageComboBoxEdit1.Properties.Items.Add(imageComboBoxItemEx);
         }
         this.imageComboBoxEdit1.SelectedIndex = 0;
     }
 }
Esempio n. 2
0
        public override void OnClick()
        {
            IGxObject firstObject = ((IGxSelection)_context.GxSelection).FirstObject;

            if (firstObject is IGxFile)
            {
                string path = (firstObject as IGxFile).Path;
                path = (path[path.Length - 1] != '\\'
                    ? string.Concat(path, "\\新建文件型数据库")
                    : string.Concat(path, "新建文件型数据库"));
                string str = string.Concat(path, ".gdb");
                int    num = 1;
                while (Directory.Exists(str))
                {
                    num++;
                    str = string.Concat(path, " (", num.ToString(), ").gdb");
                }
                IWorkspaceFactory fileGDBWorkspaceFactoryClass = new FileGDBWorkspaceFactory();
                try
                {
                    IWorkspaceName workspaceName = fileGDBWorkspaceFactoryClass.Create(Path.GetDirectoryName(str),
                                                                                       Path.GetFileNameWithoutExtension(str), null, 0);
                    IGxObject gxDatabase = new GxDatabase();
                    (gxDatabase as IGxDatabase).WorkspaceName = workspaceName;
                    IGxCatalog catalog = GxCatalogCommon.GetCatalog(firstObject);
                    gxDatabase.Attach(firstObject, catalog);
                    catalog.ObjectAdded(gxDatabase);
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.Message);
                }
            }
        }
Esempio n. 3
0
 public void Attach(IGxObject Parent, IGxCatalog pCatalog)
 {
     m_parentCatalog = pCatalog;
     m_parentObject  = Parent;
     this.Refresh();
     //throw new Exception("The method or operation is not implemented.");
 }
Esempio n. 4
0
 public void Attach(IGxObject igxObject_1, IGxCatalog igxCatalog_1)
 {
     this.igxObject_0 = igxObject_1;
     if (igxObject_1 is IGxObjectContainer)
     {
         (igxObject_1 as IGxObjectContainer).AddChild(this);
     }
 }
Esempio n. 5
0
 public void Attach(IGxObject igxObject_2, IGxCatalog igxCatalog_1)
 {
     this.igxObject_0  = igxObject_2;
     this.igxCatalog_0 = igxCatalog_1;
     if (this.igxObject_0 is IGxObjectContainer)
     {
         (this.igxObject_0 as IGxObjectContainer).AddChild(this);
     }
 }
Esempio n. 6
0
 public virtual void Attach(IGxObject igxObject_0, IGxCatalog igxCatalog_0)
 {
     this.m_pParent    = igxObject_0;
     this.m_pGxCatalog = igxCatalog_0;
     if (this.m_pParent is IGxObjectContainer)
     {
         (this.m_pParent as IGxObjectContainer).AddChild(this);
     }
 }
Esempio n. 7
0
 public void Detach()
 {
     if (this.igxCatalog_0 != null)
     {
         this.igxCatalog_0.ObjectDeleted(this);
     }
     this.igxObject_0  = null;
     this.igxCatalog_0 = null;
 }
Esempio n. 8
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();
 }
Esempio n. 9
0
 public OpenFolderDataHelper(IGxObjectArray igxObjectArray_1, string string_1, IGxCatalog igxCatalog_1,
                             IGxObject igxObject_1)
 {
     this.CreateHandle();
     base.CreateControl();
     this.igxObjectArray_0 = igxObjectArray_1;
     this.string_0         = string_1;
     this.igxCatalog_0     = igxCatalog_1;
     this.igxObject_0      = igxObject_1;
 }
Esempio n. 10
0
 public void Attach(IGxObject igxObject_1, IGxCatalog igxCatalog_1)
 {
     this.igxObject_0  = igxObject_1;
     this.igxCatalog_0 = igxCatalog_1;
     if (this.igxObject_0 is IGxObjectContainer)
     {
         (this.igxObject_0 as IGxObjectContainer).AddChild(this);
     }
     if (this.iworkspaceName_0.Type != esriWorkspaceType.esriLocalDatabaseWorkspace)
     {
     }
 }
Esempio n. 11
0
 public static void ConnectGDB(IGxDatabase igxDatabase_0)
 {
     if ((igxDatabase_0 != null) && !igxDatabase_0.IsConnected)
     {
         Cursor.Current = Cursors.WaitCursor;
         igxDatabase_0.Connect();
         IGxCatalog catalog = GetCatalog(igxDatabase_0 as IGxObject);
         catalog.ObjectChanged(igxDatabase_0 as IGxObject);
         catalog.ObjectRefreshed(igxDatabase_0 as IGxObject);
         Cursor.Current = Cursors.Default;
     }
 }
Esempio n. 12
0
 public void Attach(IGxObject igxObject_1, IGxCatalog igxCatalog_1)
 {
     this.igxObject_0  = igxObject_1;
     this.igxCatalog_0 = igxCatalog_1;
     if (this.igxObject_0 is IGxObjectContainer)
     {
         (this.igxObject_0 as IGxObjectContainer).AddChild(this);
     }
     if (this.igxObjectArray_0.Count == 0)
     {
         this.method_0();
     }
 }
Esempio n. 13
0
 public void Detach()
 {
     if (this.igxCatalog_0 != null)
     {
         this.igxCatalog_0.ObjectDeleted(this);
     }
     if (this.igxObject_0 is IGxObjectContainer)
     {
         (this.igxObject_0 as IGxObjectContainer).DeleteChild(this);
     }
     this.igxObject_0  = null;
     this.igxCatalog_0 = null;
 }
Esempio n. 14
0
 public virtual void Detach()
 {
     if (this.m_pParent is IGxObjectContainer)
     {
         (this.m_pParent as IGxObjectContainer).DeleteChild(this);
     }
     if (this.m_pGxCatalog != null)
     {
         this.m_pGxCatalog.ObjectDeleted(this);
     }
     this.m_pParent    = null;
     this.m_pGxCatalog = null;
 }
Esempio n. 15
0
        public void Detach()
        {
            //It is our responsibility to detach all our children before deleting them.
            //This is to avoid circular referencing problems.
            int i        = 0;
            int tempFor1 = m_pChildren.Count;

            for (i = 0; i <= tempFor1; i++)
            {
                m_pChildren.Item(i).Detach();
            }
            m_pParent  = null;
            m_pCatalog = null;
        }
Esempio n. 16
0
        private void frmExplorerData_Load(object sender, EventArgs e)
        {
            if (_gxCatalog == null)
            {
                _gxCatalog = new GxCatalog();
            }
            GISDataComboItem item = new GISDataComboItem((_gxCatalog as IGxObject).Name, (_gxCatalog as IGxObject).Name,
                                                         this.GetImageIndex(this._gxCatalog as IGxObject), 0)
            {
                Tag = _gxCatalog
            };

            gisDataComboBox1.Items.Add(item);
            IEnumGxObject children = (this._gxCatalog as IGxObjectContainer).Children;

            children.Reset();
            for (IGxObject subObj = children.Next(); subObj != null; subObj = children.Next())
            {
                item = new GISDataComboItem(subObj.Name, subObj.FullName, this.GetImageIndex(subObj), 1)
                {
                    Tag = subObj
                };
                this.gisDataComboBox1.AddChildNode(item);
            }
            gisDataComboBox1.SelectedIndex = 0;
            this._array2.RemoveAll();
            this._gxObjects.Clear();
            this.cboShowType.Items.Clear();
            for (int i = 0; i < this._filterArray.Count; i++)
            {
                IGxObjectFilter filter = this._filterArray.Element[i] as IGxObjectFilter;
                this.cboShowType.Items.Add(filter.Description);
                if (filter == this._gxObjectFilter)
                {
                    this.cboShowType.SelectedIndex = i;
                }
            }
            if ((this._modalType == 0) && (this._filterArray.Count > 1))
            {
                this.cboShowType.Items.Add("已列出的所有过滤条件");
            }
            if (this.cboShowType.SelectedIndex == -1)
            {
                this.cboShowType.SelectedIndex = this.cboShowType.Items.Count - 1;
            }
            if ((_pStartLocation != null) && (_pStartLocation is string))
            {
                this.LoadViewer(_pStartLocation as string);
            }
        }
Esempio n. 17
0
        /// <summary>
        /// Open the add data dialog.
        /// </summary>
        /// <param name="sCaption">Caption of the dialog.</param>
        /// <param name="pFilter">Dataset filters.</param>
        /// <param name="bMultiSelect">Allow for multiple selections.</param>
        /// <returns></returns>
        private string OpenGXDialog(string sCaption, IGxObjectFilter pFilter, bool bMultiSelect)
        {
            IGxDialog     pBrowse  = new GxDialogClass();
            IEnumGxObject pSelect  = null;
            IGxObject     pObject  = null;
            IGxCatalog    pCatalog = pBrowse.InternalCatalog;

            string sFile = "";

            try
            {
                //set up the filters

                //setup the browse window
                pBrowse.AllowMultiSelect = bMultiSelect;
                pBrowse.Title            = sCaption;
                pBrowse.ObjectFilter     = pFilter; //!!!this should be written to read a filter collection, but throws a COM QI error
                pBrowse.RememberLocation = true;

                //open the browse window and get the selected file info
                if (pBrowse.DoModalOpen(0, out pSelect))
                {
                    pObject = pSelect.Next();
                    while (pObject != null)
                    {
                        sFile  += pObject.FullName + ";";
                        pObject = pSelect.Next();
                    }
                    //pInternalName = (IGxObjectInternalName) pObject;
                    //pName = (IName) pInternalName.InternalObjectName;

                    //remove the last semi colon
                    if (sFile.Length > 0)
                    {
                        sFile = sFile.Substring(0, sFile.Length - 1);
                    }
                }
                return(sFile);
            }
            catch (Exception oErr)
            {
                MessageBox.Show(oErr.ToString(), "Data Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(null);
            }
        }
        protected override void OnClick()
        {
            // set
            m_pApp = (IGxApplication)CustomGxFilter_CS.ArcCatalog.Application;
            IGxCatalog      pCat        = null;
            IGxFileFilter   pFileFilter = null;
            IEnumGxObject   pSelection  = null;
            IGxDialog       pDlg        = null;
            IGxObjectFilter pFilter     = null;

            try
            {
                pDlg        = new GxDialog();
                pCat        = pDlg.InternalCatalog;
                pFileFilter = pCat.FileFilter;
                if (pFileFilter.FindFileType("py") < 0)
                {
                    //enter the third parameter with the location of the icon as needed
                    pFileFilter.AddFileType("PY", "Python file", "");
                }

                pFilter               = new CustomGxFilter_CS.CustomFilter();
                pDlg.ObjectFilter     = pFilter;
                pDlg.Title            = "Please select a .Py file";
                pDlg.AllowMultiSelect = true;
                pDlg.DoModalOpen(0, out pSelection);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.ToString());
            }
            finally
            {
                pCat        = null;
                pFileFilter = null;
                pSelection  = null;
                pDlg        = null;
                pFilter     = null;
            }
        }
Esempio n. 19
0
        public override void OnClick()
        {
            IGxObject firstObject = ((IGxSelection)_context.GxSelection).FirstObject;

            if (firstObject is IGxFile)
            {
                string path = (firstObject as IGxFile).Path;
                path = (path[path.Length - 1] != '\\' ? string.Concat(path, "\\新建文件夹") : string.Concat(path, "新建文件夹"));
                string str = path;
                int    num = 1;
                while (Directory.Exists(str))
                {
                    num++;
                    str = string.Concat(path, " (", num.ToString(), ")");
                }
                Directory.CreateDirectory(str);
                IGxObject gxFolder = new GxFolder();
                (gxFolder as IGxFile).Path = str;
                IGxCatalog catalog = GxCatalogCommon.GetCatalog(firstObject);
                gxFolder.Attach(firstObject, catalog);
                catalog.ObjectAdded(gxFolder);
            }
        }
Esempio n. 20
0
 public void Attach(ESRI.ArcGIS.Catalog.IGxObject Parent, ESRI.ArcGIS.Catalog.IGxCatalog pCatalog)
 {
     m_pParent  = (CustomRootObject_CS.clsGxStyleGallery)Parent;
     m_pCatalog = pCatalog;
 }
Esempio n. 21
0
 public override void Attach(IGxObject Parent, IGxCatalog pCatalog)
 {
     base.Attach(Parent, pCatalog);
 }
Esempio n. 22
0
 public void Attach(IGxObject igxObject_0, IGxCatalog igxCatalog_0)
 {
 }
 public void Deactivate()
 {
     frmGxStyleView.GxStyleView = null;
     m_pApp = null;
     m_pCatalog = null;
 }
 public void Attach(IGxObject Parent, IGxCatalog pCatalog)
 {
     m_parentCatalog = pCatalog;
     m_parentObject = Parent;
     //this.Refresh();
     //throw new Exception("The method or operation is not implemented.");
 }
 public void Detach()
 {
     m_pParent  = null;
     m_pCatalog = null;
 }
        public GxPyFactory()
		{
			m_catalog = null;
		}
 public void Detach()
 {
     m_gxParent = null;
     m_gxCatalog = null;
 }
 public void Attach(ESRI.ArcGIS.Catalog.IGxObject Parent, ESRI.ArcGIS.Catalog.IGxCatalog pCatalog)
 {
     m_pParent = Parent;
     m_pCatalog = pCatalog;
 }
Esempio n. 29
0
 public void Attach(IGxObject Parent, IGxCatalog pCatalog)
 {
     m_gxParent  = Parent;
     m_gxCatalog = pCatalog;
 }
Esempio n. 30
0
 public GxPyFactory()
 {
     m_catalog = null;
 }
Esempio n. 31
0
 public void Deactivate()
 {
     frmGxStyleView.GxStyleView = null;
     m_pApp     = null;
     m_pCatalog = null;
 }
 public void Attach(ESRI.ArcGIS.Catalog.IGxObject Parent, ESRI.ArcGIS.Catalog.IGxCatalog pCatalog)
 {
     m_pParent = (CustomRootObject_CS.clsGxStyleGallery)Parent;
     m_pCatalog = pCatalog;
 }
 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 Attach(IGxObject Parent, IGxCatalog pCatalog)
 {
     m_gxParent = Parent;
     m_gxCatalog = pCatalog;
 }
Esempio n. 35
0
 /// <summary>
 ///     Activates the specified view.
 /// </summary>
 /// <param name="application">The application.</param>
 /// <param name="catalog">The catalog.</param>
 /// <remarks>
 ///     Use the Activate method to hold on to the application reference and GxCatalog objects that are passed in as
 ///     parameters.
 /// </remarks>
 public abstract void Activate(IGxApplication application, IGxCatalog catalog);
 public void Attach(ESRI.ArcGIS.Catalog.IGxObject Parent, ESRI.ArcGIS.Catalog.IGxCatalog pCatalog)
 {
     m_pParent = (clsGxStyleGalleryClass)Parent;
     m_pCatalog = pCatalog;
 }
Esempio n. 37
0
 public void Detach()
 {
     m_gxParent  = null;
     m_gxCatalog = null;
 }
 public void Detach()
 {
     m_pParent = null;
     m_pCatalog = null;
 }
Esempio n. 39
0
 public override void Attach(IGxObject Parent, IGxCatalog pCatalog)
 {
     base.Attach(Parent, pCatalog);
 }
 public void Attach(ESRI.ArcGIS.Catalog.IGxObject Parent, ESRI.ArcGIS.Catalog.IGxCatalog pCatalog)
 {
     m_pParent  = (clsGxStyleGalleryClass)Parent;
     m_pCatalog = pCatalog;
 }
 public void Detach()
 {
     //It is our responsibility to detach all of our children before deleting
     //them.  This is to avoid circular referencing problems.
     int i = 0;
     int tempFor1 = m_pChildren.Count;
     for (i = 0; i <= tempFor1; i++)
     {
         m_pChildren.Item(i).Detach();
     }
     m_pParent = null;
     m_pCatalog = null;
 }
Esempio n. 42
0
 public void Attach(IGxObject igxObject_1, IGxCatalog igxCatalog_1)
 {
     this.igxObject_0  = igxObject_1;
     this.igxCatalog_0 = igxCatalog_1;
 }