Esempio n. 1
0
        private ISymbol GetSymbolByControl(esriGeometryType geometryType)
        {
            GetSymbolByControl symbolForm = null;
            ISymbol            symbol     = null;

            switch (geometryType)
            {
            case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint:
                symbolForm = new GetSymbolByControl(esriSymbologyStyleClass.esriStyleClassMarkerSymbols);
                break;

            case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline:
                symbolForm = new GetSymbolByControl(esriSymbologyStyleClass.esriStyleClassLineSymbols);
                break;

            case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon:
                symbolForm = new GetSymbolByControl(esriSymbologyStyleClass.esriStyleClassFillSymbols);
                break;

            default:
                break;
            }
            symbolForm.ShowDialog();
            if (symbolForm.m_styleGalleryItem != null)
            {
                symbol = symbolForm.m_styleGalleryItem.Item as ISymbol;
            }
            symbolForm.Dispose();
            return(symbol);
        }
        private void btnSelectSymbol_Click(object sender, EventArgs e)
        {
            GetSymbolByControl markerSymbolForm = new GetSymbolByControl(esriSymbologyStyleClass.esriStyleClassMarkerSymbols);

            markerSymbolForm.ShowDialog();
            if (markerSymbolForm.m_styleGalleryItem == null)
            {
                return;
            }
            markerSymbol = markerSymbolForm.m_styleGalleryItem.Item as IMarkerSymbol;
            markerSymbolForm.Dispose();
        }
        private void btnSelectBackColor_Click(object sender, EventArgs e)
        {
            GetSymbolByControl fillSymbolForm = new GetSymbolByControl(esriSymbologyStyleClass.esriStyleClassFillSymbols);

            fillSymbolForm.ShowDialog();
            if (fillSymbolForm.m_styleGalleryItem == null)
            {
                return;
            }
            fillSymbol = fillSymbolForm.m_styleGalleryItem.Item as IFillSymbol;
            fillSymbolForm.Dispose();
        }
 private ISymbol GetSymbolByControl(esriGeometryType geometryType)
 {
     GetSymbolByControl symbolForm = null;
     ISymbol symbol = null;
     switch (geometryType)
     {
         case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint:
             symbolForm = new GetSymbolByControl(esriSymbologyStyleClass.esriStyleClassMarkerSymbols);
             break;
         case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline:
             symbolForm = new GetSymbolByControl(esriSymbologyStyleClass.esriStyleClassLineSymbols);
             break;
         case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon:
             symbolForm = new GetSymbolByControl(esriSymbologyStyleClass.esriStyleClassFillSymbols);
             break;
         default:
             break;
     }
     symbolForm.ShowDialog();
     if (symbolForm.m_styleGalleryItem != null)
         symbol = symbolForm.m_styleGalleryItem.Item as ISymbol;
     symbolForm.Dispose();
     return symbol;
 }