src/Misc/EFTools/EntityDesignPackage/CustomCode/MicrosoftDataEntityDesignCommandSet.cs
/// <summary>
///     This method is called if the Add Scalar/Complex Property menu item is selected
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
This method is called if the Add Scalar/Complex Property menu item is selected
This method is called if the Add Scalar / Complex Property menu item is selected
internal void OnMenuAddProperty(object sender, EventArgs e)
        {
            var cmd = sender as MenuCommand;
            if (cmd != null)
            {
                var diagram = GetDiagram();
                Debug.Assert(diagram != null && diagram.ActiveDiagramView != null, "could not find diagram or ActiveDiagramView");
                if (diagram != null
                    && diagram.ActiveDiagramView != null)
                {
                    var view = diagram.ActiveDiagramView.DiagramClientView;
                    if (view != null)
                    {
                        var compartment = GetSelectedCompartment(true );
                        Debug.Assert(compartment != null, "could not find properties compartment");
                        if (compartment != null)
                        {
                            var domainClassId = cmd.CommandID == MicrosoftDataEntityDesignCommands.AddComplexProperty
                                                    ? ComplexProperty.DomainClassId
                                                    : ScalarProperty.DomainClassId;
                            var domainClassInfo = diagram.Partition.DomainDataDirectory.GetDomainClass(domainClassId);
                            compartment.HandleNewListItemInsertion(view, domainClassInfo);
                        }
                    }
                }
            }
        }
internal void OnMenuAddProperty ( object sender , EventArgs e ) { var cmd = sender as MenuCommand ; if ( cmd != null ) { 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 ( true ) ; Debug . Assert ( compartment != null , " " ) ; if ( compartment != null ) { var domainClassId = cmd . CommandID == MicrosoftDataEntityDesignCommands . AddComplexProperty ? ComplexProperty . DomainClassId : ScalarProperty . DomainClassId ; var domainClassInfo = diagram . Partition . DomainDataDirectory . GetDomainClass ( domainClassId ) ; compartment . HandleNewListItemInsertion ( view , domainClassInfo ) ; } } } } }
This method is called if the Add Scalar/Complex Property menu item is selected
This method is called if the Add Scalar / Complex Property menu item is selected
/* Properties Compartment */
sender
object
None
e
EventArgs
None