Esempio n. 1
0
 public static CompositionError PreventedByExistingImport(ComposablePart part, ImportDefinition import)
 {
     return CompositionError.Create(
         CompositionErrorId.ImportEngine_PreventedByExistingImport,
         Strings.ImportEngine_PreventedByExistingImport,
         import.ToElement().DisplayName,
         part.ToElement().DisplayName);
 }
Esempio n. 2
0
        public static CompositionError CreateImportCardinalityMismatch(ImportCardinalityMismatchException exception, ImportDefinition definition)
        {
            Assumes.NotNull(exception, definition);

            return CompositionError.Create(
                CompositionErrorId.ImportEngine_ImportCardinalityMismatch, 
                exception.Message,
                definition.ToElement(), 
                (Exception)null);
        }
Esempio n. 3
0
        public static CompositionError CreatePartCannotSetImport(ComposablePart part, ImportDefinition definition, Exception innerException)
        {
            Assumes.NotNull(part, definition, innerException);

            ICompositionElement element = definition.ToElement();
            return CompositionError.Create(
                CompositionErrorId.ImportEngine_PartCannotSetImport,
                element,
                innerException,
                Strings.ImportEngine_PartCannotSetImport,
                element.DisplayName,
                part.ToElement().DisplayName);
        }