2 instantiations of CompositionError
System.ComponentModel.Composition (2)
System\ComponentModel\Composition\CompositionError.cs (1)
180
return new
CompositionError
(id, string.Format(CultureInfo.CurrentCulture, format, parameters), element, exception);
System\ComponentModel\Composition\CompositionException.cs (1)
319
VisitError(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)
43
public 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"/>.
168
internal static
CompositionError
Create(CompositionErrorId id, string format, params object?[] parameters)
173
internal static
CompositionError
Create(CompositionErrorId id, ICompositionElement element, string format, params object?[] parameters)
178
internal static
CompositionError
Create(CompositionErrorId id, ICompositionElement? element, Exception? exception, string format, params object?[] parameters)
System\ComponentModel\Composition\CompositionErrorDebuggerProxy.cs (2)
11
private readonly
CompositionError
_error;
13
public CompositionErrorDebuggerProxy(
CompositionError
error)
System\ComponentModel\Composition\CompositionException.cs (28)
24
private 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)
68
internal CompositionException(
CompositionError
error)
69
: this(new
CompositionError
[] { error })
78
/// An <see cref="IEnumerable{T}"/> of <see cref="
CompositionError
"/> objects
86
public CompositionException(IEnumerable<
CompositionError
>? errors)
91
internal 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
106
public ReadOnlyCollection<
CompositionError
> Errors
141
foreach (
var
error in Errors)
162
List<Stack<
CompositionError
>> paths = CalculatePaths(this);
208
private static void WritePaths(StringBuilder writer, List<Stack<
CompositionError
>> paths)
211
foreach (Stack<
CompositionError
> path in paths)
218
private static void WritePath(StringBuilder writer, Stack<
CompositionError
> path, int ordinal)
226
foreach (
CompositionError
error in path)
238
private static void WriteError(StringBuilder writer,
CompositionError
error)
263
private static List<Stack<
CompositionError
>> CalculatePaths(CompositionException exception)
265
List<Stack<
CompositionError
>> paths = new List<Stack<
CompositionError
>>();
268
context.Path = new Stack<
CompositionError
>();
282
foreach (
CompositionError
error in exception.Errors)
293
private static void VisitError(
CompositionError
error, VisitContext context)
325
public Stack<
CompositionError
> Path;
326
public Action<Stack<
CompositionError
>> LeafVisitor;
System\ComponentModel\Composition\CompositionExceptionDebuggerProxy.cs (1)
30
foreach (
var
error in _exception.Errors)
System\ComponentModel\Composition\CompositionResult.cs (9)
14
private readonly IEnumerable<
CompositionError
>? _errors;
16
public CompositionResult(params
CompositionError
[] errors)
17
: this((IEnumerable<
CompositionError
>)errors)
21
public CompositionResult(IEnumerable<
CompositionError
>? errors)
31
public IEnumerable<
CompositionError
> Errors
33
get { return _errors ?? Enumerable.Empty<
CompositionError
>(); }
49
public CompositionResult MergeError(
CompositionError
error)
51
return MergeErrors(new
CompositionError
[] { error });
54
public CompositionResult MergeErrors(IEnumerable<
CompositionError
>? errors)
System\ComponentModel\Composition\CompositionResultOfT.cs (6)
13
private readonly IEnumerable<
CompositionError
>? _errors;
21
public CompositionResult(params
CompositionError
[] errors)
26
public CompositionResult(IEnumerable<
CompositionError
>? errors)
31
internal CompositionResult(T? value, IEnumerable<
CompositionError
>? errors)
42
public IEnumerable<
CompositionError
> Errors
44
get { return _errors ?? Enumerable.Empty<
CompositionError
>(); }
System\ComponentModel\Composition\ErrorBuilder.cs (16)
10
public static
CompositionError
PreventedByExistingImport(ComposablePart part, ImportDefinition import)
12
return
CompositionError
.Create(
19
public static
CompositionError
InvalidStateForRecompposition(ComposablePart part)
21
return
CompositionError
.Create(
27
public static
CompositionError
ComposeTookTooManyIterations(int maximumNumberOfCompositionIterations)
29
return
CompositionError
.Create(
35
public static
CompositionError
CreateImportCardinalityMismatch(ImportCardinalityMismatchException exception, ImportDefinition definition)
40
return
CompositionError
.Create(
47
public static
CompositionError
CreatePartCannotActivate(ComposablePart part, Exception innerException)
53
return
CompositionError
.Create(
61
public static
CompositionError
CreatePartCannotSetImport(ComposablePart part, ImportDefinition definition, Exception innerException)
68
return
CompositionError
.Create(
77
public static
CompositionError
CreateCannotGetExportedValue(ComposablePart part, ExportDefinition definition, Exception innerException)
84
return
CompositionError
.Create(
93
public static
CompositionError
CreatePartCycle(ComposablePart part)
98
return
CompositionError
.Create(
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (2)
490
var
error =
CompositionError
.Create(