Exemplo n.º 1
0
        private void 符合设置ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_curLayer == null)
            {
                return;
            }

            var PSheet = new ComPropertySheetClass();

            PSheet.HideHelpButton = true;

            ISet PSet = new SetClass();

            PSet.Add(_curLayer);
            PSheet.ClearCategoryIDs();
            PSheet.AddCategoryID(new UIDClass());

            PSheet.AddPage(new ESRI.ArcGIS.CartoUI.LayerDrawingPropertyPageClass());
            PSheet.Title = "显示属性设置";
            if (PSheet.CanEdit(PSet))
            {
                if (PSheet.EditProperties(PSet, 0))
                {
                    axTOCControl1.Refresh();
                }
            }
        }
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            IComPropertySheet myPropertySheet = new ComPropertySheetClass();

            myPropertySheet.Title          = "Simplified Layer Properties (C#)";
            myPropertySheet.HideHelpButton = true;

            //Add by component category - all pages registered in the layer property page
            //UID layerPropertyID = new UIDClass();
            //layerPropertyID.Value = m_layerCategoryID;
            //myPropertySheet.AddCategoryID(layerPropertyID);

            //Or add page by page - but have to call Applies yourself
            myPropertySheet.ClearCategoryIDs();
            myPropertySheet.AddCategoryID(new UIDClass());                                    //a dummy empty UID
            myPropertySheet.AddPage(new LayerVisibilityPage());                               //my custom page
            myPropertySheet.AddPage(new ESRI.ArcGIS.CartoUI.LayerDrawingPropertyPageClass()); //feature layer symbology

            //Pass in layer, active view and the application
            ISet           propertyObjects = new SetClass();
            IBasicDocument basicDocument   = m_application.Document as IBasicDocument;

            propertyObjects.Add(basicDocument.ActiveView);
            propertyObjects.Add(basicDocument.SelectedLayer); //or check ContextItem is a layer?
            propertyObjects.Add(m_application);               //optional?

            //Show the property sheet
            if (myPropertySheet.CanEdit(propertyObjects))
            {
                myPropertySheet.EditProperties(propertyObjects, m_application.hWnd);
            }
        }
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            IComPropertySheet myPropertySheet = new ComPropertySheetClass();
            myPropertySheet.Title = "Simplified Layer Properties (C#)";
            myPropertySheet.HideHelpButton = true;

            //Add by component category - all pages registered in the layer property page
            //UID layerPropertyID = new UIDClass();
            //layerPropertyID.Value = m_layerCategoryID;
            //myPropertySheet.AddCategoryID(layerPropertyID);

            //Or add page by page - but have to call Applies yourself
            myPropertySheet.ClearCategoryIDs();
            myPropertySheet.AddCategoryID(new UIDClass()); //a dummy empty UID
            myPropertySheet.AddPage(new LayerVisibilityPage()); //my custom page
            myPropertySheet.AddPage(new ESRI.ArcGIS.CartoUI.LayerDrawingPropertyPageClass()); //feature layer symbology

            //Pass in layer, active view and the application
            ISet propertyObjects = new SetClass();
            IBasicDocument basicDocument = m_application.Document as IBasicDocument;

            propertyObjects.Add(basicDocument.ActiveView);
            propertyObjects.Add(basicDocument.SelectedLayer); //or check ContextItem is a layer?
            propertyObjects.Add(m_application); //optional?

            //Show the property sheet
            if (myPropertySheet.CanEdit(propertyObjects))
                myPropertySheet.EditProperties(propertyObjects, m_application.hWnd);
        }