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); }
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); } } }
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); } } }
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); } } }
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); } } }