Как определить что Element - выбран?
Добавлено: 22 фев 2012, 10:10
Уважаемые gurus!
(argis engine 2010 .Net)
На Map имеется несколько графических элементов (circleElement), один из них выбран. Как определить - какой?
В справке пока не нашел, думал есть свойство типа isSelected...
Использую для теста такой тест
Спасибо in advance!
(argis engine 2010 .Net)
На Map имеется несколько графических элементов (circleElement), один из них выбран. Как определить - какой?
В справке пока не нашел, думал есть свойство типа isSelected...
Использую для теста такой тест
Код: Выделить всё
public void CountGraphicElements(IMap map)
{
//The page layout is a graphics container, so it can be enumerated.
IGraphicsContainer graphicsContainer = map as IGraphicsContainer;
//Reset the container to start from the beginning.
graphicsContainer.Reset();
Int32 int32_Counter = 0;
IElement element = graphicsContainer.Next();
//Loop through the container until the end, denoted by a null value.
while (element != null)
{
//Test the element to see if it's a certain type. This can be ITextElement, IPolygonElement, etc.
if (element is ICircleElement)
{
//If a match is found, increment the counter.
if (element.SelectionTracker.ShowHandles == true)
{
element.SelectionTracker.Deactivate();
string s = element.SelectionTracker.ShowHandles.ToString();
string s1 = element.SelectionTracker.Locked.ToString();
int32_Counter = int32_Counter + 1;
MessageBox.Show("Нашли X = " + element.Geometry.Envelope.XMin.ToString()+
" s = "+s+ " locked = "+ s1);
}
}
//Step to the next element in the container.
element = graphicsContainer.Next();
}
//Display the results of the count.
MessageBox.Show("The pagelayout contains " + int32_Counter +
" CircleElement(s)");