首页 > 代码库 > 获取sde 工作空间 propertys
获取sde 工作空间 propertys
// This example shows how to inspect and display different types of properties for a workspace.public void DisplayWorkspaceProperties(IWorkspace workspace){ // Cast the workspace to the IWorkspaceProperties interface. IWorkspaceProperties workspaceProperties = (IWorkspaceProperties)workspace; // Example #1: Check whether or not the workspace can execute SQL. The first step is to retrieve // the property. IWorkspaceProperty canExecuteSqlProperty = workspaceProperties.get_Property(esriWorkspacePropertyGroupType.esriWorkspacePropertyGroup, (int)esriWorkspacePropertyType.esriWorkspacePropCanExecuteSQL); // Now check whether the property is supported. if (canExecuteSqlProperty.IsSupported) { // If the property is supported, check its value. This property returns a boolean value. Boolean canExecuteSql = Convert.ToBoolean(canExecuteSqlProperty.PropertyValue); Console.WriteLine("Workspace can execute SQL: {0}", canExecuteSql); } else { // If the property is not supported, it‘s impossible to check its value. Console.WriteLine("esriWorkspacePropCanExecuteSQL is not supported by the workspace."); } // Example #2: Find the maximum field name length for the workspace. IWorkspaceProperty maxFieldNameLengthProperty = workspaceProperties.get_Property(esriWorkspacePropertyGroupType.esriWorkspaceTablePropertyGroup, (int)esriWorkspaceTablePropertyType.esriTablePropMaxFieldNameLength); // Now check whether the property is supported. if (maxFieldNameLengthProperty.IsSupported) { // If the property is supported, check its value. This property returns an integer value. int maxFieldNameLength = Convert.ToInt32(maxFieldNameLengthProperty.PropertyValue); Console.WriteLine("Maximum field name length: {0}", maxFieldNameLength); } else { // If the property is not supported, it‘s impossible to check its value. Console.WriteLine("esriTablePropMaxFieldNameLength is not supported by the workspace."); }}
获取sde 工作空间 propertys
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。