Beispiel #1
0
 public static string WrapTypeName(DebugType type)
 {
     if (type.IsArray)
     {
         if (WorkbenchServiceFactory.DebuggerManager.parser != null)
         {
             return(WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetArrayDescription(WrapTypeName(type.GetElementType()), type.GetArrayRank()));
         }
         else
         {
             return("array of " + WrapTypeName(type.GetElementType()));
         }
     }
     return(internalWrapTypeName(type.FullName));
 }
        public static IndexerExpression AppendIndexer(this Expression expression, params int[] indices)
        {
            IndexerExpression indexerExpr = new IndexerExpression(Parenthesize(expression), new List <Expression>());

            foreach (int index in indices)
            {
                indexerExpr.Indexes.Add(new PrimitiveExpression(index));
            }
            DebugType staticType = expression.GetStaticType();

            if (staticType != null && staticType.IsArray)
            {
                indexerExpr.SetStaticType((DebugType)staticType.GetElementType());
            }
            if (staticType != null && staticType.FullNameWithoutGenericArguments == typeof(List <>).FullName)
            {
                indexerExpr.SetStaticType((DebugType)staticType.GetGenericArguments()[0]);
            }
            return(indexerExpr);
        }