src/Misc/EFTools/EntityDesignPackage/CustomCode/MicrosoftDataEntityDesignCommandSet.cs
/// <summary>
///     Invoke handler: "Add Navigation Property"
/// </summary>
Invoke handler: "Add Navigation Property"
Invoke handler : " Add Navigation Property "
internal void OnMenuAddNavigationProperty(object sender, EventArgs e)
        {
            if (sender is MenuCommand)
            {
                var diagram = GetDiagram();
                Debug.Assert(diagram != null && diagram.ActiveDiagramView != null, "could not find diagram");
                if (diagram != null
                    && diagram.ActiveDiagramView != null)
                {
                    var view = diagram.ActiveDiagramView.DiagramClientView;
                    if (view != null)
                    {
                        var compartment = GetSelectedCompartment(false );
                        Debug.Assert(compartment != null, "could not find Navigation compartment");
                        if (compartment != null)
                        {
                            var domainClassId = NavigationProperty.DomainClassId;
                            var domainClassInfo = diagram.Partition.DomainDataDirectory.GetDomainClass(domainClassId);
                            compartment.HandleNewListItemInsertion(view, domainClassInfo);
                        }
                    }
                }
            }
        }
internal void OnMenuAddNavigationProperty ( object sender , EventArgs e ) { if ( sender is MenuCommand ) { var diagram = GetDiagram ( ) ; Debug . Assert ( diagram != null && diagram . ActiveDiagramView != null , " " ) ; if ( diagram != null && diagram . ActiveDiagramView != null ) { var view = diagram . ActiveDiagramView . DiagramClientView ; if ( view != null ) { var compartment = GetSelectedCompartment ( false ) ; Debug . Assert ( compartment != null , " " ) ; if ( compartment != null ) { var domainClassId = NavigationProperty . DomainClassId ; var domainClassInfo = diagram . Partition . DomainDataDirectory . GetDomainClass ( domainClassId ) ; compartment . HandleNewListItemInsertion ( view , domainClassInfo ) ; } } } } }
Invoke handler: "Add Navigation Property"
Invoke handler : " Add Navigation Property "
// A user can Insert to add a navigation property outside of our command filter // so we need to ensure we also short-circuit here. /* Navigation Compartment */
sender
object
e
EventArgs