Esempio n. 1
0
        public static bool IsConnectedToGeodatabase(IWorkspaceName iworkspaceName_0)
        {
            bool geodatabase;
            bool flag = false;

            try
            {
                object property = iworkspaceName_0.ConnectionProperties.GetProperty("IS_GEODATABASE");
                if (property != null)
                {
                    flag = Convert.ToBoolean(property);
                }
                else
                {
                    geodatabase =
                        WorkspaceOperator.IsConnectedToGeodatabase((iworkspaceName_0 as IName).Open() as IWorkspace);
                    return(geodatabase);
                }
            }
            catch (Exception exception)
            {
            }
            geodatabase = flag;
            return(geodatabase);
        }
Esempio n. 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);
        }