Mar 7, 2014 at 5:59 PM

I am using version in a VS2010 C# winforms project.

Our code currently writes a message to the end user using the .AddDrawingLabel() method. Each time we encounter the same logic and need to write another (different) message, we first need to remove the earlier message(s).

What I have noticed is that it seems we are unable to clear a drawing layer and then write another (different) message to the same drawing layer. Instead, we need to generate a new drawing layer with the .NewDrawing() method and then pass that drawing layer handle to the .AddDrawingLabel() method.

I am concerned that this is potentially using up more resources than we might otherwise. What can I do to be sure I am not being inefficient with DrawingLayers?

Here is the code block:
                   String labelMessage = String.Format("Error message:{0} \n({1})", TestRibbon.CurrentProperty.PropertyID,Configuration.CurrentDBName);
                    int handleDrawing = axMap1.NewDrawing(MapWinGIS.tkDrawReferenceList.dlScreenReferencedList);
                    for (int i = handleDrawing; i >= 0; i--)
                    axMap1.AddDrawingLabel(handleDrawing, labelMessage,Convert.ToUInt32(ColorTranslator.ToOle(Color.Black)),
                                            (axMap1.Width / 2), (axMap1.Height / 2),MapWinGIS.tkHJustification.hjCenter);