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