2 instantiations of CompositionError
System.ComponentModel.Composition (2)
System\ComponentModel\Composition\CompositionError.cs (1)
180return new CompositionError(id, string.Format(CultureInfo.CurrentCulture, format, parameters), element, exception);
System\ComponentModel\Composition\CompositionException.cs (1)
319VisitError(new CompositionError(exception.Message, exception.InnerException), context);
88 references to CompositionError
System.ComponentModel.Composition (88)
System\ComponentModel\Composition\ChangeRejectedException.cs (2)
35: base(message, innerException, (IEnumerable<CompositionError>?)null) 43public ChangeRejectedException(IEnumerable<CompositionError>? errors)
System\ComponentModel\Composition\CompositionError.cs (22)
23/// Initializes a new instance of the <see cref="CompositionError"/> class 28/// <see cref="CompositionError"/>; or <see langword="null"/> to set the 37/// Initializes a new instance of the <see cref="CompositionError"/> class 43/// <see cref="CompositionError"/>; or <see langword="null"/> to set 44/// the <see cref="CompositionError.Element"/> property to 49/// <see cref="CompositionError"/>; or <see langword="null"/> to set the 58/// Initializes a new instance of the <see cref="CompositionError"/> class 64/// <see cref="CompositionError"/>; or <see langword="null"/> to set the 69/// <see cref="CompositionError"/>; or <see langword="null"/> to set 70/// the <see cref="CompositionError.Exception"/> property to <see langword="null"/>. 78/// Initializes a new instance of the <see cref="CompositionError"/> class 84/// <see cref="CompositionError"/>; or <see langword="null"/> to set the 89/// <see cref="CompositionError"/>; or <see langword="null"/> to set 90/// the <see cref="CompositionError.Element"/> property to 95/// <see cref="CompositionError"/>; or <see langword="null"/> to set 96/// the <see cref="CompositionError.Exception"/> property to <see langword="null"/>. 116/// <see cref="CompositionError"/>. The default is <see langword="null"/>. 128/// <see cref="CompositionError"/>. 140/// <see cref="CompositionError"/>. The default is <see langword="null"/>. 168internal static CompositionError Create(CompositionErrorId id, string format, params object?[] parameters) 173internal static CompositionError Create(CompositionErrorId id, ICompositionElement element, string format, params object?[] parameters) 178internal static CompositionError Create(CompositionErrorId id, ICompositionElement? element, Exception? exception, string format, params object?[] parameters)
System\ComponentModel\Composition\CompositionErrorDebuggerProxy.cs (2)
11private readonly CompositionError _error; 13public CompositionErrorDebuggerProxy(CompositionError error)
System\ComponentModel\Composition\CompositionException.cs (28)
24private readonly ReadOnlyCollection<CompositionError> _errors; 30: this((string?)null, (Exception?)null, (IEnumerable<CompositionError>?)null) 44: this(message, (Exception?)null, (IEnumerable<CompositionError>?)null) 64: this(message, innerException, (IEnumerable<CompositionError>?)null) 68internal CompositionException(CompositionError error) 69: this(new CompositionError[] { error }) 78/// An <see cref="IEnumerable{T}"/> of <see cref="CompositionError"/> objects 86public CompositionException(IEnumerable<CompositionError>? errors) 91internal CompositionException(string? message, Exception? innerException, IEnumerable<CompositionError>? errors) 95_errors = Array.AsReadOnly(errors == null ? Array.Empty<CompositionError>() : errors.ToArray<CompositionError>()); 102/// An <see cref="IEnumerable{T}"/> of <see cref="CompositionError"/> objects 106public ReadOnlyCollection<CompositionError> Errors 141foreach (var error in Errors) 162List<Stack<CompositionError>> paths = CalculatePaths(this); 208private static void WritePaths(StringBuilder writer, List<Stack<CompositionError>> paths) 211foreach (Stack<CompositionError> path in paths) 218private static void WritePath(StringBuilder writer, Stack<CompositionError> path, int ordinal) 226foreach (CompositionError error in path) 238private static void WriteError(StringBuilder writer, CompositionError error) 263private static List<Stack<CompositionError>> CalculatePaths(CompositionException exception) 265List<Stack<CompositionError>> paths = new List<Stack<CompositionError>>(); 268context.Path = new Stack<CompositionError>(); 282foreach (CompositionError error in exception.Errors) 293private static void VisitError(CompositionError error, VisitContext context) 325public Stack<CompositionError> Path; 326public Action<Stack<CompositionError>> LeafVisitor;
System\ComponentModel\Composition\CompositionExceptionDebuggerProxy.cs (1)
30foreach (var error in _exception.Errors)
System\ComponentModel\Composition\CompositionResult.cs (9)
14private readonly IEnumerable<CompositionError>? _errors; 16public CompositionResult(params CompositionError[] errors) 17: this((IEnumerable<CompositionError>)errors) 21public CompositionResult(IEnumerable<CompositionError>? errors) 31public IEnumerable<CompositionError> Errors 33get { return _errors ?? Enumerable.Empty<CompositionError>(); } 49public CompositionResult MergeError(CompositionError error) 51return MergeErrors(new CompositionError[] { error }); 54public CompositionResult MergeErrors(IEnumerable<CompositionError>? errors)
System\ComponentModel\Composition\CompositionResultOfT.cs (6)
13private readonly IEnumerable<CompositionError>? _errors; 21public CompositionResult(params CompositionError[] errors) 26public CompositionResult(IEnumerable<CompositionError>? errors) 31internal CompositionResult(T? value, IEnumerable<CompositionError>? errors) 42public IEnumerable<CompositionError> Errors 44get { return _errors ?? Enumerable.Empty<CompositionError>(); }
System\ComponentModel\Composition\ErrorBuilder.cs (16)
10public static CompositionError PreventedByExistingImport(ComposablePart part, ImportDefinition import) 12return CompositionError.Create( 19public static CompositionError InvalidStateForRecompposition(ComposablePart part) 21return CompositionError.Create( 27public static CompositionError ComposeTookTooManyIterations(int maximumNumberOfCompositionIterations) 29return CompositionError.Create( 35public static CompositionError CreateImportCardinalityMismatch(ImportCardinalityMismatchException exception, ImportDefinition definition) 40return CompositionError.Create( 47public static CompositionError CreatePartCannotActivate(ComposablePart part, Exception innerException) 53return CompositionError.Create( 61public static CompositionError CreatePartCannotSetImport(ComposablePart part, ImportDefinition definition, Exception innerException) 68return CompositionError.Create( 77public static CompositionError CreateCannotGetExportedValue(ComposablePart part, ExportDefinition definition, Exception innerException) 84return CompositionError.Create( 93public static CompositionError CreatePartCycle(ComposablePart part) 98return CompositionError.Create(
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (2)
490var error = CompositionError.Create(