Beispiel #1
0
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            if (m_hookHelper != null)
            {
            }
            else if (m_sceneHookHelper != null)
            {
            }
            else if (m_globeHookHelper != null)
            {
            }

            int          i;
            IMapControl3 pMapControl = (IMapControl3)m_hookHelper.Hook;

            //ModDeclare.g_Sys.TocControl.SetBuddyControl(null);
            m_pTocControl.SetBuddyControl(null);
            for (i = pMapControl.Map.LayerCount - 1; i >= 0; i--)
            {
                //pMapControl.Map.DeleteLayer(pMapControl.Map.get_Layer(i));
                m_pMapControl.Map.DeleteLayer(pMapControl.Map.get_Layer(i));
            }
            pMapControl.SpatialReference = null;

            //ModDeclare.g_Sys.TocControl.SetBuddyControl(ModDeclare.g_Sys.MapControl);
            //ModDeclare.g_Sys.TocControl.ActiveView.Refresh();
            m_pTocControl.SetBuddyControl(m_pMapControl);
            m_pTocControl.ActiveView.Refresh();
        }
Beispiel #2
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     m_map.LoadMxFile("C:\\IPAN\\Exercise02\\SouthAmerica.mxd", 0, null);
     m_toc.SetBuddyControl(m_map);
     m_toolbar.SetBuddyControl(m_map);
     m_toolbar.AddItem("esriControls.ControlsMapNavigationToolbar");
 }
Beispiel #3
0
        public void InitializeControls(IDsApplication hook)
        {
            m_app        = hook;
            m_mapCtrl    = new esriMapControl(hook);
            m_legendCtrl = new esriTOCControl(hook);

            AxMapControl axMapCtrl = (m_mapCtrl as esriMapControl).mapCtrl;
            AxTOCControl axTocCtrl = (m_legendCtrl as esriTOCControl).tocCtrl;

            axTocCtrl.SetBuddyControl(axMapCtrl);
        }
Beispiel #4
0
        /// <summary>
        /// 加载图层控件
        /// </summary>
        /// <returns></returns>
        public AxTOCControl LoadaxTOCControl()
        {
            if (this.SceneControl != null)
            {
                AxTOCControl control = new AxTOCControl();
                control.SetBuddyControl(m_sceneControl);
                return(control);
            }

            return(null);
        }
Beispiel #5
0
        public MainWindow()

        {
            this.mapHost.Child = m_map;
            m_map.DocumentMap  = "E:\\StudentIPAN\\Exercise02\\SouthAmerica.mxd";
            m_toc.SetBuddyControl(m_map);
            m_toolbar.SetBuddyControl(m_map);
            this.tocHost.Child     = m_toc;
            this.toolbarHost.Child = m_toolbar;

            InitializeComponent();
        }
Beispiel #6
0
        /// <summary>
        /// 地图控件与TOC控件的关联操作
        /// </summary>
        /// <param name="tocCtrl">TOC控件</param>
        /// <param name="mapCtrl">地图控件</param>
        /// <param name="attributeCtrl">显示属性表的控件/窗体</param>
        /// <param name="switchView">将当前标签页设为地图页面</param>
        public MapCtrlToc(AxTOCControl tocCtrl, AxMapControl mapCtrl, IAttributeCtrl attributeCtrl, Action <EViewActionType[]> switchView = null)
        {
            MapControl = mapCtrl;
            TocControl = tocCtrl;
            TocControl.SetBuddyControl(MapControl);
            TocControl.OnMouseDown += tocCtrl_OnMouseDown;
            SwitchView              = switchView;
            AttributeCtrl           = attributeCtrl;
            _attributeCtrlType      = AttributeCtrl.GetType();

            Layer2FieldsMenuItems = new Dictionary <string, ToolStripMenuItem[]>();
            InintMenuStrip();
        }
Beispiel #7
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //   m_map.LoadMxFile("C:\\IPAN\\Exercise02\\SouthAmerica.mxd", 0, null);

            IMapDocument mapDoc = new MapDocument();

            mapDoc.Open("C:\\IPAN\\Exercise02\\SouthAmerica.mxd");
            /// IMap inMap = mapDoc.get_Map(0);//mapDoc.get_Map(0);
            m_map.Map = mapDoc.get_Map(1);
            m_toc.SetBuddyControl(m_map);
            m_toolbar.SetBuddyControl(m_map);
            m_toolbar.AddItem("esriControls.ControlsMapNavigationToolbar");
        }
