private bool SetupFeaturePropertySheet(ILayer layer) { if (layer == null) { return(false); } try { ESRI.ArcGIS.Framework.IComPropertySheet pComPropSheet; pComPropSheet = new ESRI.ArcGIS.Framework.ComPropertySheetClass(); pComPropSheet.Title = layer.Name + "- Properties"; ESRI.ArcGIS.esriSystem.UID pPPUID = new ESRI.ArcGIS.esriSystem.UIDClass(); pComPropSheet.AddCategoryID(pPPUID); // General.... ESRI.ArcGIS.Framework.IPropertyPage pGenPage = new ESRI.ArcGIS.CartoUI.GeneralLayerPropPageClass(); pComPropSheet.AddPage(pGenPage); // Source ESRI.ArcGIS.Framework.IPropertyPage pSrcPage = new ESRI.ArcGIS.CartoUI.FeatureLayerSourcePropertyPageClass(); pComPropSheet.AddPage(pSrcPage); // Selection... ESRI.ArcGIS.Framework.IPropertyPage pSelectPage = new ESRI.ArcGIS.CartoUI.FeatureLayerSelectionPropertyPageClass(); pComPropSheet.AddPage(pSelectPage); // Display.... ESRI.ArcGIS.Framework.IPropertyPage pDispPage = new ESRI.ArcGIS.CartoUI.FeatureLayerDisplayPropertyPageClass(); pComPropSheet.AddPage(pDispPage); // Symbology.... ESRI.ArcGIS.Framework.IComPropertyPage pDrawPage = new ESRI.ArcGIS.CartoUI.LayerDrawingPropertyPageClass(); pComPropSheet.AddPage(pDrawPage); // Fields... ESRI.ArcGIS.Framework.IPropertyPage pFieldsPage = new ESRI.ArcGIS.CartoUI.LayerFieldsPropertyPageClass(); pComPropSheet.AddPage(pFieldsPage); // Definition Query... ESRI.ArcGIS.Framework.IPropertyPage pQueryPage = new ESRI.ArcGIS.CartoUI.LayerDefinitionQueryPropertyPageClass(); pComPropSheet.AddPage(pQueryPage); // Labels.... ESRI.ArcGIS.Framework.IPropertyPage pSelPage = new ESRI.ArcGIS.CartoUI.LayerLabelsPropertyPageClass(); pComPropSheet.AddPage(pSelPage); // Joins & Relates.... ESRI.ArcGIS.Framework.IPropertyPage pJoinPage = new ESRI.ArcGIS.ArcMapUI.JoinRelatePageClass(); pComPropSheet.AddPage(pJoinPage); // Setup layer link ESRI.ArcGIS.esriSystem.ISet pMySet = new ESRI.ArcGIS.esriSystem.SetClass(); pMySet.Add(layer); pMySet.Reset(); // make the symbology tab active pComPropSheet.ActivePage = 4; // show the property sheet bool bOK = pComPropSheet.EditProperties(pMySet, this.Handle.ToInt32()); m_activeView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, m_activeView.Extent); m_TOCControl.Update(); return(bOK); } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } }
private bool SetupFeaturePropertySheet(ILayer layer) { if (layer == null) { return(false); } ESRI.ArcGIS.Framework.IComPropertySheet pComPropSheet; pComPropSheet = new ESRI.ArcGIS.Framework.ComPropertySheetClass(); pComPropSheet.Title = layer.Name + "- 属性"; ESRI.ArcGIS.esriSystem.UID pPPUID = new ESRI.ArcGIS.esriSystem.UIDClass(); pComPropSheet.AddCategoryID(pPPUID); // General.... ESRI.ArcGIS.Framework.IPropertyPage pGenPage = new ESRI.ArcGIS.CartoUI.GeneralLayerPropPageClass(); pComPropSheet.AddPage(pGenPage); // Source ESRI.ArcGIS.Framework.IPropertyPage pSrcPage = new ESRI.ArcGIS.CartoUI.FeatureLayerSourcePropertyPageClass(); pComPropSheet.AddPage(pSrcPage); // Selection... ESRI.ArcGIS.Framework.IPropertyPage pSelectPage = new ESRI.ArcGIS.CartoUI.FeatureLayerSelectionPropertyPageClass(); pComPropSheet.AddPage(pSelectPage); // Display.... ESRI.ArcGIS.Framework.IPropertyPage pDispPage = new ESRI.ArcGIS.CartoUI.FeatureLayerDisplayPropertyPageClass(); pComPropSheet.AddPage(pDispPage); // Symbology.... ESRI.ArcGIS.Framework.IPropertyPage pDrawPage = new ESRI.ArcGIS.CartoUI.LayerDrawingPropertyPageClass(); pComPropSheet.AddPage(pDrawPage); // Fields... ESRI.ArcGIS.Framework.IPropertyPage pFieldsPage = new ESRI.ArcGIS.CartoUI.LayerFieldsPropertyPageClass(); pComPropSheet.AddPage(pFieldsPage); // Definition Query... ESRI.ArcGIS.Framework.IPropertyPage pQueryPage = new ESRI.ArcGIS.CartoUI.LayerDefinitionQueryPropertyPageClass(); pComPropSheet.AddPage(pQueryPage); // Labels.... ESRI.ArcGIS.Framework.IPropertyPage pSelPage = new ESRI.ArcGIS.CartoUI.LayerLabelsPropertyPageClass(); pComPropSheet.AddPage(pSelPage); // Joins & Relates.... ESRI.ArcGIS.Framework.IPropertyPage pJoinPage = new ESRI.ArcGIS.ArcMapUI.JoinRelatePageClass(); pComPropSheet.AddPage(pJoinPage); // Setup layer link ESRI.ArcGIS.esriSystem.ISet pMySet = new ESRI.ArcGIS.esriSystem.SetClass(); pMySet.Add(layer); pMySet.Reset(); // make the symbology tab active pComPropSheet.ActivePage = 4; // show the property sheet bool bOK = pComPropSheet.EditProperties(pMySet, 0); m_activeView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, m_activeView.Extent); ////更新图例 //IMapSurround pMapSurround = null; //ILegend pLegend = null; //for (int i = 0; i < m_map.MapSurroundCount; i++) //{ // pMapSurround = m_map.get_MapSurround(i); // if (pMapSurround is ILegend) // { // pLegend = pMapSurround as ILegend; // pLegend.AutoVisibility = true; // pLegend.Refresh(); // } //} return(bOK); }
private bool SetupFeaturePropertySheet(ILayer layer) { if (layer == null) return false; try { ESRI.ArcGIS.Framework.IComPropertySheet pComPropSheet; pComPropSheet = new ESRI.ArcGIS.Framework.ComPropertySheetClass(); pComPropSheet.Title = layer.Name + "- Properties"; ESRI.ArcGIS.esriSystem.UID pPPUID = new ESRI.ArcGIS.esriSystem.UIDClass(); pComPropSheet.AddCategoryID(pPPUID); // General.... ESRI.ArcGIS.Framework.IPropertyPage pGenPage = new ESRI.ArcGIS.CartoUI.GeneralLayerPropPageClass(); pComPropSheet.AddPage(pGenPage); // Source ESRI.ArcGIS.Framework.IPropertyPage pSrcPage = new ESRI.ArcGIS.CartoUI.FeatureLayerSourcePropertyPageClass(); pComPropSheet.AddPage(pSrcPage); // Selection... ESRI.ArcGIS.Framework.IPropertyPage pSelectPage = new ESRI.ArcGIS.CartoUI.FeatureLayerSelectionPropertyPageClass(); pComPropSheet.AddPage(pSelectPage); // Display.... ESRI.ArcGIS.Framework.IPropertyPage pDispPage = new ESRI.ArcGIS.CartoUI.FeatureLayerDisplayPropertyPageClass(); pComPropSheet.AddPage(pDispPage); // Symbology.... ESRI.ArcGIS.Framework.IComPropertyPage pDrawPage = new ESRI.ArcGIS.CartoUI.LayerDrawingPropertyPageClass(); pComPropSheet.AddPage(pDrawPage); // Fields... ESRI.ArcGIS.Framework.IPropertyPage pFieldsPage = new ESRI.ArcGIS.CartoUI.LayerFieldsPropertyPageClass(); pComPropSheet.AddPage(pFieldsPage); // Definition Query... ESRI.ArcGIS.Framework.IPropertyPage pQueryPage = new ESRI.ArcGIS.CartoUI.LayerDefinitionQueryPropertyPageClass(); pComPropSheet.AddPage(pQueryPage); // Labels.... ESRI.ArcGIS.Framework.IPropertyPage pSelPage = new ESRI.ArcGIS.CartoUI.LayerLabelsPropertyPageClass(); pComPropSheet.AddPage(pSelPage); // Joins & Relates.... ESRI.ArcGIS.Framework.IPropertyPage pJoinPage = new ESRI.ArcGIS.ArcMapUI.JoinRelatePageClass(); pComPropSheet.AddPage(pJoinPage); // Setup layer link ESRI.ArcGIS.esriSystem.ISet pMySet = new ESRI.ArcGIS.esriSystem.SetClass(); pMySet.Add(layer); pMySet.Reset(); // make the symbology tab active pComPropSheet.ActivePage = 4; // show the property sheet bool bOK = pComPropSheet.EditProperties(pMySet, this.Handle.ToInt32()); m_activeView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, m_activeView.Extent); m_TOCControl.Update(); return (bOK); } catch (Exception ex) { MessageBox.Show(ex.Message); return false; } }