コード例 #1
0
ファイル: ScriptBuilder.cs プロジェクト: JinGuoGe/roslyn
        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
ファイル: ScriptBuilder.cs プロジェクト: daking2014/roslyn
 public ScriptBuilder()
 {
     _assemblyNamePrefix = s_globalAssemblyNamePrefix + "#" + Interlocked.Increment(ref s_engineIdDispenser).ToString();
     _assemblyLoader = new InteractiveAssemblyLoader();
 }
コード例 #6
0
ファイル: ScriptBuilder.cs プロジェクト: tang7526/roslyn
 public ScriptBuilder()
 {
     _assemblyNamePrefix = s_globalAssemblyNamePrefix + "#" + Interlocked.Increment(ref s_engineIdDispenser).ToString();
     _assemblyLoader     = new InteractiveAssemblyLoader();
 }