コード例 #1
0
 public ServiceState(InteractiveAssemblyLoader assemblyLoader, MetadataShadowCopyProvider metadataFileProvider, ReplServiceProvider replServiceProvider, InteractiveScriptGlobals globals)
 {
     AssemblyLoader       = assemblyLoader;
     MetadataFileProvider = metadataFileProvider;
     ReplServiceProvider  = replServiceProvider;
     Globals = globals;
 }
コード例 #2
0
            public void Initialize(Type replServiceProviderType, string cultureName)
            {
                Debug.Assert(replServiceProviderType != null);
                Debug.Assert(cultureName != null);

                Debug.Assert(_metadataFileProvider == null);
                Debug.Assert(_assemblyLoader == null);
                Debug.Assert(_replServiceProvider == null);

                // TODO (tomat): we should share the copied files with the host
                _metadataFileProvider = new MetadataShadowCopyProvider(
                    Path.Combine(Path.GetTempPath(), "InteractiveHostShadow"),
                    noShadowCopyDirectories: s_systemNoShadowCopyDirectories,
                    documentationCommentsCulture: new CultureInfo(cultureName));

                _assemblyLoader = new InteractiveAssemblyLoader(_metadataFileProvider);

                _replServiceProvider = (ReplServiceProvider)Activator.CreateInstance(replServiceProviderType);
            }
コード例 #3
0
            public void Initialize(Type replServiceProviderType)
            {
                Contract.ThrowIfNull(replServiceProviderType);

                _replServiceProvider = (ReplServiceProvider)Activator.CreateInstance(replServiceProviderType);

                _hostObject = new InteractiveHostObject();

                var options = ScriptOptions.Default
                              .WithSearchPaths(DefaultReferenceSearchPaths)
                              .WithBaseDirectory(Directory.GetCurrentDirectory())
                              .AddReferences(_hostObject.GetType().Assembly);

                _sourceSearchPaths = DefaultSourceSearchPaths;

                _hostObject.ReferencePaths.AddRange(options.SearchPaths);
                _hostObject.SourcePaths.AddRange(_sourceSearchPaths);
                _lastTask = Task.FromResult(new TaskResult(options, null));

                Console.OutputEncoding = Encoding.UTF8;
            }
コード例 #4
0
 public void Initialize(Type replServiceProviderType)
 {
     Contract.ThrowIfNull(replServiceProviderType);
     _replServiceProvider = (ReplServiceProvider)Activator.CreateInstance(replServiceProviderType);
 }