예제 #1
0
        public void refresh()
        {
            this.Clear();
            var all = new List <Information>();

            GraphReader.getPtrParent(Kernel.getElement(middle.getCurrent()), ref all);
            all.Reverse();
            foreach (var result in all)
            {
                count++;
                var lab = new Label();
                if (count == all.Count)
                {
                    if (count == 1)
                    {
                        lab.Content = $"{result.name.ToUpper()} :\\";
                    }
                    else
                    {
                        lab.Content = $"{result.name}";
                    }
                }
                else
                {
                    if (count == 1)
                    {
                        lab.Content = $"{result.name.ToUpper()} :\\";
                    }
                    else
                    {
                        lab.Content = $"{result.name} > ";
                    }
                }

                lab.FontSize   = 14;
                lab.FontWeight = FontWeights.Medium;
                labels.Add(lab);
                lab.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
                Rect measureRect = new Rect(lab.DesiredSize);
                lab.Arrange(measureRect);
                Canvas.SetTop(lab, y);
                Canvas.SetLeft(lab, x);
                canvas.Children.Add(lab);

                x += measureRect.Width - 5;
            }
        }
예제 #2
0
        public void refreshListe()
        {
            this.Clear();
            var allelems = new Label();

            allelems.Content    = $"Nombres éléments(R)({GraphReader.Count(GraphReader.Element(Kernel.getElement(middle.getCurrent())).son)}) : ";
            allelems.FontSize   = 14;
            allelems.FontWeight = FontWeights.Bold;
            labels.Add(new Engine.Liste(allelems, 0, 0));
            Canvas.SetTop(allelems, y);
            Canvas.SetLeft(allelems, x);
            canvas.Children.Add(allelems);

            var all = new List <Information>();

            GraphReader.getPtr(GraphReader.Element(Kernel.getElement(middle.getCurrent())).son, ref all);
            y += 5;
            foreach (var result in all.Where(x => x.type != -1).ToList())
            {
                y += 20;
                var lab = new Label();
                lab.Content  = $"{ Configuration.types[result.type]} : { result.name}";
                lab.FontSize = 14;
                lab.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
                Rect measureRect = new Rect(lab.DesiredSize);
                lab.Arrange(measureRect);
                var liste = new Liste(lab, measureRect.Width, measureRect.Height);
                liste.setPosition((int)x, (int)y);
                liste.id = result.id;

                labels.Add(liste);
                Canvas.SetTop(liste.label, y);
                Canvas.SetLeft(liste.label, x);
                canvas.Children.Add(liste.label);
            }
            y += 20;

            var nelems = new Label();

            nelems.Content    = $"Nombres éléments({GraphReader.CountNext(GraphReader.Element(Kernel.getElement(middle.getCurrent())).son)}) : ";
            nelems.FontSize   = 14;
            nelems.FontWeight = FontWeights.Bold;
            labels.Add(new Engine.Liste(nelems, 0, 0));
            Canvas.SetTop(nelems, y);
            Canvas.SetLeft(nelems, x);
            canvas.Children.Add(nelems);
            all = GraphReader.getElementList(GraphReader.Element(Kernel.getElement(middle.getCurrent())).son);
            foreach (var result in all.Where(x => x.type != -1).ToList())
            {
                y += 20;

                var lab = new Label();
                lab.Content  = $"{ Configuration.types[result.type]} : { result.name}";
                lab.FontSize = 14;
                lab.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
                Rect measureRect = new Rect(lab.DesiredSize);
                lab.Arrange(measureRect);
                var liste = new Liste(lab, measureRect.Width, measureRect.Height);
                liste.setPosition((int)x, (int)y);
                liste.id = result.id;

                labels.Add(liste);
                Canvas.SetTop(liste.label, y);
                Canvas.SetLeft(liste.label, x);
                canvas.Children.Add(liste.label);
            }
        }