private ISymbol GetSymbolByControl(ISymbol symbolType)
        {
            ISymbol                 symbol           = null;
            IStyleGalleryItem       styleGalleryItem = null;
            esriSymbologyStyleClass styleClass       = esriSymbologyStyleClass.
                                                       esriStyleClassMarkerSymbols;

            if (symbolType is IMarkerSymbol)
            {
                styleClass = esriSymbologyStyleClass.esriStyleClassMarkerSymbols;
            }
            if (symbolType is ILineSymbol)
            {
                styleClass = esriSymbologyStyleClass.esriStyleClassLineSymbols;
            }
            if (symbolType is IFillSymbol)
            {
                styleClass = esriSymbologyStyleClass.esriStyleClassFillSymbols;
            }

            GetSymbol symbolForm = new GetSymbol(styleClass);

            symbolForm.ShowDialog();
            styleGalleryItem = symbolForm.m_styleGalleryItem;
            if (styleGalleryItem == null)
            {
                return(null);
            }
            symbol = styleGalleryItem.Item as ISymbol;
            symbolForm.Dispose();
            this.Activate();
            return(symbol);
        }
示例#2
0
        private void btnSelectColorRamp_Click(object sender, EventArgs e)
        {
            GetSymbol symbolForm = new GetSymbol(esriSymbologyStyleClass.esriStyleClassColorRamps);

            symbolForm.ShowDialog();
            IStyleGalleryItem styleGalleryItem = symbolForm.m_styleGalleryItem;

            if (styleGalleryItem == null)
            {
                return;
            }
            colorRamp = styleGalleryItem.Item as IColorRamp;
            symbolForm.Dispose();
        }