Пример #1
0
        public override void TranslateDictionaryKeys(StringBuilder sb, Expression dictionary)
        {
            sb.Append("TranslationHelper.convert");
            switch (dictionary.ResolvedType.Generics[0].RootValue)
            {
            case "int": sb.Append("Integer"); break;

            case "string": sb.Append("String"); break;

            default:
                TODO.ExplicitlyDisallowThisAtCompileTime();
                throw new NotImplementedException();
            }
            sb.Append("SetToArray(");
            this.TranslateExpression(sb, dictionary);
            sb.Append(".keySet())");

            // TODO: do a simple .keySet().toArray(TranslationHelper.STATIC_INSTANCE_OF_ZERO_LENGTH_INT_OR_STRING_ARRAY);
        }