src/Misc/EFTools/XmlCore/UI/ViewModels/Explorer/ModelToExplorerModelXRef.cs
/// <summary>
///     Pairs a ModelManager type with a ModelToExplorerModelXRef type.  Whenever a ModelToExplorerModelXRef is requested,
///     the ModelManager type will be used to find the correct ModelToExplorerModelXRef.
/// </summary>
/// <param name="modelManagerType">
///     The type of ModelManager that should be paired with the xRefType.
/// </param>
/// <param name="xRefType">
///     The type of ModelToExplorerModelXRef that will be used for the specified ModelManager type.
/// </param>
Pairs a ModelManager type with a ModelToExplorerModelXRef type.  Whenever a ModelToExplorerModelXRef is requested,
the ModelManager type will be used to find the correct ModelToExplorerModelXRef.
Pairs a ModelManager type with a ModelToExplorerModelXRef type . Whenever a ModelToExplorerModelXRef is requested the ModelManager type will be used to find the correct ModelToExplorerModelXRef .
internal static void AddModelManager2XRefType(Type modelManagerType, Type xRefType)
        {
            Debug.Assert(
                typeof(ModelManager).IsAssignableFrom(modelManagerType) && modelManagerType != typeof(ModelManager),
                "modelManagerType needs to be a type that derives from ModelManager.");
            Debug.Assert(
                typeof(ModelToExplorerModelXRef).IsAssignableFrom(xRefType) && xRefType != typeof(ModelToExplorerModelXRef),
                "xRefType needs to be a type that derives from ModelToExplorerModelXRef.");
            Type existingXRefType;
            if (_modelManagerType2XRefType.TryGetValue(modelManagerType, out existingXRefType))
            {
                Debug.Assert(
                    existingXRefType == xRefType,
                    "The modelManagerType already exists, but the xRefType is not the same as the existing xRefType.  Either use a different modelManagerType or use the same xRefType.");
            }
            else
            {
                _modelManagerType2XRefType.Add(modelManagerType, xRefType);
            }
        }
internal static void AddModelManager2XRefType ( Type modelManagerType , Type xRefType ) { Debug . Assert ( typeof ( ModelManager ) . IsAssignableFrom ( modelManagerType ) && modelManagerType != typeof ( ModelManager ) , " " ) ; Debug . Assert ( typeof ( ModelToExplorerModelXRef ) . IsAssignableFrom ( xRefType ) && xRefType != typeof ( ModelToExplorerModelXRef ) , " " ) ; Type existingXRefType ; if ( _modelManagerType2XRefType . TryGetValue ( modelManagerType , out existingXRefType ) ) { Debug . Assert ( existingXRefType == xRefType , " " ) ; } else { _modelManagerType2XRefType . Add ( modelManagerType , xRefType ) ; } }
Pairs a ModelManager type with a ModelToExplorerModelXRef type.
Pairs a ModelManager type with a ModelToExplorerModelXRef type .
// if the modelManagerType already exists in the map, make sure the XRef types are the same
modelManagerType
Type
The type of ModelManager that should be paired with the xRefType.
The type of ModelManager that should be paired with the xRefType .
xRefType
Type
The type of ModelToExplorerModelXRef that will be used for the specified ModelManager type.
The type of ModelToExplorerModelXRef that will be used for the specified ModelManager type .