// TODO Get rid of addToOrderedTargets eventually, when closure builder understands the correct order of type declarations based on dependencies
        public void AddTypeTranslationContext(ITypeTranslationContext typeTranslationContext, bool addToOrderedTargets)
        {
            if (addToOrderedTargets)
            {
                var typeBoundTranslationContext = typeTranslationContext as ITypeBoundTranslationContext;
                OrderedTargetTypes.Insert(0, typeBoundTranslationContext.TypeInfo);
            }

            TranslationChain.Add(typeTranslationContext);
        }
 public IEnumerable <ITranslationResult> TranslateTargets()
 {
     return(OrderedTargetTypes
            .Select(targetType =>
     {
         var definition =
             this.First(typeTranslationContext => typeTranslationContext.CanProcess(targetType.AsType()))
             .Process(targetType.AsType())
             .Definition;
         return new TranslationResult(targetType, definition);
     }));
 }