Beispiel #8
0
        private void LoadMap(string arcMapPath)
        {
            mapDoc.Open(arcMapPath);

            this.cbxActiveMap.Items.Clear();
            for (int i = 0; i < mapDoc.MapCount; i++)
            {
                this.cbxActiveMap.Items.Add(mapDoc.get_Map(i).Name);
            }
            this.cbxActiveMap.SelectedIndex = 0;
            m_toolbar.AddItem("esriControls.ControlsMapNavigationToolbar");
            //添加行政区划分
            this.districtList.Items.Clear();
            initData();

            // this.districtList.SelectedIndex = 0;

            m_map.Map = mapDoc.get_Map(0);
            m_toc.SetBuddyControl(m_map);
            m_toolbar.SetBuddyControl(m_map);
            m_toolbar.AddItem("esriControls.ControlsMapNavigationToolbar");
        }
        private void LoadMap()
        {
            //Buddy up controls
            tocControl.SetBuddyControl(mapControl);
            toolbarControl.SetBuddyControl(mapControl);

            //add command and tools to the toolbar
            toolbarControl.AddItem("esriControls.ControlsOpenDocCommand");
            toolbarControl.AddItem("esriControls.ControlsAddDataCommand");
            toolbarControl.AddItem("esriControls.ControlsSaveAsDocCommand");
            toolbarControl.AddItem("esriControls.ControlsMapNavigationToolbar");
            toolbarControl.AddItem("esriControls.ControlsMapIdentifyTool");

            //set controls' properties
            toolbarControl.BackColor = Color.FromArgb(245, 245, 220);

            //wire up events
            mapControl.OnMouseMove += new IMapControlEvents2_Ax_OnMouseMoveEventHandler(mapControl_OnMouseMove);
        }
Beispiel #10
0
        private void btnuse_Click(object sender, EventArgs e)
        {
            if (treeshow.SelectedIndex == 1)
            {
                ITinRenderer             pRenderNew  = new TinFaceRenderer() as ITinRenderer;
                ITinSingleSymbolRenderer pUVRenderer = pRenderNew as ITinSingleSymbolRenderer;
                ISimpleFillSymbol        pSymbol     = new SimpleFillSymbolClass();
                pSymbol.Color      = ClsGDBDataCommon.ColorToIColor(btncolor.SelectedColor);
                pUVRenderer.Symbol = pSymbol as ISymbol;
                pTLayer.ClearRenderers();
                pTLayer.InsertRenderer(pRenderNew, 0);
                pTocContral.SetBuddyControl(pMapContral);
                pTocContral.Refresh();
                pMapContral.Refresh();
                if (bar3.SelectedDockTab == 2)
                {
                    IActiveView pActiveView = pSceneControl.Scene as IActiveView;
                    pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, pTLayer, null);
                }
            }
            else
            {
                ITinRenderer pTinRenderer = new TinElevationRenderer() as ITinRenderer;

                //设置样式
                if (pTinRenderer is ITinColorRampRenderer)
                {
                    if (pTinRenderer.Name == "Elevation")
                    {
                        if (lowbreak.Count > 0)
                        {
                            int ClassCount = int.Parse(cmbclasses.SelectedItem.ToString());

                            ITinAdvanced             pTinAdv = pTLayer.Dataset as ITinAdvanced;
                            ITinColorRampRenderer    pTinColorRampRenderer    = pTinRenderer as ITinColorRampRenderer;
                            IClassBreaksUIProperties pClassBreaksUIProperties = pTinRenderer as IClassBreaksUIProperties;
                            INumberFormat            pNumberFormat            = pClassBreaksUIProperties.NumberFormat;
                            pTinColorRampRenderer.MinimumBreak = lowbreak[0];

                            pTinColorRampRenderer.BreakCount = int.Parse(cmbclasses.SelectedItem.ToString());
                            ISimpleFillSymbol pSymbol = null;
                            for (int j = 0; j < pTinColorRampRenderer.BreakCount; j++)
                            {
                                pClassBreaksUIProperties.set_LowBreak(j, lowbreak[j]);
                                pTinColorRampRenderer.set_Break(j, highbreak[j]);

                                //用于图层控制中分级标示显示
                                pTinColorRampRenderer.set_Label(ClassCount - j - 1, datagridsymbol.Rows[j].Cells[2].Value.ToString());
                                pSymbol       = new SimpleFillSymbolClass();
                                pSymbol.Color = ClsGDBDataCommon.ColorToIColor(datagridsymbol.Rows[j].Cells[0].Style.BackColor);
                                pTinColorRampRenderer.set_Symbol(ClassCount - j - 1, pSymbol as ISymbol);
                            }
                            pTLayer.ClearRenderers();
                            (pTinColorRampRenderer as ITinRenderer).Visible = true;
                            pTLayer.InsertRenderer(pTinColorRampRenderer as ITinRenderer, 0);//插入一个渲染模型
                            pTocContral.SetBuddyControl(pMapContral);
                            pTocContral.Refresh();
                            pMapContral.Refresh();
                            if (bar3.SelectedDockTab == 2)
                            {
                                IActiveView pActiveView = pSceneControl.Scene as IActiveView;
                                pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, pTLayer, null);
                            }
                        }
                    }
                }
            }
        }
