Catel.ApiCop.Rules.TooManyDependenciesApiCopRule.SetNumberOfDependenciesInjected C# (CSharp) Метод

SetNumberOfDependenciesInjected() публичный Метод

Sets the number of dependencies injected for the specified type.
public SetNumberOfDependenciesInjected ( Type type, int numberOfDependencies ) : void
type System.Type The type.
numberOfDependencies int The number of dependencies.
Результат void
        public void SetNumberOfDependenciesInjected(Type type, int numberOfDependencies)
        {
            if (type == null)
            {
                return;
            }

            lock (_lockObject)
            {
                var typeName = type.GetSafeFullName(true);

                AddTag(typeName);

                bool update = false;
                if (!_dependenciesPerType.ContainsKey(typeName))
                {
                    update = true;
                }
                else
                {
                    if (_dependenciesPerType[typeName] < numberOfDependencies)
                    {
                        update = true;
                    }
                }

                if (update)
                {
                    _dependenciesPerType[typeName] = numberOfDependencies;
                }
            }
        }