Example #1
0
        private SDTypeParameter GetTypeParameter(ITypeParameterSymbol typeParameter)
        {
            var sdTypeParameter = new SDTypeParameter
            {
                Name = typeParameter.Name,
                HasDefaultConstructorConstraint = typeParameter.HasConstructorConstraint,
                HasReferenceTypeConstraint = typeParameter.HasReferenceTypeConstraint,
                HasValueTypeConstraint = typeParameter.HasValueTypeConstraint
            };
            foreach (var constraintType in typeParameter.ConstraintTypes)
            {
                sdTypeParameter.ConstraintTypes.Add(_typeRefParser.GetParsedTypeReference(constraintType));
            }

            return sdTypeParameter;
        }
        private SDTypeParameter GetTypeParameter(ITypeParameterSymbol typeParameter)
        {
            var sdTypeParameter = new SDTypeParameter
            {
                Name = typeParameter.Name,
                HasDefaultConstructorConstraint = typeParameter.HasConstructorConstraint,
                HasReferenceTypeConstraint      = typeParameter.HasReferenceTypeConstraint,
                HasValueTypeConstraint          = typeParameter.HasValueTypeConstraint
            };

            foreach (var constraintType in typeParameter.ConstraintTypes)
            {
                sdTypeParameter.ConstraintTypes.Add(_typeRefParser.GetParsedTypeReference(constraintType));
            }

            return(sdTypeParameter);
        }
Example #3
0
        private void AddParsedTypeParameters(SDType sdType, IEnumerable <ITypeParameterSymbol> typeParameters)
        {
            foreach (var typeParameter in typeParameters)
            {
                var sdTypeParameter = new SDTypeParameter
                {
                    Name = typeParameter.Name,
                    HasDefaultConstructorConstraint = typeParameter.HasConstructorConstraint,
                    HasReferenceTypeConstraint      = typeParameter.HasReferenceTypeConstraint,
                    HasValueTypeConstraint          = typeParameter.HasValueTypeConstraint
                };
                foreach (var constraintType in typeParameter.ConstraintTypes)
                {
                    sdTypeParameter.ConstraintTypes.Add(_typeRefParser.GetParsedTypeReference(constraintType));
                }

                if (sdType.TypeParameters.SingleOrDefault((i => i.Name == sdTypeParameter.Name)) == null)
                {
                    sdType.TypeParameters.Add(sdTypeParameter);
                }
            }
        }
Example #4
0
        private void AddParsedTypeParameters(SDType sdType, IEnumerable <ITypeParameter> typeParameters)
        {
            foreach (var typeParameter in typeParameters)
            {
                var sdTypeParameter = new SDTypeParameter
                {
                    Name = typeParameter.Name,
                    HasDefaultConstructorConstraint = typeParameter.HasDefaultConstructorConstraint,
                    HasReferenceTypeConstraint      = typeParameter.HasReferenceTypeConstraint,
                    HasValueTypeConstraint          = typeParameter.HasValueTypeConstraint,
                    BaseClass = GetParsedType(typeParameter.EffectiveBaseClass)
                };
                foreach (var interfaceConstraint in typeParameter.EffectiveInterfaceSet)
                {
                    sdTypeParameter.Interfaces.Add(GetParsedType(interfaceConstraint));
                }

                if (sdType.TypeParameters.SingleOrDefault((i => i.Name == sdTypeParameter.Name)) == null)
                {
                    sdType.TypeParameters.Add(sdTypeParameter);
                }
            }
        }
Example #5
0
        private void AddParsedTypeParameters(SDType sdType, IEnumerable<ITypeParameterSymbol> typeParameters)
        {
            foreach (var typeParameter in typeParameters)
            {
                var sdTypeParameter = new SDTypeParameter
                {
                    Name = typeParameter.Name,
                    HasDefaultConstructorConstraint = typeParameter.HasConstructorConstraint,
                    HasReferenceTypeConstraint = typeParameter.HasReferenceTypeConstraint,
                    HasValueTypeConstraint = typeParameter.HasValueTypeConstraint
                };
                foreach (var constraintType in typeParameter.ConstraintTypes)
                {
                    sdTypeParameter.ConstraintTypes.Add(_typeRefParser.GetParsedTypeReference(constraintType));
                }

                if (sdType.TypeParameters.SingleOrDefault((i => i.Name == sdTypeParameter.Name)) == null)
                {
                    sdType.TypeParameters.Add(sdTypeParameter);
                }
            }
        }
Example #6
0
        private void AddParsedTypeParameters(SDType sdType, IEnumerable<ITypeParameter> typeParameters)
        {
            foreach (var typeParameter in typeParameters)
            {
                var sdTypeParameter = new SDTypeParameter
                {
                    Name = typeParameter.Name,
                    HasDefaultConstructorConstraint = typeParameter.HasDefaultConstructorConstraint,
                    HasReferenceTypeConstraint = typeParameter.HasReferenceTypeConstraint,
                    HasValueTypeConstraint = typeParameter.HasValueTypeConstraint,
                    BaseClass = GetParsedType(typeParameter.EffectiveBaseClass)
                };
                foreach (var interfaceConstraint in typeParameter.EffectiveInterfaceSet)
                {
                    sdTypeParameter.Interfaces.Add(GetParsedType(interfaceConstraint));
                }

                if (sdType.TypeParameters.SingleOrDefault((i => i.Name == sdTypeParameter.Name)) == null)
                {
                    sdType.TypeParameters.Add(sdTypeParameter);
                }
            }
        }