ArcMapAddinVisibility.ViewModels.TabBaseViewModel.RemoveGraphics C# (CSharp) Метод

RemoveGraphics() приватный Метод

Method used to remove graphics from the graphics container Elements are tagged with a GUID on the IElementProperties.Name property
private RemoveGraphics ( IGraphicsContainer gc, List list ) : void
gc IGraphicsContainer map graphics container
list List list of GUIDs to remove
Результат void
        internal void RemoveGraphics(IGraphicsContainer gc, List<string> list)
        {
            if (gc == null || !list.Any())
                return;

            var elementList = new List<IElement>();
            gc.Reset();
            var element = gc.Next();
            while (element != null)
            {
                var eleProps = element as IElementProperties;
                if (list.Contains(eleProps.Name))
                {
                    elementList.Add(element);
                }
                element = gc.Next();
            }

            foreach (var ele in elementList)
            {
                gc.DeleteElement(ele);
            }

            list.Clear();
            elementList.Clear();

            RaisePropertyChanged(() => HasMapGraphics);
        }

Same methods

TabBaseViewModel::RemoveGraphics ( List guidList ) : void