laptop and a wrench

Bug

ISymbolEditor.EditSymbol(...) does not commit edits to existing ISymbol reference parameter.

Last Published: November 30, 2018 ArcObjects SDK
Bug ID Number BUG-000117337
SubmittedOctober 9, 2018
Last ModifiedJune 5, 2024
Applies toArcObjects SDK
Version found10.6
Operating SystemWindows OS
Operating System Version10.0 64 Bit
StatusWill Not Be Addressed

Additional Information

The symbol parameter on EditSymbol is a reference parameter, which means a reference must be passed in and cannot be cast on that assignment. An updated version of the OnClick function that fixes the issue is below: protected override void OnClick() { pStyleGallery = GetStyleGallery(); pStyleStorage = pStyleGallery as IStyleGalleryStorage; pStyleStorage.TargetFile = STYLE_PATH; pStyleStorage.AddFile(STYLE_PATH); pEnumStyleGalleryItem = GetEnumStyleGalleryItem(pStyleGallery); // Gets the specified symbol from the style gallery. IStyleGalleryItem styleGalleryItem = LoadStyleSymbol(pEnumStyleGalleryItem, SYMBOl_NAME); //------------------------------------------------------------------------ // Editing Symbol. //------------------------------------------------------------------------ // Using existing item from style gallery. IMarkerSymbol markerSymbol = styleGalleryItem.Item as IMarkerSymbol; ISymbolEditor symbolEditor = new SymbolEditor(); symbolEditor.Title = "Edit " + styleGalleryItem.Name; // Print marker detail before edit. Console.WriteLine("Before dialog edit."); PrintMultiLayerMarkerDetails(markerSymbol as IMultiLayerMarkerSymbol); // "markerSymbol" is pasted as a reference and is ment to change // directly from the dialog inputs by the user. ISymbol editSymbol = markerSymbol as ISymbol; bool isSymbolEdited = symbolEditor.EditSymbol(ref editSymbol, 0); if (!isSymbolEdited) { //Return a message here if the dialog is canceled. Console.WriteLine("Cancel was clicked."); } else // If the user clicks OK. { // EditSymbol is ment to return "markerSymbol" as an IMultiLayerMarkerSymbol. IMultiLayerMarkerSymbol multiMarker = editSymbol as IMultiLayerMarkerSymbol; // Print marker details after the edit. Console.WriteLine("After dialog edit."); PrintMultiLayerMarkerDetails(multiMarker); styleGalleryItem.Item = multiMarker; pStyleGallery.UpdateItem(styleGalleryItem); } }

Steps to Reproduce

Bug ID: BUG-000117337

Software:

  • ArcObjects SDK

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options