public void TestInitialize()
 {
     _view = new SeqDiagPanel
     {
         Background = Brushes.White
     };
 }
Exemple #2
0
 public void TestInitialize()
 {
     _view = new SeqDiagPanel
     {
         Background = Brushes.White
     };
 }
Exemple #3
0
 public void Set(IEnumerable <UIElement> source)
 {
     _byIndex = source
                .Where(x => _filter(SeqDiagPanel.GetPosition(x)))
                .GroupBy(x => _getKey(SeqDiagPanel.GetPosition(x)))
                .Select(group => new Grp <T>(group))
                .ToDictionary(c => c.Index, c => c);
 }
Exemple #4
0
        public void AddMessage(int source, int destination, string message)
        {
            _row++;
            var direction = MessageDirection.LeftToRight;

            if (source > destination)
            {
                var tmp = source;
                source      = destination;
                destination = tmp;
                direction   = MessageDirection.RightToLeft;
            }

            var arrowElement = new ArrowElement {
                Direction = direction
            };

            Grid.SetRow(arrowElement, 2);
            var grid = new Grid
            {
                RowDefinitions =
                {
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                },

                Children =
                {
                    new TextBlock
                    {
                        HorizontalAlignment = HorizontalAlignment.Center,
                        Margin     = new Thickness(0, 0, 0, -2),
                        Text       = message,
                        Background = Brushes.White,
                    },
                    arrowElement
                }
            };

            SeqDiagPanel.SetPosition(grid,
                                     Position.Message(source, destination, _row));
            LayoutRoot.Children.Add(grid);
        }
Exemple #5
0
        private static Border CreateRect(string format, Position position)
        {
            var border = new Border
            {
                Margin            = new Thickness(3),
                BorderBrush       = Brushes.Black,
                BorderThickness   = new Thickness(1),
                VerticalAlignment = VerticalAlignment.Stretch,
                Child             = new TextBlock
                {
                    Text = format,
                    VerticalAlignment   = VerticalAlignment.Center,
                    HorizontalAlignment = HorizontalAlignment.Center
                }
            };

            SeqDiagPanel.SetPosition(border, position);
            return(border);
        }
Exemple #6
0
        public void AddActor(string name)
        {
            var header = new Border
            {
                BorderBrush     = Brushes.Black,
                BorderThickness = new Thickness(1),
                Margin          = new Thickness(5),
                CornerRadius    = new CornerRadius(3),
                Padding         = new Thickness(15, 2, 15, 2),
                Child           = new TextBlock {
                    Text = name
                },
                SnapsToDevicePixels = true,
            };

            SeqDiagPanel.SetPosition(header,
                                     Position.OneColumn(_column, 0));
            LayoutRoot.Children.Add(header);

            var line = new Line
            {
                StrokeThickness = 1,
                Y1                  = 0,
                Y2                  = 75,
                X1                  = 0,
                X2                  = 0,
                MinHeight           = 75,
                Stroke              = Brushes.Black,
                Stretch             = Stretch.Fill,
                SnapsToDevicePixels = true,
            };

            SeqDiagPanel.SetPosition(line, Position.Body(_column));
            LayoutRoot.Children.Add(line);
            _column++;
        }