Ejemplo n.º 1
0
        internal static void AssemblyLoadFailed(DirectoryCatalog catalog, string fileName, Exception exception)
        {
            if (catalog == null)
            {
                throw new ArgumentNullException(nameof(catalog));
            }

            if (exception == null)
            {
                throw new ArgumentNullException(nameof(exception));
            }

            if (fileName == null)
            {
                throw new ArgumentNullException(nameof(fileName));
            }

            if (fileName.Length == 0)
            {
                throw new ArgumentException(SR.Format(SR.ArgumentException_EmptyString, nameof(fileName)), nameof(fileName));
            }

            if (CompositionTraceSource.CanWriteWarning)
            {
                CompositionTraceSource.WriteWarning(CompositionTraceId.Discovery_AssemblyLoadFailed,
                                                    SR.CompositionTrace_Discovery_AssemblyLoadFailed,
                                                    catalog.GetDisplayName(),
                                                    fileName,
                                                    exception.Message);
            }
        }
Ejemplo n.º 2
0
        internal static void MemberMarkedWithMultipleImportAndImportMany(ReflectionItem item)
        {
            ArgumentNullException.ThrowIfNull(item);

            if (CompositionTraceSource.CanWriteError)
            {
                CompositionTraceSource.WriteError(CompositionTraceId.Discovery_MemberMarkedWithMultipleImportAndImportMany,
                                                  SR.CompositionTrace_Discovery_MemberMarkedWithMultipleImportAndImportMany,
                                                  item.GetDisplayName());
            }
        }
Ejemplo n.º 3
0
        internal static void DefinitionContainsNoExports(Type type)
        {
            ArgumentNullException.ThrowIfNull(type);

            if (CompositionTraceSource.CanWriteInformation)
            {
                CompositionTraceSource.WriteInformation(CompositionTraceId.Discovery_DefinitionContainsNoExports,
                                                        SR.CompositionTrace_Discovery_DefinitionContainsNoExports,
                                                        type.GetDisplayName());
            }
        }
Ejemplo n.º 4
0
        internal static void DefinitionMarkedWithPartNotDiscoverableAttribute(Type type)
        {
            ArgumentNullException.ThrowIfNull(type);

            if (CompositionTraceSource.CanWriteInformation)
            {
                CompositionTraceSource.WriteInformation(CompositionTraceId.Discovery_DefinitionMarkedWithPartNotDiscoverableAttribute,
                                                        SR.CompositionTrace_Discovery_DefinitionMarkedWithPartNotDiscoverableAttribute,
                                                        type.GetDisplayName());
            }
        }
Ejemplo n.º 5
0
        internal static void PartDefinitionResurrected(ComposablePartDefinition definition)
        {
            ArgumentNullException.ThrowIfNull(definition);

            if (CompositionTraceSource.CanWriteInformation)
            {
                CompositionTraceSource.WriteInformation(CompositionTraceId.Rejection_DefinitionResurrected,
                                                        SR.CompositionTrace_Rejection_DefinitionResurrected,
                                                        definition.GetDisplayName());
            }
        }
Ejemplo n.º 6
0
        internal static void DefinitionMismatchedExportArity(Type type, MemberInfo member)
        {
            ArgumentNullException.ThrowIfNull(type);
            ArgumentNullException.ThrowIfNull(member);

            if (CompositionTraceSource.CanWriteInformation)
            {
                CompositionTraceSource.WriteInformation(CompositionTraceId.Discovery_DefinitionMismatchedExportArity,
                                                        SR.CompositionTrace_Discovery_DefinitionMismatchedExportArity,
                                                        type.GetDisplayName(), member.GetDisplayName());
            }
        }
Ejemplo n.º 7
0
        internal static void PartDefinitionRejected(ComposablePartDefinition definition, ChangeRejectedException exception)
        {
            ArgumentNullException.ThrowIfNull(definition);
            ArgumentNullException.ThrowIfNull(exception);

            if (CompositionTraceSource.CanWriteWarning)
            {
                CompositionTraceSource.WriteWarning(CompositionTraceId.Rejection_DefinitionRejected,
                                                    SR.CompositionTrace_Rejection_DefinitionRejected,
                                                    definition.GetDisplayName(),
                                                    exception.Message);
            }
        }
Ejemplo n.º 8
0
        public static void Registration_TypeExportConventionOverridden(Type type)
        {
            if (type == null)
            {
                throw new Exception(SR.Diagnostic_InternalExceptionMessage);
            }

            if (CompositionTraceSource.CanWriteWarning)
            {
                CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_TypeExportConventionOverridden,
                                                    SR.Registration_TypeExportConventionOverridden,
                                                    type.FullName);
            }
        }
Ejemplo n.º 9
0
        internal static void DefinitionContainsNoExports(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            if (CompositionTraceSource.CanWriteInformation)
            {
                CompositionTraceSource.WriteInformation(CompositionTraceId.Discovery_DefinitionContainsNoExports,
                                                        SR.CompositionTrace_Discovery_DefinitionContainsNoExports,
                                                        type.GetDisplayName());
            }
        }
