[5a4bff]: / Interfaces / +APUnitTestFramework / DependencyErrorEventArgs.cs  Maximize  Restore  History

Download this file

46 lines (41 with data), 1.8 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using _3S.CoDeSys.Core.ComponentModel;
using System;

namespace _3S.APUnitTestFramework
{
    /// <summary>
    /// Event arguments for the <see cref="Testbed.DependencyError"/> event.
    /// </summary>
    public class DependencyErrorEventArgs : EventArgs
    {
        /// <summary>
        /// For internal use only.
        /// </summary>
        /// <param name="exception"></param>
        /// <param name="requiredInterfaceType"></param>
        /// <param name="specificTypeGuid"></param>
        public DependencyErrorEventArgs(ComponentModelException exception, Type requiredInterfaceType, Guid? specificTypeGuid)
        {
            Exception = exception;
            RequiredInterfaceType = requiredInterfaceType;
            SpecificTypeGuid = specificTypeGuid;
        }

        /// <summary>
        /// Gets the exception that has been thrown by the Component Model implementation while
        /// attempting to resolve the dependency (most likely a <see cref=
        /// "NoInstanceForInjectionException"/>).
        /// </summary>
        public ComponentModelException Exception { get; private set; }

        /// <summary>
        /// Gets the required interface type of the dependency that could not be resolved.
        /// </summary>
        public Type RequiredInterfaceType { get; private set; }

        /// <summary>
        /// Gets the specific required type GUID of the dependency that could not be resolved (in
        /// the case that the dependency has been marked with the <see cref=
        /// "InjectSpecificInstanceAttribute"/> or the <see cref=
        /// "InjectSpecificTypeInformationAttribute"/>). This property value is <c>null</c> if
        /// the dependency is not bound to a specific type GUID.
        /// </summary>
        public Guid? SpecificTypeGuid { get; private set; }
    }
}