Exemplo n.º 1
0
 /// <summary>
 /// Recursively register the given <paramref name="activator"/> for the <paramref name="domainClass"/>
 /// </summary>
 /// <param name="domainClass">The <see cref="DomainClassInfo"/> for the type to register</param>
 /// <param name="activator">A delegate callback for when an element of this type is selected</param>
 private void RegisterErrorActivator(DomainClassInfo domainClass, ORMModelErrorActivator activator)
 {
     myActivators[domainClass.ImplementationClass] = activator;
     foreach (DomainClassInfo derivedClassInfo in domainClass.AllDescendants)
     {
         RegisterErrorActivator(derivedClassInfo, activator);
     }
 }
Exemplo n.º 2
0
 void IORMModelErrorActivationService.RegisterErrorActivator(Type elementType, bool registerDerivedTypes, ORMModelErrorActivator activator)
 {
     if (registerDerivedTypes)
     {
         DomainDataDirectory dataDirectory = myStore.DomainDataDirectory;
         RegisterErrorActivator(elementType.IsSubclassOf(typeof(ElementLink)) ? dataDirectory.GetDomainRelationship(elementType) : dataDirectory.GetDomainClass(elementType), activator);
     }
     else
     {
         myActivators[elementType] = activator;
     }
 }