StoryTeller.Project.DetermineSystemType C# (CSharp) Method

DetermineSystemType() public method

public DetermineSystemType ( ) : Type
return Type
        public Type DetermineSystemType()
        {
            if (SystemTypeName.IsNotEmpty() && SystemTypeName.Contains(',')) return Type.GetType(SystemTypeName);

            var types = FindSystemTypesInCurrentAssembly();

            if (types.Count() == 1)
            {
                return types.Single();
            }

            if (SystemTypeName.IsNotEmpty())
            {
                return types.FirstOrDefault(x => x.Name == SystemTypeName);
            }

            if (!types.Any())
            {
                return typeof (NulloSystem);
            }

            
            throw new InDeterminateSystemTypeException(types);
        }