Esempio n. 1
0
        private void ProcessRightClickOnSelectedEdge(MsaglMouseEventArgs e)
        {
            mouseRightButtonDownPoint = viewer.ScreenToSource(e);

            cornerInfo = AnalyzeInsertOrDeletePolylineCorner(mouseRightButtonDownPoint, this.SelectedEdge.RadiusOfPolylineCorner);

            if (cornerInfo == null)
            {
                return;
            }

            e.Handled = true;

            Couple <string, DelegateReturningVoid> edgeRemoveCouple = new Couple <string, DelegateReturningVoid>("Remove edge",
                                                                                                                 delegate() { this.viewer.RemoveEdge(this.SelectedEdge, true); });

            if (cornerInfo.Second == Microsoft.Msagl.Drawing.PolylineCornerType.PreviousCornerForInsertion)
            {
                viewer.PopupMenus(new Couple <string, DelegateReturningVoid>("Insert polyline corner", new DelegateReturningVoid(this.InsertPolylineCorner)), edgeRemoveCouple);
            }
            else if (cornerInfo.Second == Microsoft.Msagl.Drawing.PolylineCornerType.CornerToDelete)
            {
                viewer.PopupMenus(new Couple <string, DelegateReturningVoid>("Delete polyline corner", new DelegateReturningVoid(this.DeleteCorner)), edgeRemoveCouple);
            }
        }
Esempio n. 2
0
/// <summary>
/// overrides the equality
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
        public override bool Equals(object obj)
        {
            Couple <TFirst, TSecond> c = obj as Couple <TFirst, TSecond>;

            if (c == null)
            {
                return(false);
            }

            return(c.first.Equals(first) && c.second.Equals(second));
        }