public override void OnClick() { IMapControlDefault pMapControl = m_hookHelper.Hook as IMapControlDefault; IGeoFeatureLayer pGeoFeatLyr = pMapControl.CustomProperty as IGeoFeatureLayer; if (pGeoFeatLyr == null) return; frmSymbology symbolForm = new frmSymbology(); IStyleGalleryItem styleGalleryItem = null; switch (pGeoFeatLyr.FeatureClass.ShapeType) { case esriGeometryType.esriGeometryPoint: styleGalleryItem = symbolForm.GetItem(esriSymbologyStyleClass.esriStyleClassMarkerSymbols); break; case esriGeometryType.esriGeometryPolyline: styleGalleryItem = symbolForm.GetItem(esriSymbologyStyleClass.esriStyleClassLineSymbols); break; case esriGeometryType.esriGeometryPolygon: styleGalleryItem = symbolForm.GetItem(esriSymbologyStyleClass.esriStyleClassFillSymbols); break; } symbolForm.Dispose(); //mMainPlatfrom.Activate(); if (styleGalleryItem == null) return; ISimpleRenderer simpleRenderer = new SimpleRendererClass(); simpleRenderer.Symbol = (ISymbol)styleGalleryItem.Item; pGeoFeatLyr.Renderer = simpleRenderer as IFeatureRenderer; pMapControl.Refresh(esriViewDrawPhase.esriViewGeography, null, null); }
private void btnApply_Click(object sender, EventArgs e) { clsSnippet pSnippet = new clsSnippet(); FormCollection pFormCollection = System.Windows.Forms.Application.OpenForms; frmSymbology pfrmSymbology = null; for (int j = 0; j < pFormCollection.Count; j++) { if (pFormCollection[j].Name == "frmSymbology")//Brushing to Histogram { pfrmSymbology = pFormCollection[j] as frmSymbology; } } ISimpleFillSymbol pBackFillSymbol = null; if (pfrmSymbology != null) { pBackFillSymbol = new SimpleFillSymbolClass(); IRgbColor pBackRGB = new RgbColorClass(); pBackRGB = pSnippet.getRGB(picSymColor.BackColor.R, picSymColor.BackColor.G, picSymColor.BackColor.B); pBackFillSymbol.Color = (IColor)pBackRGB; ICartographicLineSymbol pBackOut = new CartographicLineSymbolClass(); IRgbColor pBackOutRGB = new RgbColorClass(); pBackOutRGB = pSnippet.getRGB(picOutColor.BackColor.R, picOutColor.BackColor.G, picOutColor.BackColor.B); pBackOut.Color = (IColor)pBackOutRGB; pBackOut.Width = Convert.ToDouble(nudOutWidth.Value); pBackFillSymbol.Outline = pBackOut; pfrmSymbology.m_BackSymbol = pBackFillSymbol; } this.Close(); }
/// <summary> /// Occurs when this command is clicked /// </summary> public override void OnClick() { // TODO: Add LayerSymbology.OnClick implementation ILayer pLayer = (ILayer)m_mapControl.CustomProperty; frmSymbology pfrmPropeties = new frmSymbology(); pfrmPropeties.mlayer = pLayer; pfrmPropeties.ShowDialog(); }
private void btnOK_Click(object sender, EventArgs e) { try { pMulitColorRampsResults = new MultiPartColorRampClass(); pMulitColorRampsResults = pMultiColorRamp; if (intLoadingPlaces == 1) { frmSymbology pForm = System.Windows.Forms.Application.OpenForms["frmProperties"] as frmSymbology; //pForm.DrawSymbolinListView(); pForm.DrawSymboliinDataGridView(); } else if (intLoadingPlaces == 2) { frmNewClassSeparbility pForm = System.Windows.Forms.Application.OpenForms["frmNewClassSeparability"] as frmNewClassSeparbility; pForm.DrawSymbolinChartwithCb(pForm.m_cb, pForm.m_intGCBreakeCount); //frmClassSeparability pForm = System.Windows.Forms.Application.OpenForms["frmClassSeparability"] as frmClassSeparability; //pForm.DrawSymbolinListView(); } else if (intLoadingPlaces == 3) { frmOptimizationSample pForm = System.Windows.Forms.Application.OpenForms["frmOptimizationSample"] as frmOptimizationSample; pForm.DrawSymbolinChartwithCb(pForm.m_cb, pForm.m_intGCBreakeCount); } else if (intLoadingPlaces == 4) { MessageBox.Show("The cmstom color ramp will be applied after udapting maps"); } this.Hide(); } catch (Exception ex) { frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog(); return; } }