public CodegenClassBaseList AssignBaseType(string baseTypeName) { if (!string.IsNullOrWhiteSpace(baseTypeName)) { BaseType = new CodegenTypeReference(baseTypeName); } return(this); }
protected bool Equals(CodegenTypeReference other) { if (_type != null) { return(other._type != null ? _type == other._type : Equals(_type.FullName, other._typeName)); } return(Equals( _typeName, other._type != null ? other._type.FullName : other._typeName)); }
public CodegenClassBaseList AssignType(Type baseType) { if (baseType != null) { if (baseType.IsInterface) { Interfaces.Add(new CodegenTypeReference(baseType)); } else { BaseType = new CodegenTypeReference(baseType); } } return(this); }
public CodegenClassBaseList AddInterface(Type interfaceType) { if (interfaceType == null) { throw new ArgumentNullException(nameof(interfaceType)); } if (!interfaceType.IsInterface) { throw new ArgumentException("interfaceType type is not an interface", nameof(interfaceType)); } var typeReference = new CodegenTypeReference(interfaceType); if (!Interfaces.Contains(typeReference)) { Interfaces.Add(typeReference); } return(this); }