Пример #1
0
        public static IWorkspace OpenWorkspace(string string_0)
        {
            IWorkspace workspace;
            string     lower = System.IO.Path.GetExtension(string_0).ToLower();

            if (lower == ".mdb")
            {
                workspace = WorkspaceOperator.OpenPersonGDB(string_0);
            }
            else if (lower == ".sde")
            {
                workspace = WorkspaceOperator.OpenSDEGDB(string_0);
            }
            else if ((lower == null ? false : lower.Length != 0))
            {
                workspace = null;
            }
            else
            {
                workspace = WorkspaceOperator.OpenFileGDB(string_0);
            }
            return(workspace);
        }
Пример #2
0
        public void Init(object object_0)
        {
            this.ipopuMenuWrap_0 = object_0 as IPopuMenuWrap;
            this.ipopuMenuWrap_0.Clear();
            bool flag = this.bool_1;

            if (this.IsRemoteDatabase)
            {
                if (!this.bool_0)
                {
                    this.bool_0 = true;
                    if (this.iworkspace_0 == null)
                    {
                        flag = WorkspaceOperator.IsConnectedToGeodatabase(this.iworkspaceName_0);
                    }
                    else
                    {
                        flag = WorkspaceOperator.IsConnectedToGeodatabase(this.iworkspace_0);
                    }
                    this.bool_1 = flag;
                }
            }
            else
            {
                flag = true;
            }
            this.ipopuMenuWrap_0.AddItem("Catalog_Copy", false);
            this.ipopuMenuWrap_0.AddItem("Catalog_Paste", false);
            this.ipopuMenuWrap_0.AddItem("Catalog_Refresh", false);
            this.ipopuMenuWrap_0.AddItem("Catalog_Delete", true);
            this.ipopuMenuWrap_0.AddItem("Catalog_Rename", false);
            this.ipopuMenuWrap_0.ClearSubItem("NewBarSubItem");
            this.ipopuMenuWrap_0.AddSubmenuItem("NewBarSubItem", "新建", "", true);
            if (flag)
            {
                this.ipopuMenuWrap_0.AddItem("Catalog_NewFeatureDataset", "NewBarSubItem", false);
            }
            this.ipopuMenuWrap_0.AddItem("Catalog_NewFeatureClass", "NewBarSubItem", false);
            this.ipopuMenuWrap_0.AddItem("Catalog_NewTable", "NewBarSubItem", false);
            if (flag)
            {
                this.ipopuMenuWrap_0.AddItem("Catalog_NewRelationClass", "NewBarSubItem", false);
                this.ipopuMenuWrap_0.AddItem("Catalog_NewRasterFolder", "NewBarSubItem", true);
                this.ipopuMenuWrap_0.AddItem("Catalog_NewRasterDataset", "NewBarSubItem", false);
            }
            this.ipopuMenuWrap_0.ClearSubItem("ImportBarSubItem");
            this.ipopuMenuWrap_0.AddSubmenuItem("ImportBarSubItem", "导入", "", true);
            this.ipopuMenuWrap_0.AddItem("Catalog_ImportSingleFeatureClass", "ImportBarSubItem", false);
            this.ipopuMenuWrap_0.AddItem("Catalog_ImportMultiFeatureClasses", "ImportBarSubItem", false);
            this.ipopuMenuWrap_0.AddItem("Catalog_ImportSingleTable", "ImportBarSubItem", false);
            this.ipopuMenuWrap_0.AddItem("Catalog_ImportMultiTables", "ImportBarSubItem", false);
            if (flag)
            {
                this.ipopuMenuWrap_0.AddItem("Catalog_RasterToGDB", "ImportBarSubItem", false);
            }
            this.ipopuMenuWrap_0.AddItem("Catalog_ImportXY", "ImportBarSubItem", false);
            if (this.IsRemoteDatabase)
            {
                if (!flag)
                {
                    this.ipopuMenuWrap_0.AddItem("Catalog_EnableSDE", true);
                }
                this.ipopuMenuWrap_0.AddItem("Catalog_VersionInfo", true);
                this.ipopuMenuWrap_0.AddItem("Catalog_Connection", false);
                this.ipopuMenuWrap_0.AddItem("Catalog_Disconnection", false);
                this.ipopuMenuWrap_0.AddItem("Catalog_ConnectionProperty", false);
            }
            this.ipopuMenuWrap_0.AddItem("Catalog_GxObjectProperty", true);
        }