예제 #1
0
 /// <summary>
 /// 转换表达式
 /// </summary>
 /// <param name="converter">表达式转换器</param>
 /// <param name="expression">表达式</param>
 /// <param name="name">成员名称</param>
 private void convertMemberAccess(converter converter, MemberExpression memberExpression, string name)
 {
     if (memberExpression.Expression.GetType() == typeof(ParameterExpression))
     {
         if (converter.parameterMemberNames.indexOf(name) == -1)
         {
             converter.parameterMemberNames = converter.parameterMemberNames.add(name);
         }
         charStream stream = converter.Stream;
         if (converter.NameType != converter.getNameType.None)
         {
             stream.Write(converter.Name ?? converter.GetName(((ParameterExpression)memberExpression.Expression).Name));
             stream.Write('.');
         }
         stream.Write(name);
     }
     else
     {
         fastCSharp.log.Default.Throw("未知成员表达式类型 " + memberExpression.Expression.GetType().Name, false, true);
     }
 }
예제 #2
0
 /// <summary>
 /// 转换表达式
 /// </summary>
 /// <param name="converter">表达式转换器</param>
 /// <param name="expression">表达式</param>
 /// <param name="name">成员名称</param>
 private void convertMemberAccess(converter converter, MemberExpression memberExpression, string name)
 {
     if (memberExpression.Expression.GetType() == typeof(ParameterExpression))
     {
         if (converter.parameterMemberNames.indexOf(name) == -1)
         {
             converter.parameterMemberNames = converter.parameterMemberNames.add(name);
         }
         charStream stream = converter.Stream;
         if (converter.NameType != converter.getNameType.None)
         {
             stream.Write(converter.Name ?? converter.GetName(((ParameterExpression)memberExpression.Expression).Name));
             stream.Write('.');
         }
         stream.Write(name);
     }
     else fastCSharp.log.Default.Throw("未知成员表达式类型 " + memberExpression.Expression.GetType().Name, false, true);
 }