Catel.IoC.ServiceLocator.CompleteTypeRequestPathIfRequired C# (CSharp) Method

CompleteTypeRequestPathIfRequired() private method

Completes the type request path by checking if the currently created type is the same as the first type meaning that the type is successfully created and the current type request path can be set to null.
private CompleteTypeRequestPathIfRequired ( Catel.IoC.TypeRequestInfo typeRequestInfoForTypeJustConstructed ) : void
typeRequestInfoForTypeJustConstructed Catel.IoC.TypeRequestInfo The type request info.
return void
        private void CompleteTypeRequestPathIfRequired(TypeRequestInfo typeRequestInfoForTypeJustConstructed)
        {
            lock (_lockObject)
            {
                if (_currentTypeRequestPath != null)
                {
                    if (_currentTypeRequestPath.TypeCount > 0)
                    {
                        if (_currentTypeRequestPath.LastType == typeRequestInfoForTypeJustConstructed)
                        {
                            _currentTypeRequestPath.MarkTypeAsCreated(typeRequestInfoForTypeJustConstructed);
                        }
                    }

                    if (_currentTypeRequestPath.TypeCount == 0)
                    {
                        _currentTypeRequestPath = null;
                    }
                }
            }
        }