Ejemplo n.º 10
0
        internal static void PartDefinitionResurrected(ComposablePartDefinition definition)
        {
            if (definition == null)
            {
                throw new ArgumentNullException(nameof(definition));
            }

            if (CompositionTraceSource.CanWriteInformation)
            {
                CompositionTraceSource.WriteInformation(CompositionTraceId.Rejection_DefinitionResurrected,
                                                        SR.CompositionTrace_Rejection_DefinitionResurrected,
                                                        definition.GetDisplayName());
            }
        }
Ejemplo n.º 11
0
        public static void Registration_PartCreationConventionOverridden(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            if (CompositionTraceSource.CanWriteWarning)
            {
                CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_PartCreationConventionOverridden,
                                                    SR.Registration_PartCreationConventionOverridden,
                                                    type.FullName);
            }
        }
Ejemplo n.º 12
0
        public static void Registration_ConstructorConventionOverridden(Type type)
        {
            if (type == null)
            {
                throw new Exception(SR.Diagnostic_InternalExceptionMessage);
            }

            if (CompositionTraceSource.CanWriteInformation)
            {
                CompositionTraceSource.WriteInformation(CompositionTraceId.Registration_ConstructorConventionOverridden,
                                                        SR.Registration_ConstructorConventionOverridden,
                                                        type.FullName);
            }
        }
Ejemplo n.º 13
0
        public static void Registration_MemberImportConventionMatchedTwice(Type type, MemberInfo member)
        {
            if (type is null)
            {
                throw new ArgumentNullException(nameof(type));
            }
            if (member is null)
            {
                throw new ArgumentNullException(nameof(member));
            }

            if (CompositionTraceSource.CanWriteWarning)
            {
                CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_MemberImportConventionMatchedTwice,
                                                    SR.Registration_MemberImportConventionMatchedTwice,
                                                    member.Name, type.FullName);
            }
        }
Ejemplo n.º 14
0
        public static void Registration_ParameterImportConventionOverridden(ParameterInfo parameter, ConstructorInfo constructor)
        {
            if (parameter is null)
            {
                throw new ArgumentNullException(nameof(parameter));
            }
            if (constructor is null)
            {
                throw new ArgumentNullException(nameof(constructor));
            }

            if (CompositionTraceSource.CanWriteWarning)
            {
                CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_ParameterImportConventionOverridden,
                                                    SR.Registration_ParameterImportConventionOverridden,
                                                    parameter.Name, constructor.Name);
            }
        }
Ejemplo n.º 15
0
        public static void Registration_OnSatisfiedImportNotificationOverridden(Type type, MemberInfo member)
        {
            if (type is null)
            {
                throw new ArgumentNullException(nameof(type));
            }
            if (member is null)
            {
                throw new ArgumentNullException(nameof(member));
            }

            if (CompositionTraceSource.CanWriteWarning)
            {
                CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_OnSatisfiedImportNotificationOverridden,
                                                    SR.Registration_OnSatisfiedImportNotificationOverridden,
                                                    member.Name, type.FullName);
            }
        }
Ejemplo n.º 16
0
        internal static void DefinitionMismatchedExportArity(Type type, MemberInfo member)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            if (member == null)
            {
                throw new ArgumentNullException(nameof(member));
            }

            if (CompositionTraceSource.CanWriteInformation)
            {
                CompositionTraceSource.WriteInformation(CompositionTraceId.Discovery_DefinitionMismatchedExportArity,
                                                        SR.CompositionTrace_Discovery_DefinitionMismatchedExportArity,
                                                        type.GetDisplayName(), member.GetDisplayName());
            }
        }
Ejemplo n.º 17
0
        public static void Registration_MemberExportConventionOverridden(Type type, MemberInfo member)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            if (member == null)
            {
                throw new ArgumentNullException(nameof(member));
            }

            if (CompositionTraceSource.CanWriteWarning)
            {
                CompositionTraceSource.WriteWarning(CompositionTraceId.Registration_MemberExportConventionOverridden,
                                                    SR.Registration_MemberExportConventionOverridden,
                                                    member.Name, type.FullName);
            }
        }
Ejemplo n.º 18
0
        internal static void PartDefinitionRejected(ComposablePartDefinition definition, ChangeRejectedException exception)
        {
            if (definition == null)
            {
                throw new ArgumentNullException(nameof(definition));
            }

            if (exception == null)
            {
                throw new ArgumentNullException(nameof(exception));
            }


            if (CompositionTraceSource.CanWriteWarning)
            {
                CompositionTraceSource.WriteWarning(CompositionTraceId.Rejection_DefinitionRejected,
                                                    SR.CompositionTrace_Rejection_DefinitionRejected,
                                                    definition.GetDisplayName(),
                                                    exception.Message);
            }
        }