Пример #1
0
 private bool ReplaceAspectByName(Collection4 aspects, ClassAspect aspect)
 {
     var existing = AspectByName(aspects, aspect.GetName());
     if (existing == null)
     {
         return false;
     }
     aspects.ReplaceByIdentity(existing, aspect);
     return true;
 }
Пример #2
0
 private bool InstallTranslatorOnExistingAspect(IObjectTranslator translator, ClassAspect
     existingAspect, Collection4 aspects)
 {
     if (existingAspect is TranslatedAspect)
     {
         var translatedAspect = (TranslatedAspect) existingAspect;
         translatedAspect.InitializeTranslator(translator);
         _translator = translatedAspect;
         return false;
     }
     // older versions didn't store the aspect type properly
     _translator = new TranslatedAspect(this, translator);
     aspects.ReplaceByIdentity(existingAspect, _translator);
     return true;
 }