Exemple #1
0
        //Target graphics
        private void UpdateTargetChildren()
        {
            target.Children.Clear();
            AddTargetGraphic();

            if (lArrows.GetNumElements() > 0)
            {
                int head = lArrows.GetHead();
                lArrows.ResetHead();
                for (int i = 0; i < lArrows.GetSize(); i++)
                {
                    FletchedGraphic arrow = (FletchedGraphic)lArrows[i];
                    if (arrow != null)
                    {
                        target.Children.Add(arrow);      //ienumerator will go through the whole array even if elements are null
                    }
                    lArrows.MoveNext();
                }
                lArrows.SetHead(head);
            }
        }
        //Target graphics
        private void UpdateTargetChildren()
        {
            target.Children.Clear();
            AddTargetGraphic();

            if (lBareshaft.GetNumElements() > 0)
            {
                int head = lBareshaft.GetHead();
                lBareshaft.SetHead(0);
                for (int i = 0; i < lBareshaft.GetSize(); i++)
                {
                    BareshaftGraphic bareshaft = (BareshaftGraphic)lBareshaft[i];
                    if (bareshaft != null)
                    {
                        target.Children.Add(bareshaft);                             //ienumerator will go through the whole array even if elements are null
                    }
                    lBareshaft.MoveNext();
                }
                lBareshaft.SetHead(head);
            }

            if (lFletched.GetNumElements() > 0)
            {
                int head = lFletched.GetHead();
                lFletched.SetHead(0);
                for (int i = 0; i < lFletched.GetSize(); i++)
                {
                    FletchedGraphic fletched = (FletchedGraphic)lFletched[i];
                    if (fletched != null)
                    {
                        target.Children.Add(fletched);
                    }
                    lFletched.MoveNext();
                }
                lFletched.SetHead(head);
            }
        }