aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Scripting/ExpressionGenerator.cs
blob: 8db917a100fb4e423da6becd55cd8ae0add79717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using Microsoft.CodeAnalysis.CSharp.Scripting;
using Microsoft.CodeAnalysis.Scripting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Tango.Scripting
{
    public static class ExpressionGenerator
    {
        public static Func<T, bool> GenerateExpression<T>(String body, params Assembly[] assemblies)
        {
            var options = ScriptOptions.Default.AddReferences(assemblies);
            Func<T, bool> func = CSharpScript.EvaluateAsync<Func<T, bool>>(body, options).Result;
            return func;
        }
    }
}
ad_loading_response__descriptor) \ } /* ContinueThreadLoadingResponse methods */ void continue_thread_loading_response__init (ContinueThreadLoadingResponse *message); size_t continue_thread_loading_response__get_packed_size (const ContinueThreadLoadingResponse *message); size_t continue_thread_loading_response__pack (const ContinueThreadLoadingResponse *message, uint8_t *out); size_t continue_thread_loading_response__pack_to_buffer (const ContinueThreadLoadingResponse *message, ProtobufCBuffer *buffer); ContinueThreadLoadingResponse * continue_thread_loading_response__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void continue_thread_loading_response__free_unpacked (ContinueThreadLoadingResponse *message, ProtobufCAllocator *allocator); /* --- per-message closures --- */ typedef void (*ContinueThreadLoadingResponse_Closure) (const ContinueThreadLoadingResponse *message, void *closure_data); /* --- services --- */ /* --- descriptors --- */ extern const ProtobufCMessageDescriptor continue_thread_loading_response__descriptor; PROTOBUF_C__END_DECLS #endif /* PROTOBUF_C_ContinueThreadLoadingResponse_2eproto__INCLUDED */