GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — scriptcs/src/ScriptCs.Core/ScriptExecutorExtensions.cs at dev · scriptcs/scriptcs

Expand file tree

/

ScriptExecutorExtensions.cs

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
54 lines (42 loc) · 1.76 KB
/

ScriptExecutorExtensions.cs

Copy path

File metadata and controls

54 lines (42 loc) · 1.76 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ScriptCs.Contracts;
namespace ScriptCs
{
public static class ScriptExecutorExtensions
{
public static void ImportNamespaces(this IScriptExecutor executor, params Type[] typesFromReferencedAssembly)
{
Guard.AgainstNullArgument("executor", executor);
Guard.AgainstNullArgument("typesFromReferencedAssembly", typesFromReferencedAssembly);
var namespaces = typesFromReferencedAssembly.Select(t => t.Namespace);
executor.ImportNamespaces(namespaces.ToArray());
}
public static void ImportNamespace<T>(this IScriptExecutor executor)
{
Guard.AgainstNullArgument("executor", executor);
executor.ImportNamespaces(typeof(T));
}
public static void AddReferences(this IScriptExecutor executor, params Type[] typesFromReferencedAssembly)
{
Guard.AgainstNullArgument("executor", executor);
Guard.AgainstNullArgument("typeFromReferencedAssembly", typesFromReferencedAssembly);
var paths = typesFromReferencedAssembly.Select(t => t.Assembly.Location);
executor.AddReferences(paths.ToArray());
}
public static void AddReference<T>(this IScriptExecutor executor)
{
Guard.AgainstNullArgument("executor", executor);
executor.AddReferences(typeof(T));
}
public static void AddReferenceAndImportNamespaces(this IScriptExecutor executor, Type[] types)
{
Guard.AgainstNullArgument("executor", executor);
executor.AddReferences(types);
executor.ImportNamespaces(types);
}
}
}
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.