Beispiel #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);
            }
        }
Beispiel #2
0
 public bool Equals(ILinePartEdge other) => Equals((ISupportPoint)other);
Beispiel #3
0
 bool IEquatable <ILinePartEdge> .Equals(ILinePartEdge other) => other is CrosswalkBorderEdge otherBorder && Equals(otherBorder);
Beispiel #4
0
 bool IEquatable <ILinePartEdge> .Equals(ILinePartEdge other) => other is EnterSupportPoint otherEnter && Equals(otherEnter);
Beispiel #5
0
 bool IEquatable <ILinePartEdge> .Equals(ILinePartEdge other) => other is IntersectSupportPoint otherIntersect && Equals(otherIntersect);
Beispiel #6
0
 private void ToChanged(ILinePartEdge to) => Rule.To       = to;
Beispiel #7
0
 private void FromChanged(ILinePartEdge from) => Rule.From = from;
Beispiel #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;
        }
Beispiel #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;
        }