예제 #1
0
        public ScriptBuilder(AssemblyLoader assemblyLoader = null)
        {
            if (assemblyLoader == null)
            {
                assemblyLoader = new InteractiveAssemblyLoader();
            }

            _assemblyNamePrefix = s_globalAssemblyNamePrefix + "#" + Interlocked.Increment(ref s_engineIdDispenser);
            _collectibleCodeManager = new CollectibleCodeManager(assemblyLoader, _assemblyNamePrefix);
            _uncollectibleCodeManager = new UncollectibleCodeManager(assemblyLoader, _assemblyNamePrefix);
        }
예제 #2
0
 public Service()
 {
     // TODO (tomat): we should share the copied files with the host
     _metadataFileProvider = new MetadataShadowCopyProvider();
     _assemblyLoader = new InteractiveAssemblyLoader(_metadataFileProvider);
     _sourceSearchPaths = DefaultSourceSearchPaths;
     _formattingOptions = new ObjectFormattingOptions(
         memberFormat: MemberDisplayFormat.Inline,
         quoteStrings: true,
         useHexadecimalNumbers: false,
         maxOutputLength: 200,
         memberIndentation: "  ");
 }
예제 #3
0
            public Service()
            {
                // TODO (tomat): we should share the copied files with the host
                _metadataFileProvider = new MetadataShadowCopyProvider(
                    Path.Combine(Path.GetTempPath(), "InteractiveHostShadow"),
                    noShadowCopyDirectories: s_systemNoShadowCopyDirectories);

                _options = ScriptOptions.Default.WithSearchPaths(DefaultReferenceSearchPaths);

                _assemblyLoader = new InteractiveAssemblyLoader(_metadataFileProvider);
                _sourceSearchPaths = DefaultSourceSearchPaths;
                _formattingOptions = new ObjectFormattingOptions(
                    memberFormat: MemberDisplayFormat.Inline,
                    quoteStrings: true,
                    useHexadecimalNumbers: false,
                    maxOutputLength: 200,
                    memberIndentation: "  ");

                // We want to be sure to delete the shadow-copied files when the process goes away. Frankly
                // there's nothing we can do if the process is forcefully quit or goes down in a completely
                // uncontrolled manner (like a stack overflow). When the process goes down in a controlled
                // manned, we should generally expect this event to be called.
                AppDomain.CurrentDomain.ProcessExit += HandleProcessExit;
            }
예제 #4
0
 internal static Script <T> CreateInitialScript <T>(ScriptCompiler compiler, SourceText sourceText, ScriptOptions optionsOpt, Type globalsTypeOpt, InteractiveAssemblyLoader assemblyLoaderOpt)
 {
     return(new Script <T>(compiler, new ScriptBuilder(assemblyLoaderOpt ?? new InteractiveAssemblyLoader()), sourceText, optionsOpt ?? ScriptOptions.Default, globalsTypeOpt, previousOpt: null));
 }
예제 #5
0
 public ScriptBuilder()
 {
     _assemblyNamePrefix = s_globalAssemblyNamePrefix + "#" + Interlocked.Increment(ref s_engineIdDispenser).ToString();
     _assemblyLoader = new InteractiveAssemblyLoader();
 }
예제 #6
0
 public ScriptBuilder()
 {
     _assemblyNamePrefix = s_globalAssemblyNamePrefix + "#" + Interlocked.Increment(ref s_engineIdDispenser).ToString();
     _assemblyLoader     = new InteractiveAssemblyLoader();
 }