Exemplo n.º 1
0
 /// <summary>
 /// Create a statementLine using the given member data.
 /// </summary>
 /// <returns>Returns the generated CodeStatement.</returns>
 public CodeExpression CreateExpression()
 {
     return(Parameters != null
         ? new CodeDelegateInvokeExpression(TargetObject.CreateExpression(),
                                            Parameters.Select(p => p.CreateExpression()).ToArray())
         : new CodeDelegateInvokeExpression(TargetObject.CreateExpression()));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Create a statementLine using the given member data.
        /// </summary>
        /// <returns>Returns the generated CodeStatement.</returns>
        public CodeExpression CreateExpression()
        {
            if (Types == null)
            {
                return(new CodeMethodReferenceExpression(TargetObject.CreateExpression(), MethodName));
            }
            var typeParameters = Types.Select(t => new CodeTypeReference(t)).ToArray();

            return(new CodeMethodReferenceExpression(TargetObject.CreateExpression(), MethodName, typeParameters));
        }
Exemplo n.º 3
0
 /// <summary>
 /// CreateExpression generates a CodeExpression based on the given member data.
 /// </summary>
 /// <returns>Generated CodeExpression.</returns>
 public CodeExpression CreateExpression()
 {
     return(new CodeArrayIndexerExpression(TargetObject.CreateExpression(),
                                           Indices.Select(i => i.CreateExpression()).ToArray()));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create a statementLine using the given member data.
 /// </summary>
 /// <returns>Returns the generated CodeStatement.</returns>
 public CodeExpression CreateExpression()
 {
     return(new CodePropertyReferenceExpression(TargetObject.CreateExpression(), PropertyName));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Create a statementLine using the given member data.
 /// </summary>
 /// <returns>Returns the generated CodeStatement.</returns>
 public CodeExpression CreateExpression()
 {
     return(new CodeMethodInvokeExpression(TargetObject.CreateExpression(), MethodName,
                                           Parameters.Select(p => p.CreateExpression()).ToArray()));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Create a statementLine using the given member data.
 /// </summary>
 /// <returns>Returns the generated CodeStatement.</returns>
 public CodeExpression CreateExpression()
 {
     return(new CodeFieldReferenceExpression(TargetObject.CreateExpression(), FieldName));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Create a statementLine using the given member data.
 /// </summary>
 /// <returns>Returns the generated CodeStatement.</returns>
 public CodeExpression CreateExpression()
 {
     return(new CodeEventReferenceExpression(TargetObject.CreateExpression(), EventName));
 }
Exemplo n.º 8
0
        /// <summary>
        /// Create a statementLine using the given member data.
        /// </summary>
        /// <returns>Returns the generated CodeStatement.</returns>
        public CodeExpression CreateExpression()
        {
            var delegateType = new CodeTypeReference(Type);

            return(new CodeDelegateCreateExpression(delegateType, TargetObject.CreateExpression(), MethodeName));
        }