예제 #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;
        }
예제 #2
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);
        }
예제 #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);
                }
            }
        }
예제 #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);
                }
            }
        }
예제 #5
0
파일: TypeParser.cs 프로젝트: Geaz/sharpDox
        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);
                }
            }
        }
예제 #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);
                }
            }
        }