예제 #1
0
 public static TypeMember Resolve <TClrType>(
     this IClrTypeResolver resolver,
     ImperativeCodeModel codeModel,
     int distance)
 {
     return(resolver.Resolve(typeof(TClrType), codeModel, distance));
 }
예제 #2
0
        protected CodeContextBase(ImperativeCodeModel codeModel, IClrTypeResolver typeResolver, LanguageInfo language)
        {
            _previousContext = Current.Value;
            Current.Value    = this;

            this.CodeModel       = codeModel;
            this.ClrTypeResolver = typeResolver;
            this.Language        = language;
        }
예제 #3
0
        public CodeModelBuilder(IEnumerable <Compilation> knownCompilations)
        {
            _codeModel    = new ImperativeCodeModel();
            _compilations = WithReferencedCompilations(knownCompilations.ToArray()).ToImmutableArray();

            _compilationBySyntaxTree = _compilations
                                       .SelectMany(
                compilation => compilation.SyntaxTrees
                .Select(tree => new KeyValuePair <SyntaxTree, Compilation>(tree, compilation)))
                                       .ToImmutableDictionary(kvp => kvp.Key, kvp => kvp.Value);
        }
예제 #4
0
 public CodeReaderContext(ImperativeCodeModel codeModel, IClrTypeResolver clrTypeResolver, LanguageInfo language)
     : base(codeModel, clrTypeResolver, language)
 {
 }
예제 #5
0
 public static TypeMember CloseType(this ImperativeCodeModel model, Type openType, params TypeMember[] typeArguments)
 {
     return(model.Get <TypeMember>(openType).MakeGenericType(typeArguments));
 }
예제 #6
0
 public static TypeMember Type <TClrType>(this ImperativeCodeModel model)
 {
     return(model.Get <TypeMember>(typeof(TClrType)));
 }