/// <summary> /// Creates a property reference on a type. /// </summary> /// <param name="type">The type.</param> /// <param name="propertyName">The name of the property.</param> /// <returns>A property reference.</returns> public static CodePropertyReferenceExpression PropertyReference(this Type type, string propertyName) { return type.AsExpression().PropertyReference(propertyName); }
/// <summary> /// Creates a method reference on a type. /// </summary> /// <param name="type">The type.</param> /// <param name="methodName">The name of the method.</param> /// <returns>A method reference.</returns> public static CodeMethodReferenceExpression MethodReference(this Type type, string methodName) { return type.AsExpression().MethodReference(methodName); }
/// <summary> /// Creates a method reference on a type. /// </summary> /// <param name="type">The type.</param> /// <param name="methodName">The name of the method.</param> /// <param name="typeParameters">The type parameters.</param> /// <returns>A method reference.</returns> public static CodeMethodReferenceExpression MethodReference(this Type type, string methodName, params CodeTypeReference[] typeParameters) { return type.AsExpression().MethodReference(methodName, typeParameters); }
/// <summary> /// Creates a method invocation on a given type. /// </summary> /// <param name="type">The type.</param> /// <param name="methodDeclaration">The declaration of the method.</param> /// <param name="parameters">The parameters for the method.</param> /// <returns>A method invocation.</returns> public static CodeMethodInvokeExpression Invoke(this Type type, CodeMemberMethod methodDeclaration, params CodeExpression[] parameters) { return type.AsExpression().Reference(methodDeclaration).Invoke(parameters); }
/// <summary> /// Creates a method invocation on a type. /// </summary> /// <param name="type">The type.</param> /// <param name="methodName">The name of the method to invoke.</param> /// <param name="parameters">The parameters for method.</param> /// <returns>A method invocation.</returns> public static CodeMethodInvokeExpression Invoke(this Type type, string methodName, params CodeExpression[] parameters) { return type.AsExpression().Invoke(methodName, parameters); }
/// <summary> /// Creates an indexer reference on a type. /// </summary> /// <param name="type">The type.</param> /// <param name="indexes">The indexes that reference an element.</param> /// <returns>An indexer reference expression.</returns> public static CodeIndexerExpression IndexerReference(this Type type, params CodeExpression[] indexes) { return type.AsExpression().IndexerReference(indexes); }
/// <summary> /// Creates a field reference on a type. /// </summary> /// <param name="type">The type.</param> /// <param name="fieldName">The name of the field.</param> /// <returns>A field reference.</returns> public static CodeFieldReferenceExpression FieldReference(this Type type, string fieldName) { return type.AsExpression().FieldReference(fieldName); }
/// <summary> /// Creates a event reference on a type. /// </summary> /// <param name="type">The type.</param> /// <param name="eventName">The name of the event.</param> /// <returns>An event reference.</returns> public static CodeEventReferenceExpression EventReference(this Type type, string eventName) { return type.AsExpression().EventReference(eventName); }