public void OnEndEditing(Point point, bool commitChanges)
 {
     if (this.activeEditPoint != null)
     {
         this.Invalidate();
         if (commitChanges)
         {
             this.UpdateEditPoints(point);
             EditPoint activeEditPoint = this.activeEditPoint;
             this.activeEditPoint = null;
             this.UpdateEditPoints(point);
             bool flag = false;
             if (activeEditPoint.Type == EditPoint.EditPointTypes.ConnectionEditPoint)
             {
                 ConnectionManager        service            = this.GetService(typeof(ConnectionManager)) as ConnectionManager;
                 FreeformActivityDesigner connectorContainer = ConnectionManager.GetConnectorContainer(activeEditPoint.EditedConnectionPoint.AssociatedDesigner);
                 if (((service != null) && (service.SnappedConnectionPoint != null)) && (connectorContainer != null))
                 {
                     ConnectionPoint source = this.editedConnector.Source;
                     ConnectionPoint target = this.editedConnector.Target;
                     if (target.Equals(activeEditPoint.EditedConnectionPoint))
                     {
                         target = service.SnappedConnectionPoint;
                     }
                     else if (source.Equals(activeEditPoint.EditedConnectionPoint))
                     {
                         source = service.SnappedConnectionPoint;
                     }
                     if ((connectorContainer == ConnectionManager.GetConnectorContainer(target.AssociatedDesigner)) && connectorContainer.CanConnectContainedDesigners(source, target))
                     {
                         this.editedConnector.Source = source;
                         this.editedConnector.Target = target;
                         if (this.editedConnector.ParentDesigner == null)
                         {
                             this.editedConnector = connectorContainer.AddConnector(source, target);
                             WorkflowDesignerLoader loader = this.GetService(typeof(WorkflowDesignerLoader)) as WorkflowDesignerLoader;
                             if (loader != null)
                             {
                                 loader.SetModified(true);
                             }
                         }
                         connectorContainer.OnContainedDesignersConnected(source, target);
                     }
                     flag = true;
                 }
             }
             else
             {
                 flag = true;
             }
             if (flag)
             {
                 this.editedConnector.SetConnectorSegments(this.GetPointsFromEditPoints(this.editPoints));
                 if (this.editedConnector.ParentDesigner != null)
                 {
                     this.editedConnector.ParentDesigner.OnConnectorChanged(new ConnectorEventArgs(this.editedConnector));
                     WorkflowDesignerLoader loader2 = this.GetService(typeof(WorkflowDesignerLoader)) as WorkflowDesignerLoader;
                     if (loader2 != null)
                     {
                         loader2.SetModified(true);
                     }
                 }
             }
             this.PerformLayout();
         }
         this.Invalidate();
     }
 }