├── .dockerignore
├── .editorconfig
├── .gitattributes
├── .github
└── workflows
│ └── dotnet-ci.yml
├── .gitignore
├── Directory.Build.props
├── Directory.Packages.props
├── NatashaPad.slnx
├── README.md
├── Roadmap.md
├── resources
└── NatashaPad-Intro.gif
├── src
├── .gitignore
├── NatashaPad.Core
│ ├── DumpOutHelper.cs
│ ├── Dumper.cs
│ ├── DumperResolver.cs
│ ├── NatashaPad.Core.csproj
│ ├── ScriptEngine.cs
│ └── ScriptOptions.cs
├── NatashaPad.Mvvm
│ ├── DefaultViewContainer.cs
│ ├── IViewContainer.cs
│ ├── MessageBox
│ │ ├── DefaultErrorMessageBoxService.cs
│ │ ├── IMessageBoxServiceProvider.cs
│ │ └── MessageBoxServiceExtensions.cs
│ ├── NatashaPad.Mvvm.csproj
│ ├── Properties
│ │ ├── Resource.Designer.cs
│ │ └── Resource.resx
│ ├── ViewContainerOptions.cs
│ ├── ViewLocatorExtensions.cs
│ └── Windows
│ │ ├── DefaultCurrentWindowService.cs
│ │ ├── DefaultDialogService.cs
│ │ ├── DefaultWindowManager.cs
│ │ ├── DefaultWindowProvider.cs
│ │ ├── IWindowProvider.cs
│ │ └── IWindowService.cs
└── NatashaPad
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Mvvm
│ ├── CollectionItem.cs
│ └── RemovableCollection.cs
│ ├── NatashaPad.csproj
│ ├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resource.Designer.cs
│ └── Resource.resx
│ ├── Themes
│ ├── Common.TextBlock.xaml
│ ├── Common.xaml
│ └── DialogStyles.xaml
│ ├── ViewModels
│ ├── Base
│ │ ├── DialogViewModelBase.cs
│ │ └── ViewModelBase.cs
│ ├── CommonParam.cs
│ ├── MainViewModel.cs
│ ├── NugetManageViewModel.cs
│ ├── Package.cs
│ └── UsingManageViewModel.cs
│ └── Views
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── NugetManageView.xaml
│ ├── NugetManageView.xaml.cs
│ ├── UsingManageView.xaml
│ └── UsingManageView.xaml.cs
└── test
└── NatashaPad.Test
├── DumperTest.cs
├── NatashaPad.Test.csproj
└── ScriptEngineTest.cs
/.dockerignore:
--------------------------------------------------------------------------------
1 | **/.classpath
2 | **/.dockerignore
3 | **/.env
4 | **/.git
5 | **/.gitignore
6 | **/.project
7 | **/.settings
8 | **/.toolstarget
9 | **/.vs
10 | **/.vscode
11 | **/*.*proj.user
12 | **/*.dbmdl
13 | **/*.jfm
14 | **/azds.yaml
15 | **/bin
16 | **/charts
17 | **/docker-compose*
18 | **/Dockerfile*
19 | **/node_modules
20 | **/npm-debug.log
21 | **/obj
22 | **/secrets.dev.yaml
23 | **/values.dev.yaml
24 | LICENSE
25 | README.md
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome:http://EditorConfig.org
2 |
3 | # top-most EditorConfig file
4 | root = true
5 |
6 | # Don't use tabs for indentation.
7 | [*]
8 | indent_style = space
9 | # (Please don't specify an indent_size here; that has too many unintended consequences.)
10 |
11 | # Code files
12 | [*.{cs,csx,vb,vbx}]
13 | indent_size = 4
14 | insert_final_newline = true
15 | charset = utf-8-bom
16 |
17 | # Xml project files
18 | [*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
19 | indent_size = 2
20 |
21 | # Xml config files
22 | [*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
23 | indent_size = 2
24 |
25 | # JSON files
26 | [*.json]
27 | indent_size = 2
28 |
29 | # Dotnet code style settings:
30 | [*.{cs,vb}]
31 | # File header
32 | file_header_template = Copyright (c) NatashaPad. All rights reserved.\nLicensed under the Apache license.
33 |
34 | # Sort using and Import directives with System.* appearing first
35 | dotnet_sort_system_directives_first = false
36 | # Avoid "this." and "Me." if not necessary
37 | dotnet_style_qualification_for_field = false:suggestion
38 | dotnet_style_qualification_for_property = false:suggestion
39 | dotnet_style_qualification_for_method = false:suggestion
40 | dotnet_style_qualification_for_event = false:suggestion
41 |
42 | # Use language keywords instead of framework type names for type references
43 | dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
44 | dotnet_style_predefined_type_for_member_access = true:suggestion
45 |
46 | # Suggest more modern language features when available
47 | dotnet_style_object_initializer = true:suggestion
48 | dotnet_style_collection_initializer = true:suggestion
49 | dotnet_style_coalesce_expression = true:suggestion
50 | dotnet_style_null_propagation = true:suggestion
51 | dotnet_style_explicit_tuple_names = true:suggestion
52 |
53 | # CSharp code style settings:
54 | [*.cs]
55 | # namespace style
56 | csharp_style_namespace_declarations=file_scoped:warning
57 |
58 | # Prefer "var" everywhere
59 | csharp_style_var_for_built_in_types = true:suggestion
60 | csharp_style_var_when_type_is_apparent = true:suggestion
61 | csharp_style_var_elsewhere = true:suggestion
62 |
63 | # Prefer method-like constructs to have a block body
64 | csharp_style_expression_bodied_methods = false:none
65 | csharp_style_expression_bodied_constructors = false:none
66 | csharp_style_expression_bodied_operators = false:none
67 |
68 | # Prefer property-like constructs to have an expression-body
69 | csharp_style_expression_bodied_properties = true:none
70 | csharp_style_expression_bodied_indexers = true:none
71 | csharp_style_expression_bodied_accessors = true:none
72 |
73 | # Suggest more modern language features when available
74 | csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
75 | csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
76 | csharp_style_inlined_variable_declaration = true:suggestion
77 | csharp_style_throw_expression = true:suggestion
78 | csharp_style_conditional_delegate_call = true:suggestion
79 |
80 | # Newline settings
81 | csharp_new_line_before_open_brace = all
82 | csharp_new_line_before_else = true
83 | csharp_new_line_before_catch = true
84 | csharp_new_line_before_finally = true
85 | csharp_new_line_before_members_in_object_initializers = true
86 | csharp_new_line_before_members_in_anonymous_types = true
87 |
88 | # Fix formatting, https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#rule-id-ide0055-fix-formatting
89 | dotnet_diagnostic.IDE00055.severity = warning
90 | # Remove unnecessary usings, https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0005
91 | dotnet_diagnostic.IDE0005.severity = warning
92 | # File header template
93 | dotnet_diagnostic.IDE0073.severity = warning
94 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | *.sh text eol=lf
7 | *.ps1 text eol=crlf
8 |
9 | ###############################################################################
10 | # Set default behavior for command prompt diff.
11 | #
12 | # This is need for earlier builds of msysgit that does not have it on by
13 | # default for csharp files.
14 | # Note: This is only used by command line
15 | ###############################################################################
16 | #*.cs diff=csharp
17 |
18 | ###############################################################################
19 | # Set the merge driver for project and solution files
20 | #
21 | # Merging from the command prompt will add diff markers to the files if there
22 | # are conflicts (Merging from VS is not affected by the settings below, in VS
23 | # the diff markers are never inserted). Diff markers may cause the following
24 | # file extensions to fail to load in VS. An alternative would be to treat
25 | # these files as binary and thus will always conflict and require user
26 | # intervention with every merge. To do so, just uncomment the entries below
27 | ###############################################################################
28 | #*.sln merge=binary
29 | #*.csproj merge=binary
30 | #*.vbproj merge=binary
31 | #*.vcxproj merge=binary
32 | #*.vcproj merge=binary
33 | #*.dbproj merge=binary
34 | #*.fsproj merge=binary
35 | #*.lsproj merge=binary
36 | #*.wixproj merge=binary
37 | #*.modelproj merge=binary
38 | #*.sqlproj merge=binary
39 | #*.wwaproj merge=binary
40 |
41 | ###############################################################################
42 | # behavior for image files
43 | #
44 | # image files are treated as binary by default.
45 | ###############################################################################
46 | #*.jpg binary
47 | #*.png binary
48 | #*.gif binary
49 |
50 | ###############################################################################
51 | # diff behavior for common document formats
52 | #
53 | # Convert binary document formats to text before diffing them. This feature
54 | # is only available from the command line. Turn it on by uncommenting the
55 | # entries below.
56 | ###############################################################################
57 | #*.doc diff=astextplain
58 | #*.DOC diff=astextplain
59 | #*.docx diff=astextplain
60 | #*.DOCX diff=astextplain
61 | #*.dot diff=astextplain
62 | #*.DOT diff=astextplain
63 | #*.pdf diff=astextplain
64 | #*.PDF diff=astextplain
65 | #*.rtf diff=astextplain
66 | #*.RTF diff=astextplain
67 |
--------------------------------------------------------------------------------
/.github/workflows/dotnet-ci.yml:
--------------------------------------------------------------------------------
1 | name: dotnet-ci
2 |
3 | # Trigger the workflow on push or pull request
4 | on: [push, pull_request]
5 |
6 | jobs:
7 | build:
8 |
9 | runs-on: windows-latest
10 |
11 | steps:
12 | - uses: actions/checkout@v4
13 | - name: Setup .NET SDK
14 | uses: actions/setup-dotnet@v4
15 | with:
16 | dotnet-version: 9.0.x
17 | - name: dotnet info
18 | run: dotnet --info
19 | - name: build
20 | run: dotnet build
21 | - name: test
22 | run: dotnet test
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # Cutom files
7 | localBuild/
8 |
9 | # User-specific files
10 | *.suo
11 | *.user
12 | *.userosscache
13 | *.sln.docstates
14 |
15 | # User-specific files (MonoDevelop/Xamarin Studio)
16 | *.userprefs
17 |
18 | # Build results
19 | [Dd]ebug/
20 | [Dd]ebugPublic/
21 | [Rr]elease/
22 | [Rr]eleases/
23 | x64/
24 | x86/
25 | bld/
26 | [Bb]in/
27 | [Oo]bj/
28 | [Ll]og/
29 | [Oo]ut/
30 |
31 | # Visual Studio 2015 cache/options directory
32 | .vs/
33 | # Uncomment if you have tasks that create the project's static files in wwwroot
34 | #wwwroot/
35 |
36 | # MSTest test Results
37 | [Tt]est[Rr]esult*/
38 | [Bb]uild[Ll]og.*
39 |
40 | # NUNIT
41 | *.VisualState.xml
42 | TestResult.xml
43 |
44 | # Build Results of an ATL Project
45 | [Dd]ebugPS/
46 | [Rr]eleasePS/
47 | dlldata.c
48 |
49 | # .NET Core
50 | project.lock.json
51 | project.fragment.lock.json
52 | artifacts/
53 | **/Properties/launchSettings.json
54 |
55 | *_i.c
56 | *_p.c
57 | *_i.h
58 | *.ilk
59 | *.meta
60 | *.obj
61 | *.pch
62 | *.pdb
63 | *.pgc
64 | *.pgd
65 | *.rsp
66 | *.sbr
67 | *.tlb
68 | *.tli
69 | *.tlh
70 | *.tmp
71 | *.tmp_proj
72 | *.log
73 | *.vspscc
74 | *.vssscc
75 | .builds
76 | *.pidb
77 | *.svclog
78 | *.scc
79 |
80 | # Chutzpah Test files
81 | _Chutzpah*
82 |
83 | # Visual C++ cache files
84 | ipch/
85 | *.aps
86 | *.ncb
87 | *.opendb
88 | *.opensdf
89 | *.sdf
90 | *.cachefile
91 | *.VC.db
92 | *.VC.VC.opendb
93 |
94 | # Visual Studio profiler
95 | *.psess
96 | *.vsp
97 | *.vspx
98 | *.sap
99 |
100 | # TFS 2012 Local Workspace
101 | $tf/
102 |
103 | # Guidance Automation Toolkit
104 | *.gpState
105 |
106 | # ReSharper is a .NET coding add-in
107 | _ReSharper*/
108 | *.[Rr]e[Ss]harper
109 | *.DotSettings.user
110 |
111 | # JustCode is a .NET coding add-in
112 | .JustCode
113 |
114 | # TeamCity is a build add-in
115 | _TeamCity*
116 |
117 | # DotCover is a Code Coverage Tool
118 | *.dotCover
119 |
120 | # Visual Studio code coverage results
121 | *.coverage
122 | *.coveragexml
123 |
124 | # NCrunch
125 | _NCrunch_*
126 | .*crunch*.local.xml
127 | nCrunchTemp_*
128 |
129 | # MightyMoose
130 | *.mm.*
131 | AutoTest.Net/
132 |
133 | # Web workbench (sass)
134 | .sass-cache/
135 |
136 | # Installshield output folder
137 | [Ee]xpress/
138 |
139 | # DocProject is a documentation generator add-in
140 | DocProject/buildhelp/
141 | DocProject/Help/*.HxT
142 | DocProject/Help/*.HxC
143 | DocProject/Help/*.hhc
144 | DocProject/Help/*.hhk
145 | DocProject/Help/*.hhp
146 | DocProject/Help/Html2
147 | DocProject/Help/html
148 |
149 | # Click-Once directory
150 | publish/
151 |
152 | # Publish Web Output
153 | *.[Pp]ublish.xml
154 | *.azurePubxml
155 | # TODO: Comment the next line if you want to checkin your web deploy settings
156 | # but database connection strings (with potential passwords) will be unencrypted
157 | *.pubxml
158 | *.publishproj
159 |
160 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
161 | # checkin your Azure Web App publish settings, but sensitive information contained
162 | # in these scripts will be unencrypted
163 | PublishScripts/
164 |
165 | # NuGet Packages
166 | *.nupkg
167 | # The packages folder can be ignored because of Package Restore
168 | **/packages/*
169 | # except build/, which is used as an MSBuild target.
170 | !**/packages/build/
171 | # Uncomment if necessary however generally it will be regenerated when needed
172 | #!**/packages/repositories.config
173 | # NuGet v3's project.json files produces more ignorable files
174 | *.nuget.props
175 | *.nuget.targets
176 |
177 | # Microsoft Azure Build Output
178 | csx/
179 | *.build.csdef
180 |
181 | # Microsoft Azure Emulator
182 | ecf/
183 | rcf/
184 |
185 | # Windows Store app package directories and files
186 | AppPackages/
187 | BundleArtifacts/
188 | Package.StoreAssociation.xml
189 | _pkginfo.txt
190 |
191 | # Visual Studio cache files
192 | # files ending in .cache can be ignored
193 | *.[Cc]ache
194 | # but keep track of directories ending in .cache
195 | !*.[Cc]ache/
196 |
197 | # Others
198 | ClientBin/
199 | ~$*
200 | *~
201 | *.dbmdl
202 | *.dbproj.schemaview
203 | *.jfm
204 | *.pfx
205 | *.publishsettings
206 | orleans.codegen.cs
207 |
208 | # Since there are multiple workflows, uncomment next line to ignore bower_components
209 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
210 | #bower_components/
211 |
212 | # RIA/Silverlight projects
213 | Generated_Code/
214 |
215 | # Backup & report files from converting an old project file
216 | # to a newer Visual Studio version. Backup files are not needed,
217 | # because we have git ;-)
218 | _UpgradeReport_Files/
219 | Backup*/
220 | UpgradeLog*.XML
221 | UpgradeLog*.htm
222 |
223 | # SQL Server files
224 | *.mdf
225 | *.ldf
226 | *.ndf
227 |
228 | # Business Intelligence projects
229 | *.rdl.data
230 | *.bim.layout
231 | *.bim_*.settings
232 |
233 | # Microsoft Fakes
234 | FakesAssemblies/
235 |
236 | # GhostDoc plugin setting file
237 | *.GhostDoc.xml
238 |
239 | # Node.js Tools for Visual Studio
240 | .ntvs_analysis.dat
241 | node_modules/
242 |
243 | # Typescript v1 declaration files
244 | typings/
245 |
246 | # Visual Studio 6 build log
247 | *.plg
248 |
249 | # Visual Studio 6 workspace options file
250 | *.opt
251 |
252 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
253 | *.vbw
254 |
255 | # Visual Studio LightSwitch build output
256 | **/*.HTMLClient/GeneratedArtifacts
257 | **/*.DesktopClient/GeneratedArtifacts
258 | **/*.DesktopClient/ModelManifest.xml
259 | **/*.Server/GeneratedArtifacts
260 | **/*.Server/ModelManifest.xml
261 | _Pvt_Extensions
262 |
263 | # Paket dependency manager
264 | .paket/paket.exe
265 | paket-files/
266 |
267 | # FAKE - F# Make
268 | .fake/
269 |
270 | # JetBrains Rider
271 | .idea/
272 | *.sln.iml
273 |
274 | # CodeRush
275 | .cr/
276 |
277 | # Python Tools for Visual Studio (PTVS)
278 | __pycache__/
279 | *.pyc
280 |
281 | # Cake - Uncomment if you are using it
282 | tools/**
283 | build/tools/**
284 |
285 | # Telerik's JustMock configuration file
286 | *.jmconfig
287 |
288 | # BizTalk build output
289 | *.btp.cs
290 | *.btm.cs
291 | *.odx.cs
292 | *.xsd.cs
293 |
--------------------------------------------------------------------------------
/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | 0
4 | 1
5 | 0
6 | $(VersionMajor).$(VersionMinor).$(VersionPatch)
7 | develop
8 |
9 |
10 | net9.0
11 | preview
12 | enable
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Directory.Packages.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | 4.13.0
5 | true
6 | direct
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/NatashaPad.slnx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NatashaPad
2 |
3 | ## Intro
4 |
5 | [](https://github.com/night-moon-studio/NatashaPad/actions/workflows/dotnet-ci.yml)
6 | [](https://app.fossa.com/projects/git%2Bgithub.com%2Fnight-moon-studio%2FNatashaPad?ref=badge_shield)
7 |
8 | Another dotnet debug tool like LinqPad and dotnet fiddle, powered by Roslyn and Natasha
9 |
10 | 
11 |
12 |
13 |
14 | ## Contributing
15 |
16 | [](https://github.com/night-moon-studio/NatashaPad/pulls)
17 |
18 | If you'd like to contribute, just create a [Pull Request](https://github.com/night-moon-studio/NatashaPad/pulls), or give us [Bug Report](https://github.com/night-moon-studio/NatashaPad/issues/new).
19 |
20 | Thanks for our contributors.
21 |
22 |
23 | ## Acknowledgements
24 |
25 | - [Roslyn](https://github.com/dotnet/roslyn)
26 | - [Natasha](https://github.com/dotnetcore/Natasha)
27 |
28 |
29 | ## License
30 | [](https://app.fossa.com/projects/git%2Bgithub.com%2Fnight-moon-studio%2FNatashaPad?ref=badge_large)
31 |
--------------------------------------------------------------------------------
/Roadmap.md:
--------------------------------------------------------------------------------
1 | # NatashaPad RoadMap
2 |
3 | ## Core
4 |
5 | - [x] Nuget Reference Support
6 |
7 | ## Editor features
8 |
9 | - [ ] Better Output Design and exception handle
10 | - [ ] AutoComplete
11 | - [ ] Debug support
12 |
13 | ## Extensions
14 |
15 | - [ ] Blazor ui client
16 |
--------------------------------------------------------------------------------
/resources/NatashaPad-Intro.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/night-moon-studio/NatashaPad/4212b263c2258ff8b311b76c50683af00c08f6d1/resources/NatashaPad-Intro.gif
--------------------------------------------------------------------------------
/src/.gitignore:
--------------------------------------------------------------------------------
1 | NatashaPad.Web
--------------------------------------------------------------------------------
/src/NatashaPad.Core/DumpOutHelper.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) NatashaPad. All rights reserved.
2 | // Licensed under the Apache license.
3 |
4 | using System.Diagnostics;
5 |
6 | namespace NatashaPad;
7 |
8 | public static class DumpOutHelper
9 | {
10 | public static Action OutputAction = (str) => { Debug.WriteLine(str); };
11 | }
12 |
--------------------------------------------------------------------------------
/src/NatashaPad.Core/Dumper.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) NatashaPad. All rights reserved.
2 | // Licensed under the Apache license.
3 |
4 | using WeihanLi.Extensions;
5 |
6 | namespace NatashaPad;
7 |
8 | public interface IDumper
9 | {
10 | Func TypePredicate { get; }
11 |
12 | string Dump(object obj);
13 | }
14 |
15 | public class DefaultDumper : IDumper
16 | {
17 | public static readonly IDumper Instance = new DefaultDumper();
18 |
19 | public Func TypePredicate { get; } = _ => true;
20 |
21 | public string Dump(object obj)
22 | {
23 | return obj.ToJsonOrString();
24 | }
25 | }
26 |
27 | public static class DumperExtensions
28 | {
29 | public static void Dump(this object obj)
30 | {
31 | string dumpedResult;
32 | if (obj is null)
33 | {
34 | dumpedResult = "(null)";
35 | }
36 | else
37 | {
38 | dumpedResult = DefaultDumper.Instance.Dump(obj);
39 | }
40 | DumpOutHelper.OutputAction?.Invoke(dumpedResult);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/NatashaPad.Core/DumperResolver.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) NatashaPad. All rights reserved.
2 | // Licensed under the Apache license.
3 |
4 | namespace NatashaPad;
5 |
6 | public class DumperResolver
7 | {
8 | private readonly ICollection _dumpers;
9 |
10 | public DumperResolver(IEnumerable dumpers)
11 | {
12 | _dumpers = dumpers.Reverse().ToArray();
13 | }
14 |
15 | public IDumper Resolve(Type type)
16 | {
17 | foreach (var dumper in _dumpers)
18 | {
19 | if (dumper.TypePredicate(type))
20 | return dumper;
21 | }
22 |
23 | return DefaultDumper.Instance;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/NatashaPad.Core/NatashaPad.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | NatashaPad
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/NatashaPad.Core/ScriptEngine.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) NatashaPad. All rights reserved.
2 | // Licensed under the Apache license.
3 |
4 | using Microsoft.CodeAnalysis.CSharp.Scripting;
5 | using Microsoft.CodeAnalysis.Scripting;
6 | using ReferenceResolver;
7 | using System.Reflection;
8 | using WeihanLi.Common.Helpers;
9 | using WeihanLi.Extensions;
10 |
11 | namespace NatashaPad;
12 |
13 | public interface INScriptEngine
14 | {
15 | Task Execute(string code, NScriptOptions scriptOptions, CancellationToken cancellationToken = default);
16 |
17 | Task