Exemplo n.º 1
0
        public static bool FromXml(XElement config, MarkupLine mainLine, Dictionary <ObjectId, ObjectId> map, out ILinePartEdge supportPoint)
        {
            var type = (SupportType)config.GetAttrValue <int>("T");

            switch (type)
            {
            case SupportType.EnterPoint when EnterPointEdge.FromXml(config, mainLine.Markup, map, out EnterPointEdge enterPoint):
                supportPoint = enterPoint;

                return(true);

            case SupportType.LinesIntersect when LinesIntersectEdge.FromXml(config, mainLine, map, out LinesIntersectEdge linePoint):
                supportPoint = linePoint;

                return(true);

            default:
                supportPoint = null;
                return(false);
            }
        }
Exemplo n.º 2
0
 public bool Equals(ILinePartEdge other) => Equals((ISupportPoint)other);
Exemplo n.º 3
0
 bool IEquatable <ILinePartEdge> .Equals(ILinePartEdge other) => other is CrosswalkBorderEdge otherBorder && Equals(otherBorder);
Exemplo n.º 4
0
 bool IEquatable <ILinePartEdge> .Equals(ILinePartEdge other) => other is EnterSupportPoint otherEnter && Equals(otherEnter);
Exemplo n.º 5
0
 bool IEquatable <ILinePartEdge> .Equals(ILinePartEdge other) => other is IntersectSupportPoint otherIntersect && Equals(otherIntersect);
Exemplo n.º 6
0
 private void ToChanged(ILinePartEdge to) => Rule.To       = to;
Exemplo n.º 7
0
 private void FromChanged(ILinePartEdge from) => Rule.From = from;
Exemplo n.º 8
0
        private void FillEdge(MarkupLineSelectPropertyPanel panel, Action <ILinePartEdge> action, ILinePartEdge value)
        {
            if (panel == null)
            {
                return;
            }

            panel.OnSelectChanged -= action;
            panel.Clear();
            panel.AddRange(Editor.SupportPoints);
            panel.SelectedObject   = value;
            panel.isVisible        = Editor.CanDivide;
            panel.OnSelectChanged += action;
        }
Exemplo n.º 9
0
        private void FillEdge(RuleEdgeSelectPropertyPanel panel, Action <ILinePartEdge> action, ILinePartEdge value)
        {
            if (panel == null)
            {
                return;
            }

            panel.OnValueChanged -= action;
            panel.Clear();
            panel.AddRange(Editor.SupportPoints);
            panel.Value = value;

            if (Settings.ShowPanelTip && Line.IsSupportRules)
            {
                panel.isVisible     = true;
                panel.EnableControl = Editor.CanDivide;
            }
            else
            {
                panel.EnableControl = true;
                panel.isVisible     = Editor.CanDivide;
            }

            panel.OnValueChanged += action;
        }