Example #1
0
        public override void AddLines(IDictionary <string, NodeTile> nodeDrawings)
        {
            NodeTile nodeDrawing;

            if (nodeDrawings.TryGetValue(_listener.NodeName, out nodeDrawing))
            {
                var css = "connection_unknown";

                if (!_listener.Disabled && _listener.ProcessingNode != null)
                {
                    var requestsPerMinute = _listener.ProcessingNode.TrafficAnalytics.RequestsPerMinute;
                    if (requestsPerMinute < _trafficIndicatorThresholds[0])
                    {
                        css = "connection_none";
                    }
                    else if (requestsPerMinute < _trafficIndicatorThresholds[1])
                    {
                        css = "connection_light";
                    }
                    else if (requestsPerMinute < _trafficIndicatorThresholds[2])
                    {
                        css = "connection_medium";
                    }
                    else if (requestsPerMinute < _trafficIndicatorThresholds[3])
                    {
                        css = "connection_heavy";
                    }
                }

                _drawing.AddChild(new ConnectedLineDrawing(TopRightSideConnection, nodeDrawing.TopLeftSideConnection)
                {
                    CssClass = css
                });
            }
        }
Example #2
0
        protected PopupBoxDrawing AddHeaderButton(DrawingElement page, string caption)
        {
            var button = new PopupButtonDrawing(page, caption);

            Header.AddChild(button);
            return(button.PopupBox);
        }
Example #3
0
 protected void AddDetails(List <string> details, DrawingElement parent)
 {
     if (details.Count > 0)
     {
         parent.AddChild(new TextDetailsDrawing {
             Text = details.ToArray()
         });
     }
 }
Example #4
0
 protected void AddDetails(List <string> details, DrawingElement parent = null, string cssClasses = null)
 {
     if (details.Count > 0)
     {
         parent = parent ?? this;
         parent.AddChild(new TextDetailsDrawing(cssClasses)
         {
             Text = details.ToArray()
         });
     }
 }
Example #5
0
        public override void AddLines(IDictionary <string, NodeTile> nodeDrawings)
        {
            if (string.IsNullOrEmpty(_changeLogFilter.OutputNode))
            {
                return;
            }

            if (nodeDrawings.TryGetValue(_changeLogFilter.OutputNode, out var nodeDrawing))
            {
                _drawing.AddChild(new ConnectedLineDrawing(TopRightSideConnection, nodeDrawing.TopLeftSideConnection)
                {
                    CssClass = _changeLogFilter.Offline ? "connection_none" : "connection_unknown"
                });
            }
        }
Example #6
0
        public ElementDrawing(
            DrawingElement page,
            string title,
            int headingLevel = 2)
        {
            CornerRadius = 3f;
            ChildSpacing = 5f;

            Header = new HorizontalListDrawing();
            AddChild(Header);

            Title = new TextDrawing {
                Text = new[] { title }
            }.HeadingLevel(headingLevel);
            Header.AddChild(Title);
        }
Example #7
0
        public NodeTile(
            DrawingElement drawing,
            string title,
            string cssClass,
            bool disabled,
            int headingLevel = 2,
            string label     = null)
            : base(drawing, cssClass, disabled)
        {
            AddChild(new SpacerDrawing(15, 20));

            Header = new HorizontalListDrawing
            {
                LeftMargin    = 0,
                RightMargin   = 0,
                TopMargin     = 0,
                BottomMargin  = 0,
                Left          = 0,
                Top           = 0,
                FixedPosition = true,
                CssClass      = CssClass
            };
            AddChild(Header);

            if (!string.IsNullOrWhiteSpace(label))
            {
                Label = new RectangleDrawing
                {
                    CssClass     = disabled ? "disabled label" : "label",
                    CornerRadius = CornerRadius,
                    LeftMargin   = 3,
                    TopMargin    = 3,
                    BottomMargin = 2,
                    RightMargin  = 2,
                    Width        = 18,
                    Height       = 22,
                    FixedSize    = true,
                };

                LabelText = new TextDrawing
                {
                    Text     = new[] { label },
                    CssClass = disabled ? "disabled label" : "label"
                };

                if (headingLevel == 3)
                {
                    Label.Width        = 14;
                    Label.Height       = 16;
                    Label.TopMargin    = 3;
                    Label.LeftMargin   = 2;
                    LabelText.TextSize = 9f / 12f;
                }

                Label.AddChild(LabelText);
                Header.AddChild(Label);
            }
            else
            {
                Header.AddChild(new SpacerDrawing(1, 1));
            }

            Title = new TextDrawing
            {
                Text = new[] { title }
            }
            .HeadingLevel(headingLevel);

            if (disabled)
            {
                Title.CssClass = "disabled " + Title.CssClass;
            }

            Header.AddChild(Title);
        }