ArcMapAddinCoordinateConversion.ViewModels.MainViewModel.AddTextElement C# (CSharp) Method

AddTextElement() private method

private AddTextElement ( IMap map, IPoint point, string text ) : void
map IMap
point IPoint
text string
return void
        private void AddTextElement(IMap map, IPoint point, string text)
        {
            IGraphicsContainer graphicsContainer = map as IGraphicsContainer;
            IElement element = new TextElementClass();
            ITextElement textElement = element as ITextElement;

            element.Geometry = point;
            textElement.Text = text;
            graphicsContainer.AddElement(element, 0);

            //Flag the new text to invalidate.
            IActiveView activeView = map as IActiveView;
            activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
        }