public SyntaxProperty(PropertyInfo property) { if (property == null) { throw new ArgumentNullException("property"); } DeclaringType = SyntaxType.GetType(property.DeclaringType); Name = property.Name; PropertyType = property.PropertyType; }
public bool IsAssignableFrom(SyntaxType type) { while (type != null) { if (type == this) return true; type = type.BaseType; } return false; }
public bool IsAssignableFrom(SyntaxType type) { while (type != null) { if (type == this) { return(true); } type = type.BaseType; } return(false); }
public SyntaxMethod(MethodInfo method) : this() { if (method == null) { throw new ArgumentNullException("method"); } ReturnType = SyntaxType.GetType(method.ReturnType); Name = method.Name; foreach (var parameter in method.GetParameters()) { Parameters.Add(new SyntaxParameter(parameter)); } }
private static SyntaxType GetAwaitType() { if (_awaitType == null) { _awaitType = new SyntaxType { Name = "AwaitExpressionSyntax", BaseType = SyntaxType.GetType(typeof(ExpressionSyntax)) }; _awaitType.Properties.Add(new SyntaxProperty { DeclaringType = _awaitType, Name = "Expression", PropertyType = typeof(ExpressionSyntax) }); } return _awaitType; }