Beispiel #11
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            System.Globalization.CultureInfo pCulture;

            //Set the Thread UI Culture manually by uncommenting one of the three cultures
            //that you wish to set below.

            pCulture = System.Globalization.CultureInfo.CreateSpecificCulture("fr-FR");
            //pCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
            //pCulture = System.Globalization.CultureInfo.CreateSpecificCulture("es-ES");

            //Set the UI Culture
            System.Threading.Thread.CurrentThread.CurrentUICulture = pCulture;

            //Confirm that the Thread UI Culture is set.
            lblCulture.Text = "Current Thread UI Culture = " + System.Threading.Thread.CurrentThread.CurrentUICulture.DisplayName;

            //Add command to open an mxd document
            string sProgID;

            sProgID = "esriControls.ControlsOpenDocCommand";
            axToolbarControl1.AddItem(sProgID, -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);

            //Add Map navigation commands
            sProgID = "esriControls.ControlsMapZoomInTool";
            axToolbarControl1.AddItem(sProgID, -1, -1, true, 0, esriCommandStyles.esriCommandStyleIconOnly);
            sProgID = "esriControls.ControlsMapZoomOutTool";
            axToolbarControl1.AddItem(sProgID, -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            sProgID = "esriControls.ControlsMapPanTool";
            axToolbarControl1.AddItem(sProgID, -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            sProgID = "esriControls.ControlsMapFullExtentCommand";
            axToolbarControl1.AddItem(sProgID, -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);

            //Add PageLayout navigation commands
            sProgID = "esriControls.ControlsPageZoomInTool";
            axToolbarControl1.AddItem(sProgID, -1, -1, true, 0, esriCommandStyles.esriCommandStyleIconOnly);
            sProgID = "esriControls.ControlsPageZoomOutTool";
            axToolbarControl1.AddItem(sProgID, -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            sProgID = "esriControls.ControlsPagePanTool";
            axToolbarControl1.AddItem(sProgID, -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            sProgID = "esriControls.ControlsPageZoomWholePageCommand";
            axToolbarControl1.AddItem(sProgID, -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            sProgID = "esriControls.ControlsPageZoomPageToLastExtentBackCommand";
            axToolbarControl1.AddItem(sProgID, -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            sProgID = "esriControls.ControlsPageZoomPageToLastExtentForwardCommand";
            axToolbarControl1.AddItem(sProgID, -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            sProgID = "esriControls.ControlsSelectTool";

            //Add Culture Tool
            axToolbarControl1.AddItem("VBCSharpCultureSample.CultureTool", -1, -1, true, 0, esriCommandStyles.esriCommandStyleIconAndText);

            //Add Culture Command
            axToolbarControl1.AddItem("VBCSharpCultureSample.CultureCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconAndText);

            //Add Culture Menu
            axToolbarControl1.AddItem("VBCSharpCultureSample.CultureMenu", -1, -1, false, 0, esriCommandStyles.esriCommandStyleTextOnly);


            //Add the MenuDef to the ToolbarMenu
            string progID = "VBCSharpCultureSample.CultureMenu";

            m_pToolbarMenu.AddItem(progID, -1, -1, false, esriCommandStyles.esriCommandStyleIconAndText);

            //Set the Toolbarmenu's hook
            m_pToolbarMenu.SetHook(axToolbarControl1);

            //Set Buddy Controls
            axTOCControl1.SetBuddyControl(axPageLayoutControl1);
            axToolbarControl1.SetBuddyControl(axPageLayoutControl1);
        }
        /// <summary>
        /// 对生成的各图层进行符号、标注设置
        /// </summary>
        /// <param name="impfilepath">导入符号mxd文件路径</param>
        /// <param name="passpoint">生成的点图层</param>
        /// <param name="passline">生成的线图层</param>
        public void ImpSymbolFromFile(string impfilepath, ILayer passpoint, ILayer passline)
        {
            IMapDocument pMapDocument = new MapDocumentClass();

            pMapDocument.Open(impfilepath, null);
            IMap pMap = pMapDocument.Map[0];

            for (int i = 0; i < pMap.LayerCount; i++)
            {
                ILayer pLayerSymbol = pMap.get_Layer(i);
                if (pLayerSymbol is IFeatureLayer && pLayerSymbol.Name.Contains("point"))
                {
                    IFeatureLayer    pFLayerSymbol   = pLayerSymbol as IFeatureLayer;
                    IGeoFeatureLayer pGFLayerSymbol  = pFLayerSymbol as IGeoFeatureLayer;
                    IFeatureLayer    pFPasspointWait = passpoint as IFeatureLayer;
                    IGeoFeatureLayer pGPasspointWait = pFPasspointWait as IGeoFeatureLayer;
                    if (pGFLayerSymbol != null)
                    {
                        pGPasspointWait.Renderer = pGFLayerSymbol.Renderer;

                        IAnnotateLayerProperties pAnnoLayerP; // = new LabelEngineLayerPropertiesClass();//渲染图层的符号图层标注
                        IElementCollection       PELECOLL;    //queryitem的参数,用不到
                        IElementCollection       pelecoll;    //同上
                        pGFLayerSymbol.AnnotationProperties.QueryItem(0, out pAnnoLayerP, out PELECOLL, out pelecoll);
                        ILabelEngineLayerProperties pLabelEenLayPro = pAnnoLayerP as ILabelEngineLayerProperties;


                        IFontDisp   pFont       = new StdFontClass() as IFontDisp;
                        ITextSymbol pTextSymbol = new TextSymbolClass();
                        pTextSymbol.Color   = pLabelEenLayPro.Symbol.Color;
                        pFont.Bold          = pLabelEenLayPro.Symbol.Font.Bold;
                        pFont.Italic        = pLabelEenLayPro.Symbol.Font.Italic;
                        pFont.Strikethrough = pLabelEenLayPro.Symbol.Font.Strikethrough;
                        pFont.Underline     = pLabelEenLayPro.Symbol.Font.Underline;
                        pFont.Name          = pLabelEenLayPro.Symbol.Font.Name;
                        pFont.Size          = pLabelEenLayPro.Symbol.Font.Size;
                        pTextSymbol.Font    = pFont;

                        pGPasspointWait.AnnotationProperties.Clear();
                        ILabelEngineLayerProperties pLabelWaitLayPro = new LabelEngineLayerPropertiesClass();//设置待渲染图层的标注
                        pLabelWaitLayPro.Expression = pLabelEenLayPro.Expression;
                        pLabelWaitLayPro.Symbol     = pTextSymbol;

                        IAnnotateLayerProperties pAnnLayProWait = pLabelWaitLayPro as IAnnotateLayerProperties;//新生成的符号图层设置标注
                        pAnnLayProWait.DisplayAnnotation  = true;
                        pAnnLayProWait.FeatureLayer       = pGPasspointWait;
                        pAnnLayProWait.LabelWhichFeatures = esriLabelWhichFeatures.esriVisibleFeatures;
                        pAnnLayProWait.WhereClause        = "";
                        pGPasspointWait.AnnotationProperties.Add(pAnnLayProWait);
                        pGPasspointWait.DisplayAnnotation = true;
                    }
                }
                else if (pLayerSymbol is IFeatureLayer && pLayerSymbol.Name.Contains("line"))
                {
                    IFeatureLayer    pFLayerSymbol   = pLayerSymbol as IFeatureLayer;
                    IGeoFeatureLayer pGFLayerSymbol  = pFLayerSymbol as IGeoFeatureLayer;
                    IFeatureLayer    pFPasspointWait = passline as IFeatureLayer;
                    IGeoFeatureLayer pGPasspointWait = pFPasspointWait as IGeoFeatureLayer;
                    if (pGFLayerSymbol != null)
                    {
                        pGPasspointWait.Renderer = pGFLayerSymbol.Renderer;

                        IAnnotateLayerProperties pAnnoLayerP = new LabelEngineLayerPropertiesClass(); //符号图层标注
                        IElementCollection       PELECOLL;                                            //queryitem的参数,用不到
                        IElementCollection       pelecoll;                                            //同上
                        pGFLayerSymbol.AnnotationProperties.QueryItem(0, out pAnnoLayerP, out PELECOLL, out pelecoll);
                        ILabelEngineLayerProperties pLabelEenLayPro = pAnnoLayerP as ILabelEngineLayerProperties;

                        IFontDisp   pFont       = new StdFontClass() as IFontDisp;
                        ITextSymbol pTextSymbol = new TextSymbolClass();
                        pTextSymbol.Color   = pLabelEenLayPro.Symbol.Color;
                        pFont.Bold          = pLabelEenLayPro.Symbol.Font.Bold;
                        pFont.Italic        = pLabelEenLayPro.Symbol.Font.Italic;
                        pFont.Strikethrough = pLabelEenLayPro.Symbol.Font.Strikethrough;
                        pFont.Underline     = pLabelEenLayPro.Symbol.Font.Underline;
                        pFont.Name          = pLabelEenLayPro.Symbol.Font.Name;
                        pFont.Size          = pLabelEenLayPro.Symbol.Font.Size;
                        pTextSymbol.Font    = pFont;

                        pGPasspointWait.AnnotationProperties.Clear();
                        ILabelEngineLayerProperties pLabelWaitLayPro = new LabelEngineLayerPropertiesClass();//设置待渲染图层的标注
                        pLabelWaitLayPro.Expression = pLabelEenLayPro.Expression;
                        pLabelWaitLayPro.Symbol     = pTextSymbol;

                        IAnnotateLayerProperties pAnnLayProWait = pLabelWaitLayPro as IAnnotateLayerProperties;//新生成的符号图层设置标注
                        pAnnLayProWait.DisplayAnnotation  = true;
                        pAnnLayProWait.FeatureLayer       = pGPasspointWait;
                        pAnnLayProWait.LabelWhichFeatures = esriLabelWhichFeatures.esriVisibleFeatures;
                        pAnnLayProWait.WhereClause        = "";
                        pGPasspointWait.AnnotationProperties.Add(pAnnLayProWait);
                        pGPasspointWait.DisplayAnnotation = true;
                    }
                }
            }
            m_pTOCCtl.SetBuddyControl(m_pMapCtl);
            m_pTOCCtl.ActiveView.Refresh();
            m_pMapCtl.ActiveView.Refresh();
        }
Beispiel #13
0
        private void btnok_Click(object sender, EventArgs e)
        {
            if (pUniquerend.FieldCount == 1)
            {
                IGeoFeatureLayer  pGEOFeaturelayer = pFLayer as IGeoFeatureLayer;
                IDisplayTable     pDisTable        = pGEOFeaturelayer as IDisplayTable;
                ISimpleLineSymbol pLineSymbol      = new SimpleLineSymbolClass();
                pLineSymbol.Style = esriSimpleLineStyle.esriSLSSolid;
                pLineSymbol.Width = 1;

                ISimpleFillSymbol pSimpleFillSymbol = new SimpleFillSymbolClass();
                pSimpleFillSymbol.Style         = esriSimpleFillStyle.esriSFSSolid;
                pSimpleFillSymbol.Outline.Width = 0.4;

                ISimpleMarkerSymbol pPointSymbol = new SimpleMarkerSymbolClass();
                pPointSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;
                pPointSymbol.Size  = 6;

                FrmUnique.pUniqueRender.RemoveAllValues();
                FrmUnique.pUniqueRender.FieldCount = 1;
                FrmUnique.pUniqueRender.set_Field(0, cmbfield1.Text);
                if (pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryMultipoint || pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPoint)
                {
                    FrmUnique.pUniqueRender.DefaultSymbol    = pPointSymbol as ISymbol;
                    FrmUnique.pUniqueRender.UseDefaultSymbol = true;
                }
                else if (pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolyline || pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryLine)
                {
                    FrmUnique.pUniqueRender.DefaultSymbol    = pLineSymbol as ISymbol;
                    FrmUnique.pUniqueRender.UseDefaultSymbol = true;
                }
                else if (pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
                {
                    FrmUnique.pUniqueRender.DefaultSymbol    = pSimpleFillSymbol as ISymbol;
                    FrmUnique.pUniqueRender.UseDefaultSymbol = true;
                }

                IFeatureCursor pFeatureCursor  = pDisTable.SearchDisplayTable(null, false) as IFeatureCursor;
                IFeatureCursor pFeatureCursor1 = pDisTable.SearchDisplayTable(null, false) as IFeatureCursor;
                IFeature       pFeature        = pFeatureCursor.NextFeature();
                IFeature       mFeature        = pFeatureCursor1.NextFeature();

                bool    ValFound;
                IFields pFields    = pFeatureCursor.Fields;
                int     fieldIndex = pFields.FindField(cmbfield1.Text);
                while (pFeature != null)
                {
                    object classValue;
                    classValue = pFeature.get_Value(fieldIndex);
                    ValFound   = false;
                    for (int i = 0; i <= FrmUnique.pUniqueRender.ValueCount - 1; i++)
                    {
                        if (FrmUnique.pUniqueRender.get_Value(i) == classValue.ToString())
                        {
                            ValFound = true;
                            break; //Exit the loop if the value was found.
                        }
                    }
                    if (ValFound == false)
                    {
                        bool valfudIn = false;
                        for (int i = 0; i < pUniquerend.ValueCount; i++)
                        {
                            if (pUniquerend.get_Value(i) == classValue.ToString())
                            {
                                valfudIn = true;
                                FrmUnique.pUniqueRender.AddValue(classValue.ToString(), cmbfield1.Text, pUniquerend.get_Symbol(classValue.ToString()));
                                FrmUnique.pUniqueRender.set_Label(classValue.ToString(), classValue.ToString());
                                FrmUnique.pUniqueRender.set_Symbol(classValue.ToString(), pUniquerend.get_Symbol(classValue.ToString()));
                                break;
                            }
                        }
                        if (valfudIn == false)
                        {
                            if (pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryMultipoint || pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPoint)
                            {
                                FrmUnique.pUniqueRender.AddValue(classValue.ToString(), cmbfield1.Text, pPointSymbol as ISymbol);
                                FrmUnique.pUniqueRender.set_Label(classValue.ToString(), classValue.ToString());
                                FrmUnique.pUniqueRender.set_Symbol(classValue.ToString(), pPointSymbol as ISymbol);
                            }
                            else if (pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolyline || pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryLine)
                            {
                                FrmUnique.pUniqueRender.AddValue(classValue.ToString(), cmbfield1.Text, pLineSymbol as ISymbol);
                                FrmUnique.pUniqueRender.set_Label(classValue.ToString(), classValue.ToString());
                                FrmUnique.pUniqueRender.set_Symbol(classValue.ToString(), pLineSymbol as ISymbol);
                            }
                            else if (pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
                            {
                                FrmUnique.pUniqueRender.AddValue(classValue.ToString(), cmbfield1.Text, pSimpleFillSymbol as ISymbol);
                                FrmUnique.pUniqueRender.set_Label(classValue.ToString(), classValue.ToString());
                                FrmUnique.pUniqueRender.set_Symbol(classValue.ToString(), pSimpleFillSymbol as ISymbol);
                            }
                        }
                    }
                    pFeature = pFeatureCursor.NextFeature();
                }
                FrmUnique.pUniqueRender.DefaultLabel     = null;
                FrmUnique.pUniqueRender.UseDefaultSymbol = false;
                FrmUnique.pUniqueRender.ColorScheme      = "Custom";
                ITable pTable   = pDisTable as ITable;
                bool   isString = pTable.Fields.get_Field(fieldIndex).Type == esriFieldType.esriFieldTypeString;
                FrmUnique.pUniqueRender.set_FieldType(0, isString);
                pGEOFeaturelayer.Renderer = FrmUnique.pUniqueRender as IFeatureRenderer;
                IUID pUID = new UIDClass();
                pUID.Value = "{683C994E-A17B-11D1-8816-080009EC732A}";
                pGEOFeaturelayer.RendererPropertyPageClassID = pUID as UIDClass;
                if (pTocControl.Buddy == pMapControl.Object)
                {
                    pTocControl.SetBuddyControl(pMapControl);
                    pMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
                    pTocControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
                }
                else if (pTocControl.Buddy.Equals(pSceneControl.Object))
                {
                    pTocControl.SetBuddyControl(pSceneControl);
                    IActiveView pActiveView = pSceneControl.Scene as IActiveView;
                    pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, pLayer, null);
                    pTocControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
                }
            }
            this.Close();
            FrmUnique.Close();
        }