src/Misc/EFTools/EntityDesignModel/Designer/Visitor/VerifyDiagramModelIntegrityVisitor.cs
/// <summary>
///     Construct the moniker for diagram object which is a combination of diagram name and
/// </summary>
Construct the moniker for diagram object which is a combination of diagram name and
Construct the moniker for diagram object which is a combination of diagram name and
[SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
        private static string GetDiagramMoniker(BaseDiagramObject diagramObject)
        {
            var diagramName = (diagramObject.Diagram != null ? diagramObject.Diagram.Name : String.Empty);
            if (diagramObject is InheritanceConnector)
            {
                var entityType = diagramObject.ModelItem as ConceptualEntityType;
                Debug.Assert(entityType != null, "Inheritance connector should point to an instance of conceptual entity type.");
                if (entityType != null)
                {
                    Debug.Assert(entityType.SafeBaseType != null, "This entity type should be a derived type.");
                    if (entityType.SafeBaseType != null)
                    {
                        return diagramName + " : " + entityType.SafeBaseType.ToPrettyString() + " : " + entityType.ToPrettyString();
                    }
                }
                return string.Empty;
            }
            else if (diagramObject.ModelItem == null)
            {
                return diagramName + " : " + diagramObject.ToPrettyString();
            }
            else
            {
                return diagramName + " : " + diagramObject.ModelItem.ToPrettyString();
            }
        }
[ SuppressMessage ( " " , " " ) ] private static string GetDiagramMoniker ( BaseDiagramObject diagramObject ) { var diagramName = ( diagramObject . Diagram != null ? diagramObject . Diagram . Name : String . Empty ) ; if ( diagramObject is InheritanceConnector ) { var entityType = diagramObject . ModelItem as ConceptualEntityType ; Debug . Assert ( entityType != null , " " ) ; if ( entityType != null ) { Debug . Assert ( entityType . SafeBaseType != null , " " ) ; if ( entityType . SafeBaseType != null ) { return diagramName + " " + entityType . SafeBaseType . ToPrettyString ( ) + " " + entityType . ToPrettyString ( ) ; } } return string . Empty ; } else if ( diagramObject . ModelItem == null ) { return diagramName + " " + diagramObject . ToPrettyString ( ) ; } else { return diagramName + " " + diagramObject . ModelItem . ToPrettyString ( ) ; } }
Construct the moniker for diagram object which is a combination of diagram name and
Construct the moniker for diagram object which is a combination of diagram name and
diagramObject
BaseDiagramObject