├── .gitignore
├── .nuget
├── NuGet.Config
└── NuGet.targets
├── LICENSE.txt
├── README.md
├── ScriptCsPad.sln
└── ScriptCsPad
├── App.config
├── App.xaml
├── App.xaml.cs
├── AppBootstrapper.cs
├── AutosubscriberModule.cs
├── Behaviors
├── GridSplitterExpander
│ ├── ColumnExpanderSize.cs
│ ├── GridSplitterExpanderBehavior.cs
│ ├── IExpanderSize.cs
│ └── RowExpanderSize.cs
├── LoadDependentBehavior.cs
└── TabStripScrollWheelBehavior.cs
├── Completion
├── CompletionData.cs
├── CompletionService.cs
└── ICompletionService.cs
├── Controls
└── ScriptEditor.cs
├── Extensions
├── CompletionServiceExtensions.cs
├── ReflectionExtensions.cs
└── VisualTreeExtensions.cs
├── IScriptManager.cs
├── IScriptWorkspace.cs
├── MetroWindowManager.cs
├── NullLogger.cs
├── PresentationModule.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
└── Settings.settings
├── Resources
├── Arrow_RedoRetry_16xLG_color.png
├── Arrow_UndoRevertRestore_16xLG_color.png
├── Assembly_6212.png
├── Close_16xLG.png
├── Copy_6524.png
├── Cut_6523.png
├── Delete.png
├── NewFile_6276.png
├── Open_6529.png
├── Paste_6520.png
├── Save_6530.png
├── Saveall_6518.png
├── ScriptCs.xshd
├── Start.png
├── classpublic.png
├── delegatepublic.png
├── enumpublic.png
├── interfacepublic.png
├── keyword.png
├── local.png
├── methodprivate.png
├── methodprotected.png
├── methodpublic.png
├── namespace.png
├── propertypublic.png
├── reference_16xLG.png
├── script_16xLG.png
├── startwithoutdebugging_6556.png
└── structurepublic.png
├── ScriptCsPad.csproj
├── ScriptManager.cs
├── ScriptWorkspace.cs
├── ViewModels
├── ScriptEditorViewModel.cs
├── ShellViewModel.cs
└── StatusBarViewModel.cs
├── Views
├── ScriptEditorView.xaml
├── ScriptEditorView.xaml.cs
├── ShellView.xaml
├── ShellView.xaml.cs
├── StatusBarView.xaml
└── StatusBarView.xaml.cs
└── packages.config
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
2 | [Bb]in/
3 | [Oo]bj/
4 |
5 | # mstest test results
6 | TestResults
7 |
8 | ## Ignore Visual Studio temporary files, build results, and
9 | ## files generated by popular Visual Studio add-ons.
10 |
11 | # User-specific files
12 | *.suo
13 | *.user
14 | *.sln.docstates
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Rr]elease/
19 | x64/
20 | *_i.c
21 | *_p.c
22 | *.ilk
23 | *.meta
24 | *.obj
25 | *.pch
26 | *.pdb
27 | *.pgc
28 | *.pgd
29 | *.rsp
30 | *.sbr
31 | *.tlb
32 | *.tli
33 | *.tlh
34 | *.tmp
35 | *.log
36 | *.vspscc
37 | *.vssscc
38 | .builds
39 |
40 | # Visual C++ cache files
41 | ipch/
42 | *.aps
43 | *.ncb
44 | *.opensdf
45 | *.sdf
46 |
47 | # Visual Studio profiler
48 | *.psess
49 | *.vsp
50 | *.vspx
51 |
52 | # Guidance Automation Toolkit
53 | *.gpState
54 |
55 | # ReSharper is a .NET coding add-in
56 | _ReSharper*
57 |
58 | # NCrunch
59 | *.ncrunch*
60 | .*crunch*.local.xml
61 |
62 | # Installshield output folder
63 | [Ee]xpress
64 |
65 | # DocProject is a documentation generator add-in
66 | DocProject/buildhelp/
67 | DocProject/Help/*.HxT
68 | DocProject/Help/*.HxC
69 | DocProject/Help/*.hhc
70 | DocProject/Help/*.hhk
71 | DocProject/Help/*.hhp
72 | DocProject/Help/Html2
73 | DocProject/Help/html
74 |
75 | # Click-Once directory
76 | publish
77 |
78 | # Publish Web Output
79 | *.Publish.xml
80 |
81 | # NuGet Packages Directory
82 | packages
83 |
84 | # Windows Azure Build Output
85 | csx
86 | *.build.csdef
87 |
88 | # Windows Store app package directory
89 | AppPackages/
90 |
91 | # Others
92 | [Bb]in
93 | [Oo]bj
94 | sql
95 | TestResults
96 | [Tt]est[Rr]esult*
97 | *.Cache
98 | ClientBin
99 | [Ss]tyle[Cc]op.*
100 | ~$*
101 | *.dbmdl
102 | Generated_Code #added for RIA/Silverlight projects
103 |
104 | # Backup & report files from converting an old project file to a newer
105 | # Visual Studio version. Backup files are not needed, because we have git ;-)
106 | _UpgradeReport_Files/
107 | Backup*/
108 | UpgradeLog*.XML
109 |
--------------------------------------------------------------------------------
/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.nuget/NuGet.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildProjectDirectory)\..\
5 |
6 |
7 | false
8 |
9 |
10 | false
11 |
12 |
13 | true
14 |
15 |
16 | false
17 |
18 |
19 |
20 |
21 |
22 |
26 |
27 |
28 |
29 |
30 | $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
31 | $([System.IO.Path]::Combine($(ProjectDir), "packages.config"))
32 |
33 |
34 |
35 |
36 | $(SolutionDir).nuget
37 | packages.config
38 |
39 |
40 |
41 |
42 | $(NuGetToolsPath)\NuGet.exe
43 | @(PackageSource)
44 |
45 | "$(NuGetExePath)"
46 | mono --runtime=v4.0.30319 $(NuGetExePath)
47 |
48 | $(TargetDir.Trim('\\'))
49 |
50 | -RequireConsent
51 | -NonInteractive
52 |
53 |
54 | $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir "$(SolutionDir) "
55 | $(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
56 |
57 |
58 |
59 | RestorePackages;
60 | $(BuildDependsOn);
61 |
62 |
63 |
64 |
65 | $(BuildDependsOn);
66 | BuildPackage;
67 |
68 |
69 |
70 |
71 |
72 |
73 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
95 |
97 |
98 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction, and
10 | distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by the copyright
13 | owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all other entities
16 | that control, are controlled by, or are under common control with that entity.
17 | For the purposes of this definition, "control" means (i) the power, direct or
18 | indirect, to cause the direction or management of such entity, whether by
19 | contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
20 | outstanding shares, or (iii) beneficial ownership of such entity.
21 |
22 | "You" (or "Your") shall mean an individual or Legal Entity exercising
23 | permissions granted by this License.
24 |
25 | "Source" form shall mean the preferred form for making modifications, including
26 | but not limited to software source code, documentation source, and configuration
27 | files.
28 |
29 | "Object" form shall mean any form resulting from mechanical transformation or
30 | translation of a Source form, including but not limited to compiled object code,
31 | generated documentation, and conversions to other media types.
32 |
33 | "Work" shall mean the work of authorship, whether in Source or Object form, made
34 | available under the License, as indicated by a copyright notice that is included
35 | in or attached to the work (an example is provided in the Appendix below).
36 |
37 | "Derivative Works" shall mean any work, whether in Source or Object form, that
38 | is based on (or derived from) the Work and for which the editorial revisions,
39 | annotations, elaborations, or other modifications represent, as a whole, an
40 | original work of authorship. For the purposes of this License, Derivative Works
41 | shall not include works that remain separable from, or merely link (or bind by
42 | name) to the interfaces of, the Work and Derivative Works thereof.
43 |
44 | "Contribution" shall mean any work of authorship, including the original version
45 | of the Work and any modifications or additions to that Work or Derivative Works
46 | thereof, that is intentionally submitted to Licensor for inclusion in the Work
47 | by the copyright owner or by an individual or Legal Entity authorized to submit
48 | on behalf of the copyright owner. For the purposes of this definition,
49 | "submitted" means any form of electronic, verbal, or written communication sent
50 | to the Licensor or its representatives, including but not limited to
51 | communication on electronic mailing lists, source code control systems, and
52 | issue tracking systems that are managed by, or on behalf of, the Licensor for
53 | the purpose of discussing and improving the Work, but excluding communication
54 | that is conspicuously marked or otherwise designated in writing by the copyright
55 | owner as "Not a Contribution."
56 |
57 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
58 | of whom a Contribution has been received by Licensor and subsequently
59 | incorporated within the Work.
60 |
61 | 2. Grant of Copyright License.
62 |
63 | Subject to the terms and conditions of this License, each Contributor hereby
64 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
65 | irrevocable copyright license to reproduce, prepare Derivative Works of,
66 | publicly display, publicly perform, sublicense, and distribute the Work and such
67 | Derivative Works in Source or Object form.
68 |
69 | 3. Grant of Patent License.
70 |
71 | Subject to the terms and conditions of this License, each Contributor hereby
72 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
73 | irrevocable (except as stated in this section) patent license to make, have
74 | made, use, offer to sell, sell, import, and otherwise transfer the Work, where
75 | such license applies only to those patent claims licensable by such Contributor
76 | that are necessarily infringed by their Contribution(s) alone or by combination
77 | of their Contribution(s) with the Work to which such Contribution(s) was
78 | submitted. If You institute patent litigation against any entity (including a
79 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a
80 | Contribution incorporated within the Work constitutes direct or contributory
81 | patent infringement, then any patent licenses granted to You under this License
82 | for that Work shall terminate as of the date such litigation is filed.
83 |
84 | 4. Redistribution.
85 |
86 | You may reproduce and distribute copies of the Work or Derivative Works thereof
87 | in any medium, with or without modifications, and in Source or Object form,
88 | provided that You meet the following conditions:
89 |
90 | You must give any other recipients of the Work or Derivative Works a copy of
91 | this License; and
92 | You must cause any modified files to carry prominent notices stating that You
93 | changed the files; and
94 | You must retain, in the Source form of any Derivative Works that You distribute,
95 | all copyright, patent, trademark, and attribution notices from the Source form
96 | of the Work, excluding those notices that do not pertain to any part of the
97 | Derivative Works; and
98 | If the Work includes a "NOTICE" text file as part of its distribution, then any
99 | Derivative Works that You distribute must include a readable copy of the
100 | attribution notices contained within such NOTICE file, excluding those notices
101 | that do not pertain to any part of the Derivative Works, in at least one of the
102 | following places: within a NOTICE text file distributed as part of the
103 | Derivative Works; within the Source form or documentation, if provided along
104 | with the Derivative Works; or, within a display generated by the Derivative
105 | Works, if and wherever such third-party notices normally appear. The contents of
106 | the NOTICE file are for informational purposes only and do not modify the
107 | License. You may add Your own attribution notices within Derivative Works that
108 | You distribute, alongside or as an addendum to the NOTICE text from the Work,
109 | provided that such additional attribution notices cannot be construed as
110 | modifying the License.
111 | You may add Your own copyright statement to Your modifications and may provide
112 | additional or different license terms and conditions for use, reproduction, or
113 | distribution of Your modifications, or for any such Derivative Works as a whole,
114 | provided Your use, reproduction, and distribution of the Work otherwise complies
115 | with the conditions stated in this License.
116 |
117 | 5. Submission of Contributions.
118 |
119 | Unless You explicitly state otherwise, any Contribution intentionally submitted
120 | for inclusion in the Work by You to the Licensor shall be under the terms and
121 | conditions of this License, without any additional terms or conditions.
122 | Notwithstanding the above, nothing herein shall supersede or modify the terms of
123 | any separate license agreement you may have executed with Licensor regarding
124 | such Contributions.
125 |
126 | 6. Trademarks.
127 |
128 | This License does not grant permission to use the trade names, trademarks,
129 | service marks, or product names of the Licensor, except as required for
130 | reasonable and customary use in describing the origin of the Work and
131 | reproducing the content of the NOTICE file.
132 |
133 | 7. Disclaimer of Warranty.
134 |
135 | Unless required by applicable law or agreed to in writing, Licensor provides the
136 | Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
137 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
138 | including, without limitation, any warranties or conditions of TITLE,
139 | NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
140 | solely responsible for determining the appropriateness of using or
141 | redistributing the Work and assume any risks associated with Your exercise of
142 | permissions under this License.
143 |
144 | 8. Limitation of Liability.
145 |
146 | In no event and under no legal theory, whether in tort (including negligence),
147 | contract, or otherwise, unless required by applicable law (such as deliberate
148 | and grossly negligent acts) or agreed to in writing, shall any Contributor be
149 | liable to You for damages, including any direct, indirect, special, incidental,
150 | or consequential damages of any character arising as a result of this License or
151 | out of the use or inability to use the Work (including but not limited to
152 | damages for loss of goodwill, work stoppage, computer failure or malfunction, or
153 | any and all other commercial damages or losses), even if such Contributor has
154 | been advised of the possibility of such damages.
155 |
156 | 9. Accepting Warranty or Additional Liability.
157 |
158 | While redistributing the Work or Derivative Works thereof, You may choose to
159 | offer, and charge a fee for, acceptance of support, warranty, indemnity, or
160 | other liability obligations and/or rights consistent with this License. However,
161 | in accepting such obligations, You may act only on Your own behalf and on Your
162 | sole responsibility, not on behalf of any other Contributor, and only if You
163 | agree to indemnify, defend, and hold each Contributor harmless for any liability
164 | incurred by, or claims asserted against, such Contributor by reason of your
165 | accepting any such warranty or additional liability.
166 |
167 | END OF TERMS AND CONDITIONS
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | scriptcs-editor
2 | ===============
3 |
4 | An ultra-lightweight editor with syntax highlighting and intellisense for scriptcs
5 |
6 | 
7 |
--------------------------------------------------------------------------------
/ScriptCsPad.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScriptCsPad", "ScriptCsPad\ScriptCsPad.csproj", "{53CC43FC-D034-4A9A-9998-64DBB683CC19}"
5 | EndProject
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{905994EB-FAE6-42A2-B648-0F694969F98F}"
7 | ProjectSection(SolutionItems) = preProject
8 | .nuget\NuGet.Config = .nuget\NuGet.Config
9 | .nuget\NuGet.exe = .nuget\NuGet.exe
10 | .nuget\NuGet.targets = .nuget\NuGet.targets
11 | EndProjectSection
12 | EndProject
13 | Global
14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | Debug|Any CPU = Debug|Any CPU
16 | Release|Any CPU = Release|Any CPU
17 | EndGlobalSection
18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
19 | {53CC43FC-D034-4A9A-9998-64DBB683CC19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20 | {53CC43FC-D034-4A9A-9998-64DBB683CC19}.Debug|Any CPU.Build.0 = Debug|Any CPU
21 | {53CC43FC-D034-4A9A-9998-64DBB683CC19}.Release|Any CPU.ActiveCfg = Release|Any CPU
22 | {53CC43FC-D034-4A9A-9998-64DBB683CC19}.Release|Any CPU.Build.0 = Release|Any CPU
23 | EndGlobalSection
24 | GlobalSection(SolutionProperties) = preSolution
25 | HideSolutionNode = FALSE
26 | EndGlobalSection
27 | EndGlobal
28 |
--------------------------------------------------------------------------------
/ScriptCsPad/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ScriptCsPad/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/ScriptCsPad/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace ScriptCsPad
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ScriptCsPad/AppBootstrapper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 |
5 | using Autofac;
6 |
7 | using Caliburn.Micro;
8 |
9 | using ScriptCsPad.ViewModels;
10 |
11 | using IContainer = Autofac.IContainer;
12 |
13 | namespace ScriptCsPad
14 | {
15 | public class AppBootstrapper : Bootstrapper
16 | {
17 | private IContainer _container;
18 |
19 | protected override void Configure()
20 | {
21 | LogManager.GetLog = type => new DebugLogger(type);
22 |
23 | var builder = new ContainerBuilder();
24 |
25 | ConfigureContainer(builder);
26 |
27 | _container = builder.Build();
28 | }
29 |
30 | protected override object GetInstance(Type service, string key)
31 | {
32 | if (string.IsNullOrWhiteSpace(key))
33 | {
34 | object instance;
35 | if (_container.TryResolve(service, out instance))
36 | return instance;
37 | }
38 | else
39 | {
40 | object instance;
41 | if (_container.TryResolveNamed(key, service, out instance))
42 | return instance;
43 | }
44 |
45 | throw new Exception(string.Format("Could not locate any instances of contract {0}.", key ?? service.Name));
46 | }
47 |
48 | protected override IEnumerable GetAllInstances(Type service)
49 | {
50 | return _container.Resolve(typeof(IEnumerable<>).MakeGenericType(service)) as IEnumerable;
51 | }
52 |
53 | protected override void BuildUp(object instance)
54 | {
55 | _container.InjectProperties(instance);
56 | }
57 |
58 | private static void ConfigureContainer(ContainerBuilder builder)
59 | {
60 | builder.RegisterModule();
61 | builder.RegisterModule();
62 | }
63 | }
64 |
65 | public class DebugLogger : ILog
66 | {
67 | private readonly Type _type;
68 |
69 | public DebugLogger(Type type)
70 | {
71 | _type = type;
72 | }
73 |
74 | public void Info(string format, params object[] args)
75 | {
76 | LogMessage("INFO", string.Format(format, args));
77 | }
78 |
79 | public void Warn(string format, params object[] args)
80 | {
81 | LogMessage("WARN", string.Format(format, args));
82 | }
83 |
84 | public void Error(Exception exception)
85 | {
86 | LogMessage("ERROR", string.Format("{0}: {1}", exception.GetType().Name, exception.Message));
87 | }
88 |
89 | private void LogMessage(string level, string message)
90 | {
91 | Debug.WriteLine("[{0} - {1} - {2}] - {3}", DateTime.Now, level, _type.Name, message);
92 | }
93 | }
94 | }
--------------------------------------------------------------------------------
/ScriptCsPad/AutosubscriberModule.cs:
--------------------------------------------------------------------------------
1 | using Autofac;
2 | using Autofac.Core;
3 |
4 | using Caliburn.Micro;
5 |
6 | namespace ScriptCsPad
7 | {
8 | public class AutosubscriberModule : Module
9 | {
10 | protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration)
11 | {
12 | registration.Activated += OnComponentActivated;
13 | }
14 |
15 | private static void OnComponentActivated(object sender, ActivatedEventArgs args)
16 | {
17 | var handler = args.Instance as IHandle;
18 | if (handler == null) return;
19 |
20 | var eventAggregator = args.Context.Resolve();
21 | eventAggregator.Subscribe(handler);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Behaviors/GridSplitterExpander/ColumnExpanderSize.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 |
4 | namespace ScriptCsPad.Behaviors
5 | {
6 | public sealed class ColumnExpanderSize : IExpanderSize
7 | {
8 | private readonly ColumnDefinition _columnDefinition;
9 |
10 | public ColumnExpanderSize(UIElement expander, Grid parentGrid)
11 | {
12 | var column = Grid.GetColumn(expander);
13 | _columnDefinition = parentGrid.ColumnDefinitions[column];
14 | }
15 |
16 | public GridLength DimensionSize
17 | {
18 | get { return _columnDefinition.Width; }
19 | set { _columnDefinition.Width = value; }
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Behaviors/GridSplitterExpander/GridSplitterExpanderBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using System.Windows.Interactivity;
6 |
7 | namespace ScriptCsPad.Behaviors
8 | {
9 | public class GridSplitterExpanderBehavior : Behavior
10 | {
11 | private bool _sizeInitialized;
12 |
13 | private bool _sizeManuallyChanged;
14 |
15 | private GridLength? _newDimensionSize;
16 |
17 | private GridLength _dimensionSize;
18 |
19 | private GridSplitter _gridSplitter;
20 |
21 | private FrameworkElement _expanderContent;
22 |
23 | private IExpanderSize _expanderSize;
24 |
25 | private Grid _parentGrid;
26 |
27 | protected override void OnAttached()
28 | {
29 | var parentGrid = AssociatedObject.Parent as Grid;
30 | if (parentGrid == null) return;
31 |
32 | _expanderSize = GetExpanderSize(parentGrid);
33 |
34 | _parentGrid = parentGrid;
35 |
36 | _parentGrid.Loaded += OnParentGridLoaded;
37 |
38 | AssociatedObject.Initialized += OnExpanderInitialized;
39 | AssociatedObject.Expanded += OnExpanderExpanded;
40 | AssociatedObject.Collapsed += OnExpanderCollapsed;
41 | }
42 |
43 | private IExpanderSize GetExpanderSize(Grid parentGrid)
44 | {
45 | if (IsColumn)
46 | {
47 | return new ColumnExpanderSize(AssociatedObject, parentGrid);
48 | }
49 |
50 | return new RowExpanderSize(AssociatedObject, parentGrid);
51 | }
52 |
53 | private bool IsColumn
54 | {
55 | get
56 | {
57 | return AssociatedObject.ExpandDirection == ExpandDirection.Left
58 | || AssociatedObject.ExpandDirection == ExpandDirection.Right;
59 | }
60 | }
61 |
62 | protected override void OnDetaching()
63 | {
64 | _parentGrid.Loaded -= OnParentGridLoaded;
65 |
66 | AssociatedObject.Initialized -= OnExpanderInitialized;
67 | AssociatedObject.Expanded -= OnExpanderExpanded;
68 | AssociatedObject.Collapsed -= OnExpanderCollapsed;
69 |
70 | _expanderContent.SizeChanged -= OnExpanderContentSizeChanged;
71 | }
72 |
73 | private void OnExpanderInitialized(object sender, EventArgs e)
74 | {
75 | _expanderContent = (FrameworkElement) AssociatedObject.Content;
76 | _expanderContent.SizeChanged += OnExpanderContentSizeChanged;
77 | }
78 |
79 | private void OnParentGridLoaded(object sender, RoutedEventArgs e)
80 | {
81 | _gridSplitter = _parentGrid.Children.Cast().OfType().FirstOrDefault();
82 | }
83 |
84 | private void OnExpanderContentSizeChanged(object sender, SizeChangedEventArgs e)
85 | {
86 | if (!_sizeInitialized)
87 | {
88 | _sizeInitialized = true;
89 | _dimensionSize = _expanderSize.DimensionSize;
90 | return;
91 | }
92 |
93 | if (!_sizeInitialized) return;
94 |
95 | if (_sizeManuallyChanged)
96 | _sizeManuallyChanged = false;
97 | else
98 | _newDimensionSize = _expanderSize.DimensionSize;
99 | }
100 |
101 | private void OnExpanderCollapsed(object sender, RoutedEventArgs e)
102 | {
103 | _expanderSize.DimensionSize = GridLength.Auto;
104 |
105 | if (_gridSplitter != null)
106 | _gridSplitter.IsEnabled = false;
107 |
108 | _sizeManuallyChanged = true;
109 | }
110 |
111 | private void OnExpanderExpanded(object sender, RoutedEventArgs e)
112 | {
113 | if (_gridSplitter != null)
114 | _gridSplitter.IsEnabled = true;
115 |
116 | _expanderSize.DimensionSize = _newDimensionSize.HasValue ? _newDimensionSize.Value : _dimensionSize;
117 | }
118 | }
119 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Behaviors/GridSplitterExpander/IExpanderSize.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace ScriptCsPad.Behaviors
4 | {
5 | public interface IExpanderSize
6 | {
7 | GridLength DimensionSize { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Behaviors/GridSplitterExpander/RowExpanderSize.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 |
4 | namespace ScriptCsPad.Behaviors
5 | {
6 | public sealed class RowExpanderSize : IExpanderSize
7 | {
8 | private readonly RowDefinition _rowDefinition;
9 |
10 | public RowExpanderSize(UIElement expander, Grid parentGrid)
11 | {
12 | var row = Grid.GetRow(expander);
13 | _rowDefinition = parentGrid.RowDefinitions[row];
14 | }
15 |
16 | public GridLength DimensionSize
17 | {
18 | get { return _rowDefinition.Height; }
19 | set { _rowDefinition.Height = value; }
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Behaviors/LoadDependentBehavior.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Interactivity;
3 |
4 | namespace ScriptCsPad.Behaviors
5 | {
6 | public abstract class LoadDependentBehavior : Behavior where T : FrameworkElement
7 | {
8 | protected override void OnAttached()
9 | {
10 | if (AssociatedObject.IsLoaded)
11 | {
12 | OnLoaded();
13 | return;
14 | }
15 |
16 | AssociatedObject.Loaded += OnAssociatedObjectLoaded;
17 | }
18 |
19 | protected abstract void OnLoaded();
20 |
21 | private void OnAssociatedObjectLoaded(object sender, RoutedEventArgs e)
22 | {
23 | OnLoaded();
24 | AssociatedObject.Loaded -= OnAssociatedObjectLoaded;
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Behaviors/TabStripScrollWheelBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using System.Windows.Controls.Primitives;
6 | using System.Windows.Input;
7 |
8 | using ScriptCsPad.Extensions;
9 |
10 | namespace ScriptCsPad.Behaviors
11 | {
12 | public class TabStripScrollWheelBehavior : LoadDependentBehavior
13 | {
14 | private TabPanel _tabPanel;
15 |
16 | protected override void OnLoaded()
17 | {
18 | _tabPanel = AssociatedObject.GetVisualChildren()
19 | .SelectMany(child => child.GetVisualChildren())
20 | .OfType()
21 | .SingleOrDefault();
22 |
23 | if (_tabPanel == null)
24 | AssociatedObject.ItemContainerGenerator.StatusChanged += OnItemContainerGeneratorStatusChanged;
25 | else
26 | _tabPanel.MouseWheel += OnTabPanelMouseWheel;
27 | }
28 |
29 | public bool InvertScrollDirection
30 | {
31 | get { return (bool)GetValue(InvertScrollDirectionProperty); }
32 | set { SetValue(InvertScrollDirectionProperty, value); }
33 | }
34 |
35 | public static readonly DependencyProperty InvertScrollDirectionProperty =
36 | DependencyProperty.Register(
37 | "InvertScrollDirection",
38 | typeof(bool),
39 | typeof(TabStripScrollWheelBehavior),
40 | new PropertyMetadata(false));
41 |
42 | public bool ScrollWrapsAround
43 | {
44 | get { return (bool)GetValue(ScrollWrapsAroundProperty); }
45 | set { SetValue(ScrollWrapsAroundProperty, value); }
46 | }
47 |
48 | public static readonly DependencyProperty ScrollWrapsAroundProperty =
49 | DependencyProperty.Register(
50 | "ScrollWrapsAround",
51 | typeof(bool),
52 | typeof(TabStripScrollWheelBehavior),
53 | new PropertyMetadata(false));
54 |
55 | protected override void OnDetaching()
56 | {
57 | _tabPanel.MouseWheel -= OnTabPanelMouseWheel;
58 | }
59 |
60 | private void OnItemContainerGeneratorStatusChanged(object sender, EventArgs e)
61 | {
62 | if (AssociatedObject.ItemContainerGenerator.Status != GeneratorStatus.ContainersGenerated) return;
63 |
64 | AssociatedObject.ItemContainerGenerator.StatusChanged -= OnItemContainerGeneratorStatusChanged;
65 | OnLoaded();
66 | }
67 |
68 | private void OnTabPanelMouseWheel(object sender, MouseWheelEventArgs e)
69 | {
70 | var nextTab = InvertScrollDirection ? e.Delta < 0 : e.Delta > 0;
71 | if (nextTab)
72 | {
73 | if (AssociatedObject.SelectedIndex < (AssociatedObject.Items.Count - 1))
74 | {
75 | AssociatedObject.SelectedIndex++;
76 | }
77 | else if (ScrollWrapsAround)
78 | {
79 | AssociatedObject.SelectedIndex = 0;
80 | }
81 |
82 | return;
83 | }
84 |
85 | if (AssociatedObject.SelectedIndex > 0)
86 | {
87 | AssociatedObject.SelectedIndex--;
88 | }
89 | else if (ScrollWrapsAround)
90 | {
91 | AssociatedObject.SelectedIndex = AssociatedObject.Items.Count - 1;
92 | }
93 | }
94 | }
95 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Completion/CompletionData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Reflection;
4 | using System.Windows.Media;
5 | using System.Windows.Media.Imaging;
6 |
7 | using ICSharpCode.AvalonEdit.CodeCompletion;
8 | using ICSharpCode.AvalonEdit.Document;
9 | using ICSharpCode.AvalonEdit.Editing;
10 |
11 | using Roslyn.Compilers;
12 | using Roslyn.Services;
13 |
14 | namespace ScriptCsPad.Completion
15 | {
16 | public class CompletionData : ICompletionData
17 | {
18 | private readonly CompletionItem _completionItem;
19 |
20 | private string _description;
21 |
22 | public CompletionData(CompletionItem completionItem)
23 | {
24 | _completionItem = completionItem;
25 | }
26 |
27 | public ImageSource Image
28 | {
29 | get
30 | {
31 | if (!_completionItem.Glyph.HasValue) return null;
32 |
33 | var fileName = string.Format("{0}.png", _completionItem.Glyph).ToLowerInvariant();
34 | var resourceName = string.Format("ScriptCsPad.Resources.{0}", fileName);
35 |
36 | var assembly = Assembly.GetExecutingAssembly();
37 | using (var stream = assembly.GetManifestResourceStream(resourceName))
38 | {
39 | if (stream == null)
40 | {
41 | Debug.Print(resourceName);
42 | return null;
43 | }
44 |
45 | var bitmapImage = new BitmapImage();
46 |
47 | bitmapImage.BeginInit();
48 | bitmapImage.StreamSource = stream;
49 | bitmapImage.DecodePixelHeight = 16;
50 | bitmapImage.EndInit();
51 |
52 | return bitmapImage;
53 | }
54 | }
55 | }
56 |
57 | public string Text
58 | {
59 | get { return _completionItem.DisplayText; }
60 | }
61 |
62 | public object Content
63 | {
64 | get { return _completionItem.DisplayText; }
65 | }
66 |
67 | public object Description
68 | {
69 | get { return _description ?? (_description = _completionItem.GetDescription().ToDisplayString()); }
70 | }
71 |
72 | public double Priority { get { return 0; } }
73 |
74 | public void Complete(TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs)
75 | {
76 | var offset = completionSegment.Offset - 1;
77 | var length = completionSegment.Length + 1;
78 |
79 | textArea.Document.Replace(offset, length, Text);
80 | }
81 | }
82 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Completion/CompletionService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Concurrent;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Reflection;
6 | using System.Threading;
7 |
8 | using Roslyn.Compilers;
9 | using Roslyn.Services;
10 |
11 | namespace ScriptCsPad.Completion
12 | {
13 | public class CompletionService : ICompletionService
14 | {
15 | private static readonly ConcurrentDictionary MethodMap =
16 | new ConcurrentDictionary();
17 |
18 | private readonly ILanguageService _languageService;
19 |
20 | private readonly Type _languageServiceType;
21 |
22 | public CompletionService(ILanguageService languageService)
23 | {
24 | _languageService = languageService;
25 | _languageServiceType = languageService.GetType();
26 | }
27 |
28 | public IEnumerable GetDefaultCompletionProviders()
29 | {
30 | return InvokeWrappedMethod>(MethodBase.GetCurrentMethod());
31 | }
32 |
33 | public TextSpan GetDefaultTrackingSpan(IDocument document, int position, CancellationToken cancellationToken)
34 | {
35 | return InvokeWrappedMethod(MethodBase.GetCurrentMethod(), document, position, cancellationToken);
36 | }
37 |
38 | public IEnumerable GetGroups(
39 | IDocument document,
40 | int position,
41 | CompletionTriggerInfo triggerInfo,
42 | IEnumerable completionProviders,
43 | CancellationToken cancellationToken)
44 | {
45 | return InvokeWrappedMethod>(
46 | MethodBase.GetCurrentMethod(), document, position, triggerInfo, completionProviders, cancellationToken);
47 | }
48 |
49 | public bool IsTriggerCharacter(IText text, int characterPosition, IEnumerable completionProviders)
50 | {
51 | return InvokeWrappedMethod(MethodBase.GetCurrentMethod(), text, characterPosition, completionProviders);
52 | }
53 |
54 | private T InvokeWrappedMethod(MethodBase wrapperMethod, params object[] args)
55 | {
56 | var wrappedMethod = MethodMap.GetOrAdd(wrapperMethod, GetWrappedMethod);
57 | return (T) wrappedMethod.Invoke(_languageService, args);
58 | }
59 |
60 | private MethodBase GetWrappedMethod(MethodBase wrapperMethod)
61 | {
62 | var parameters = wrapperMethod.GetParameters().Select(p => p.ParameterType).ToArray();
63 | return _languageServiceType.GetMethod(wrapperMethod.Name, parameters);
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Completion/ICompletionService.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading;
3 |
4 | using Roslyn.Compilers;
5 | using Roslyn.Services;
6 |
7 | namespace ScriptCsPad.Completion
8 | {
9 | public interface ICompletionService
10 | {
11 | IEnumerable GetDefaultCompletionProviders();
12 |
13 | TextSpan GetDefaultTrackingSpan(IDocument document, int position, CancellationToken cancellationToken);
14 |
15 | IEnumerable GetGroups(
16 | IDocument document,
17 | int position,
18 | CompletionTriggerInfo triggerInfo,
19 | IEnumerable completionProviders,
20 | CancellationToken cancellationToken);
21 |
22 | bool IsTriggerCharacter(IText text, int characterPosition, IEnumerable completionProviders);
23 | }
24 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Controls/ScriptEditor.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using System.Windows.Input;
3 |
4 | using Caliburn.Micro;
5 |
6 | using ICSharpCode.AvalonEdit;
7 | using ICSharpCode.AvalonEdit.CodeCompletion;
8 |
9 | using ScriptCsPad.Completion;
10 |
11 | namespace ScriptCsPad.Controls
12 | {
13 | public class ScriptEditor : TextEditor
14 | {
15 | private readonly IScriptManager _scriptManager;
16 |
17 | private CompletionWindow _completionWindow;
18 |
19 | public ScriptEditor()
20 | {
21 | _scriptManager = IoC.Get();
22 |
23 | ShowLineNumbers = true;
24 |
25 | TextArea.TextEntering += OnTextEntering;
26 | TextArea.TextEntered += OnTextEntered;
27 | }
28 |
29 | private void OnTextEntering(object sender, TextCompositionEventArgs e)
30 | {
31 | if (e.Text.Length <= 0 || _completionWindow == null) return;
32 |
33 | if (!char.IsLetterOrDigit(e.Text[0]))
34 | {
35 | _completionWindow.CompletionList.RequestInsertion(e);
36 | }
37 | }
38 |
39 | private void OnTextEntered(object sender, TextCompositionEventArgs e)
40 | {
41 | if (CaretOffset <= 0) return;
42 |
43 | var isTrigger = _scriptManager.IsCompletionTriggerCharacter(CaretOffset - 1);
44 | if (!isTrigger) return;
45 |
46 | _completionWindow = new CompletionWindow(TextArea);
47 |
48 | var data = _completionWindow.CompletionList.CompletionData;
49 |
50 | var completion = _scriptManager.GetCompletion(CaretOffset, Text[CaretOffset - 1]).ToList();
51 | if (!completion.Any())
52 | {
53 | _completionWindow = null;
54 | return;
55 | }
56 |
57 | foreach (var completionData in completion)
58 | {
59 | data.Add(new CompletionData(completionData));
60 | }
61 |
62 | _completionWindow.Show();
63 | _completionWindow.Closed += (o, args) => _completionWindow = null;
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Extensions/CompletionServiceExtensions.cs:
--------------------------------------------------------------------------------
1 | using Roslyn.Services;
2 |
3 | using ScriptCsPad.Completion;
4 |
5 | namespace ScriptCsPad.Extensions
6 | {
7 | public static class CompletionServiceExtensions
8 | {
9 | public static ICompletionService GetCompletionService(this ILanguageServiceProvider provider)
10 | {
11 | var serviceType = typeof(ILanguageService);
12 |
13 | var methodInfo = provider.GetMethodInfo(x => x.GetService());
14 | var genericMethodDefinition = methodInfo.GetGenericMethodDefinition();
15 |
16 | var typeName = string.Format("{0}.{1}", serviceType.Namespace, typeof(ICompletionService).Name);
17 | var genericMethod = genericMethodDefinition.MakeGenericMethod(serviceType.Assembly.GetType(typeName));
18 |
19 | var service = genericMethod.Invoke(provider, null) as ILanguageService;
20 |
21 | return new CompletionService(service);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Extensions/ReflectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq.Expressions;
3 | using System.Reflection;
4 |
5 | namespace ScriptCsPad.Extensions
6 | {
7 | public static class ReflectionExtensions
8 | {
9 | public static MethodInfo GetMethodInfo(this T value, Expression> expression)
10 | {
11 | return GetMethodInfo(expression);
12 | }
13 |
14 | private static MethodInfo GetMethodInfo(LambdaExpression expression)
15 | {
16 | var methodCallExpression = expression.Body as MethodCallExpression;
17 | if (methodCallExpression == null)
18 | throw new InvalidOperationException("Expression must be a method call.");
19 |
20 | return methodCallExpression.Method;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Extensions/VisualTreeExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Windows;
4 | using System.Windows.Media;
5 |
6 | namespace ScriptCsPad.Extensions
7 | {
8 | public static class VisualTreeExtensions
9 | {
10 | public static IEnumerable GetVisualChildren(this DependencyObject parent)
11 | {
12 | if (parent == null) throw new ArgumentNullException("parent");
13 |
14 | for (var i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
15 | {
16 | yield return VisualTreeHelper.GetChild(parent, i);
17 | }
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/ScriptCsPad/IScriptManager.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | using Roslyn.Compilers;
4 | using Roslyn.Services;
5 |
6 | namespace ScriptCsPad
7 | {
8 | public interface IScriptManager
9 | {
10 | void SetCurrentScript(ITextContainer container);
11 |
12 | bool IsCompletionTriggerCharacter(int position);
13 |
14 | IEnumerable GetCompletion(int position, char triggerChar);
15 | }
16 | }
--------------------------------------------------------------------------------
/ScriptCsPad/IScriptWorkspace.cs:
--------------------------------------------------------------------------------
1 | using Roslyn.Compilers;
2 | using Roslyn.Services;
3 |
4 | namespace ScriptCsPad
5 | {
6 | public interface IScriptWorkspace
7 | {
8 | ISolution CurrentSolution { get; }
9 |
10 | void SetCurrentSolution(ISolution solution);
11 |
12 | void OpenDocument(DocumentId documentId, ITextContainer textContainer);
13 | }
14 | }
--------------------------------------------------------------------------------
/ScriptCsPad/MetroWindowManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Windows;
5 |
6 | using Caliburn.Micro;
7 |
8 | using MahApps.Metro.Controls;
9 |
10 | namespace ScriptCsPad
11 | {
12 | public class MetroWindowManager : WindowManager
13 | {
14 | private static readonly Lazy> ResourceDictionaries;
15 |
16 | static MetroWindowManager()
17 | {
18 | ResourceDictionaries = new Lazy>(() => LoadResources().ToList());
19 | }
20 |
21 | protected override Window EnsureWindow(object model, object view, bool isDialog)
22 | {
23 | var metroWindow = view as MetroWindow;
24 | if (metroWindow != null)
25 | {
26 | var owner = InferOwnerOf(metroWindow);
27 | if (owner != null && isDialog)
28 | {
29 | metroWindow.Owner = owner;
30 | }
31 |
32 | return metroWindow;
33 | }
34 |
35 | return CreateMetroWindow(view);
36 | }
37 |
38 | private MetroWindow CreateMetroWindow(object view)
39 | {
40 | var metroWindow = new MetroWindow
41 | {
42 | Content = view,
43 | WindowStartupLocation = WindowStartupLocation.CenterScreen
44 | };
45 |
46 | metroWindow.SetValue(View.IsGeneratedProperty, true);
47 |
48 | AddMetroResources(metroWindow);
49 |
50 | var owner = InferOwnerOf(metroWindow);
51 | if (owner != null)
52 | {
53 | metroWindow.Owner = owner;
54 | metroWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
55 | }
56 |
57 | return metroWindow;
58 | }
59 |
60 | private static void AddMetroResources(FrameworkElement window)
61 | {
62 | foreach (var dictionary in ResourceDictionaries.Value)
63 | {
64 | window.Resources.MergedDictionaries.Add(dictionary);
65 | }
66 | }
67 |
68 | private static IEnumerable LoadResources()
69 | {
70 | const string Pack = "pack://application:,,,/MahApps.Metro;component/Styles/";
71 |
72 | var resources = new List
73 | {
74 | "Colours.xaml",
75 | "Fonts.xaml",
76 | "Controls.xaml",
77 | "Controls.AnimatedSingleRowTabControl.xaml",
78 | "Accents/BaseDark.xaml",
79 | "Accents/Blue.xaml"
80 | };
81 |
82 | return resources.Select(resource => new ResourceDictionary { Source = new Uri(Pack + resource) });
83 | }
84 | }
85 | }
--------------------------------------------------------------------------------
/ScriptCsPad/NullLogger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Common.Logging;
4 |
5 | namespace ScriptCsPad
6 | {
7 | public class NullLogger : ILog
8 | {
9 | public void Trace(object message) { }
10 |
11 | public void Trace(object message, Exception exception) { }
12 |
13 | public void TraceFormat(string format, params object[] args) { }
14 |
15 | public void TraceFormat(string format, Exception exception, params object[] args) { }
16 |
17 | public void TraceFormat(IFormatProvider formatProvider, string format, params object[] args) { }
18 |
19 | public void TraceFormat(
20 | IFormatProvider formatProvider, string format, Exception exception, params object[] args) { }
21 |
22 | public void Trace(Action formatMessageCallback) { }
23 |
24 | public void Trace(Action formatMessageCallback, Exception exception) { }
25 |
26 | public void Trace(IFormatProvider formatProvider, Action formatMessageCallback) { }
27 |
28 | public void Trace(
29 | IFormatProvider formatProvider, Action formatMessageCallback, Exception exception) { }
30 |
31 | public void Debug(object message) { }
32 |
33 | public void Debug(object message, Exception exception) { }
34 |
35 | public void DebugFormat(string format, params object[] args) { }
36 |
37 | public void DebugFormat(string format, Exception exception, params object[] args) { }
38 |
39 | public void DebugFormat(IFormatProvider formatProvider, string format, params object[] args) { }
40 |
41 | public void DebugFormat(
42 | IFormatProvider formatProvider, string format, Exception exception, params object[] args) { }
43 |
44 | public void Debug(Action formatMessageCallback) { }
45 |
46 | public void Debug(Action formatMessageCallback, Exception exception) { }
47 |
48 | public void Debug(IFormatProvider formatProvider, Action formatMessageCallback) { }
49 |
50 | public void Debug(
51 | IFormatProvider formatProvider, Action formatMessageCallback, Exception exception) { }
52 |
53 | public void Info(object message) { }
54 |
55 | public void Info(object message, Exception exception) { }
56 |
57 | public void InfoFormat(string format, params object[] args) { }
58 |
59 | public void InfoFormat(string format, Exception exception, params object[] args) { }
60 |
61 | public void InfoFormat(IFormatProvider formatProvider, string format, params object[] args) { }
62 |
63 | public void InfoFormat(IFormatProvider formatProvider, string format, Exception exception, params object[] args) { }
64 |
65 | public void Info(Action formatMessageCallback) { }
66 |
67 | public void Info(Action formatMessageCallback, Exception exception) { }
68 |
69 | public void Info(IFormatProvider formatProvider, Action formatMessageCallback) { }
70 |
71 | public void Info(
72 | IFormatProvider formatProvider, Action formatMessageCallback, Exception exception) { }
73 |
74 | public void Warn(object message) { }
75 |
76 | public void Warn(object message, Exception exception) { }
77 |
78 | public void WarnFormat(string format, params object[] args) { }
79 |
80 | public void WarnFormat(string format, Exception exception, params object[] args) { }
81 |
82 | public void WarnFormat(IFormatProvider formatProvider, string format, params object[] args) { }
83 |
84 | public void WarnFormat(IFormatProvider formatProvider, string format, Exception exception, params object[] args) { }
85 |
86 | public void Warn(Action formatMessageCallback) { }
87 |
88 | public void Warn(Action formatMessageCallback, Exception exception) { }
89 |
90 | public void Warn(IFormatProvider formatProvider, Action formatMessageCallback) { }
91 |
92 | public void Warn(
93 | IFormatProvider formatProvider, Action formatMessageCallback, Exception exception) { }
94 |
95 | public void Error(object message) { }
96 |
97 | public void Error(object message, Exception exception) { }
98 |
99 | public void ErrorFormat(string format, params object[] args) { }
100 |
101 | public void ErrorFormat(string format, Exception exception, params object[] args) { }
102 |
103 | public void ErrorFormat(IFormatProvider formatProvider, string format, params object[] args) { }
104 |
105 | public void ErrorFormat(
106 | IFormatProvider formatProvider, string format, Exception exception, params object[] args) { }
107 |
108 | public void Error(Action formatMessageCallback) { }
109 |
110 | public void Error(Action formatMessageCallback, Exception exception) { }
111 |
112 | public void Error(IFormatProvider formatProvider, Action formatMessageCallback) { }
113 |
114 | public void Error(
115 | IFormatProvider formatProvider, Action formatMessageCallback, Exception exception) { }
116 |
117 | public void Fatal(object message) { }
118 |
119 | public void Fatal(object message, Exception exception) { }
120 |
121 | public void FatalFormat(string format, params object[] args) { }
122 |
123 | public void FatalFormat(string format, Exception exception, params object[] args) { }
124 |
125 | public void FatalFormat(IFormatProvider formatProvider, string format, params object[] args) { }
126 |
127 | public void FatalFormat(
128 | IFormatProvider formatProvider, string format, Exception exception, params object[] args) { }
129 |
130 | public void Fatal(Action formatMessageCallback) { }
131 |
132 | public void Fatal(Action formatMessageCallback, Exception exception) { }
133 |
134 | public void Fatal(IFormatProvider formatProvider, Action formatMessageCallback) { }
135 |
136 | public void Fatal(
137 | IFormatProvider formatProvider, Action formatMessageCallback, Exception exception) { }
138 |
139 | public bool IsTraceEnabled { get; private set; }
140 |
141 | public bool IsDebugEnabled { get; private set; }
142 |
143 | public bool IsErrorEnabled { get; private set; }
144 |
145 | public bool IsFatalEnabled { get; private set; }
146 |
147 | public bool IsInfoEnabled { get; private set; }
148 |
149 | public bool IsWarnEnabled { get; private set; }
150 | }
151 | }
--------------------------------------------------------------------------------
/ScriptCsPad/PresentationModule.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Linq;
4 | using System.Reflection;
5 | using System.Xml;
6 |
7 | using Autofac;
8 |
9 | using Caliburn.Micro;
10 |
11 | using ICSharpCode.AvalonEdit.Highlighting;
12 | using ICSharpCode.AvalonEdit.Highlighting.Xshd;
13 |
14 | using Roslyn.Compilers;
15 | using Roslyn.Services;
16 | using Roslyn.Services.Host;
17 |
18 | using ScriptCs;
19 |
20 | using ScriptCsPad.Completion;
21 | using ScriptCsPad.Extensions;
22 |
23 | using Module = Autofac.Module;
24 |
25 | namespace ScriptCsPad
26 | {
27 | public class PresentationModule : Module
28 | {
29 | protected override void Load(ContainerBuilder builder)
30 | {
31 | // Register ViewModels
32 | builder.RegisterAssemblyTypes(AssemblySource.Instance.ToArray())
33 | .Where(type => type.Name.EndsWith("ViewModel"))
34 | .Where(type => NamespaceEndsWith(type, "ViewModels"))
35 | .Where(type => !type.IsAbstract)
36 | .AssignableTo()
37 | .AsSelf()
38 | .InstancePerDependency();
39 |
40 | // Register Views
41 | builder.RegisterAssemblyTypes(AssemblySource.Instance.ToArray())
42 | .Where(type => type.Name.EndsWith("View"))
43 | .Where(type => NamespaceEndsWith(type, "Views"))
44 | .AsSelf()
45 | .InstancePerDependency();
46 |
47 | var workspaceServiceProvider = DefaultServices.WorkspaceServicesFactory.CreateWorkspaceServiceProvider("RoslynPad");
48 | builder.RegisterInstance(workspaceServiceProvider).As();
49 |
50 | builder.Register(c => c.Resolve().CurrentSolution.LanguageServicesFactory
51 | .CreateLanguageServiceProvider(LanguageNames.CSharp).GetCompletionService()).As();
52 |
53 | builder.RegisterType().As().SingleInstance();
54 | builder.RegisterType().As().SingleInstance();
55 |
56 | builder.RegisterType().As();
57 | builder.RegisterType().As();
58 | builder.RegisterType().As();
59 |
60 | builder.Register(c => HighlightingManager.Instance).As().SingleInstance();
61 | builder.Register(c => LoadHighlightingDefinition(c.Resolve())).SingleInstance();
62 |
63 | builder.Register(c => new MetroWindowManager()).SingleInstance();
64 | builder.Register(c => new EventAggregator()).SingleInstance();
65 | }
66 |
67 | private static IHighlightingDefinition LoadHighlightingDefinition(IHighlightingDefinitionReferenceResolver referenceResolver)
68 | {
69 | var assembly = Assembly.GetExecutingAssembly();
70 | using (var stream = assembly.GetManifestResourceStream("ScriptCsPad.Resources.ScriptCs.xshd"))
71 | {
72 | if (stream == null) throw new InvalidOperationException("Could not find highlighting definition.");
73 |
74 | using (var reader = XmlReader.Create(stream))
75 | {
76 | return HighlightingLoader.Load(reader, referenceResolver);
77 | }
78 | }
79 | }
80 |
81 | private static bool NamespaceEndsWith(Type type, string value)
82 | {
83 | return !string.IsNullOrWhiteSpace(type.Namespace) && type.Namespace.EndsWith(value);
84 | }
85 | }
86 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("ScriptCsPad")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("ScriptCsPad")]
15 | [assembly: AssemblyCopyright("Copyright © 2013")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/ScriptCsPad/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.18033
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ScriptCsPad.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ScriptCsPad.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/ScriptCsPad/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/ScriptCsPad/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.18033
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ScriptCsPad.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ScriptCsPad/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/Arrow_RedoRetry_16xLG_color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/Arrow_RedoRetry_16xLG_color.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/Arrow_UndoRevertRestore_16xLG_color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/Arrow_UndoRevertRestore_16xLG_color.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/Assembly_6212.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/Assembly_6212.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/Close_16xLG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/Close_16xLG.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/Copy_6524.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/Copy_6524.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/Cut_6523.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/Cut_6523.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/Delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/Delete.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/NewFile_6276.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/NewFile_6276.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/Open_6529.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/Open_6529.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/Paste_6520.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/Paste_6520.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/Save_6530.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/Save_6530.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/Saveall_6518.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/Saveall_6518.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/ScriptCs.xshd:
--------------------------------------------------------------------------------
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 | TODO
35 | FIXME
36 |
37 |
38 | HACK
39 | UNDONE
40 |
41 |
42 |
43 |
44 |
45 |
46 | \#
47 |
48 |
49 |
50 |
51 | (define|undef|if|elif|else|endif|line)\b
52 |
53 |
54 |
55 | //
56 |
57 |
58 |
59 |
60 |
61 |
62 | (region|endregion|error|warning|pragma)\b
63 |
64 |
65 |
66 |
67 |
68 |
69 | ///
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | //
78 |
79 |
80 |
81 | /\*
82 | \*/
83 |
84 |
85 |
86 | "
87 | "
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 | '
96 | '
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 | @"
105 | "
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 | @[\w\d_]+
115 |
116 |
117 |
118 | this
119 | base
120 |
121 |
122 |
123 | as
124 | is
125 | new
126 | sizeof
127 | typeof
128 | stackalloc
129 |
130 |
131 |
132 | true
133 | false
134 |
135 |
136 |
137 | else
138 | if
139 | switch
140 | case
141 | default
142 | do
143 | for
144 | foreach
145 | in
146 | while
147 | lock
148 |
149 |
150 |
151 | break
152 | continue
153 | goto
154 | return
155 |
156 |
157 |
158 | yield
159 | partial
160 | global
161 | where
162 | select
163 | group
164 | by
165 | into
166 | from
167 | ascending
168 | descending
169 | orderby
170 | let
171 | join
172 | on
173 | equals
174 | var
175 | dynamic
176 | await
177 |
178 |
179 |
180 | try
181 | throw
182 | catch
183 | finally
184 |
185 |
186 |
187 | checked
188 | unchecked
189 |
190 |
191 |
192 | fixed
193 | unsafe
194 |
195 |
196 |
197 | bool
198 | byte
199 | char
200 | decimal
201 | double
202 | enum
203 | float
204 | int
205 | long
206 | sbyte
207 | short
208 | struct
209 | uint
210 | ushort
211 | ulong
212 |
213 |
214 |
215 | class
216 | interface
217 | delegate
218 | object
219 | string
220 | void
221 |
222 |
223 |
224 | explicit
225 | implicit
226 | operator
227 |
228 |
229 |
230 | params
231 | ref
232 | out
233 |
234 |
235 |
236 | abstract
237 | const
238 | event
239 | extern
240 | override
241 | readonly
242 | sealed
243 | static
244 | virtual
245 | volatile
246 | async
247 |
248 |
249 |
250 | public
251 | protected
252 | private
253 | internal
254 |
255 |
256 |
257 | namespace
258 | using
259 |
260 |
261 |
262 | get
263 | set
264 | add
265 | remove
266 |
267 |
268 |
269 | null
270 | value
271 |
272 |
273 |
274 |
275 | \b
276 | [\d\w_]+ # an identifier
277 | (?=\s*\() # followed by (
278 |
279 |
280 |
281 |
282 | \b0[xX][0-9a-fA-F]+ # hex number
283 | |
284 | ( \b\d+(\.[0-9]+)? #number with optional floating point
285 | | \.[0-9]+ #or just starting with floating point
286 | )
287 | ([eE][+-]?[0-9]+)? # optional exponent
288 |
289 |
290 |
291 | [?,.;()\[\]{}+\-/%*<>^+~!|&]+
292 |
293 |
294 |
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/Start.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/Start.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/classpublic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/classpublic.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/delegatepublic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/delegatepublic.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/enumpublic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/enumpublic.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/interfacepublic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/interfacepublic.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/keyword.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/keyword.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/local.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/local.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/methodprivate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/methodprivate.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/methodprotected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/methodprotected.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/methodpublic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/methodpublic.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/namespace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/namespace.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/propertypublic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/propertypublic.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/reference_16xLG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/reference_16xLG.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/script_16xLG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/script_16xLG.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/startwithoutdebugging_6556.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/startwithoutdebugging_6556.png
--------------------------------------------------------------------------------
/ScriptCsPad/Resources/structurepublic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/khellang/scriptcs-editor/fe7c08e4b45178204a79c772eb5e835a8169c009/ScriptCsPad/Resources/structurepublic.png
--------------------------------------------------------------------------------
/ScriptCsPad/ScriptCsPad.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {53CC43FC-D034-4A9A-9998-64DBB683CC19}
8 | WinExe
9 | Properties
10 | ScriptCsPad
11 | ScriptCsPad
12 | v4.5
13 | 512
14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
15 | 4
16 | ..\
17 | true
18 |
19 |
20 | AnyCPU
21 | true
22 | full
23 | false
24 | bin\Debug\
25 | DEBUG;TRACE
26 | prompt
27 | 4
28 |
29 |
30 | AnyCPU
31 | pdbonly
32 | true
33 | bin\Release\
34 | TRACE
35 | prompt
36 | 4
37 |
38 |
39 |
40 | False
41 | ..\packages\Autofac.3.0.2\lib\net40\Autofac.dll
42 |
43 |
44 | False
45 | ..\packages\Autofac.3.0.2\lib\net40\Autofac.Configuration.dll
46 |
47 |
48 | ..\packages\Autofac.Mef.3.0.1\lib\net40\Autofac.Integration.Mef.dll
49 |
50 |
51 | False
52 | ..\packages\Caliburn.Micro.1.5.1\lib\net45\Caliburn.Micro.dll
53 |
54 |
55 | False
56 | ..\packages\Common.Logging.2.1.2\lib\net40\Common.Logging.dll
57 |
58 |
59 | ..\packages\AvalonEdit.4.3.1.9430\lib\Net40\ICSharpCode.AvalonEdit.dll
60 |
61 |
62 | False
63 | ..\packages\MahApps.Metro.0.10.1.1\lib\net45\MahApps.Metro.dll
64 |
65 |
66 | False
67 | ..\packages\NuGet.Core.2.2.0\lib\net40-Client\NuGet.Core.dll
68 |
69 |
70 | True
71 | ..\packages\Roslyn.Compilers.Common.1.2.20906.2\lib\net45\Roslyn.Compilers.dll
72 |
73 |
74 | True
75 | ..\packages\Roslyn.Compilers.CSharp.1.2.20906.2\lib\net45\Roslyn.Compilers.CSharp.dll
76 |
77 |
78 | True
79 | ..\packages\Roslyn.Services.Common.1.2.20906.2\lib\net45\Roslyn.Services.dll
80 |
81 |
82 | True
83 | ..\packages\Roslyn.Services.CSharp.1.2.20906.2\lib\net45\Roslyn.Services.CSharp.dll
84 |
85 |
86 | True
87 | ..\packages\Roslyn.Services.Common.1.2.20906.2\lib\net45\Roslyn.Utilities.dll
88 |
89 |
90 | False
91 | ..\packages\ScriptCs.Contracts.0.4.0\lib\net45\ScriptCs.Contracts.dll
92 |
93 |
94 | False
95 | ..\packages\ScriptCs.Core.0.4.0\lib\net45\ScriptCs.Core.dll
96 |
97 |
98 |
99 |
100 |
101 |
102 | ..\packages\MahApps.Metro.0.10.1.1\lib\net45\System.Windows.Interactivity.dll
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | 4.0
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | MSBuild:Compile
120 | Designer
121 |
122 |
123 | App.xaml
124 | Code
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 | ScriptEditorView.xaml
150 |
151 |
152 | ShellView.xaml
153 |
154 |
155 | StatusBarView.xaml
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 | Code
164 |
165 |
166 | True
167 | True
168 | Resources.resx
169 |
170 |
171 | True
172 | Settings.settings
173 | True
174 |
175 |
176 | ResXFileCodeGenerator
177 | Resources.Designer.cs
178 |
179 |
180 |
181 | SettingsSingleFileGenerator
182 | Settings.Designer.cs
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 | Designer
202 | MSBuild:Compile
203 |
204 |
205 | Designer
206 | MSBuild:Compile
207 |
208 |
209 | Designer
210 | MSBuild:Compile
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
272 |
--------------------------------------------------------------------------------
/ScriptCsPad/ScriptManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading;
5 |
6 | using Roslyn.Compilers;
7 | using Roslyn.Compilers.CSharp;
8 | using Roslyn.Services;
9 |
10 | using ScriptCsPad.Completion;
11 |
12 | namespace ScriptCsPad
13 | {
14 | public class ScriptManager : IScriptManager
15 | {
16 | private static readonly Type[] AssemblyTypes = new[] { typeof(object), typeof(Uri), typeof(Enumerable) };
17 |
18 | private readonly ICompletionService _completionService;
19 |
20 | private readonly IScriptWorkspace _scriptWorkspace;
21 |
22 | private readonly CompilationOptions _compilationOptions;
23 |
24 | private readonly ParseOptions _parseOptions;
25 |
26 | private readonly IEnumerable _references;
27 |
28 | private DocumentId _currentDocumentId;
29 |
30 | private ProjectId _previousProjectId;
31 |
32 | private int _documentNumber;
33 |
34 | public ScriptManager(ICompletionService completionService, IScriptWorkspace scriptWorkspace)
35 | {
36 | _completionService = completionService;
37 | _scriptWorkspace = scriptWorkspace;
38 |
39 | _compilationOptions = new CompilationOptions(OutputKind.DynamicallyLinkedLibrary);
40 | _parseOptions = new ParseOptions(CompatibilityMode.None, LanguageVersion.CSharp6, true, SourceCodeKind.Script);
41 |
42 | var metadataFileProvider = _scriptWorkspace.CurrentSolution.MetadataFileProvider;
43 | _references = AssemblyTypes.Select(type => GetReference(metadataFileProvider, type));
44 | }
45 |
46 | private static PortableExecutableReference GetReference(MetadataFileProvider metadataFileProvider, Type t)
47 | {
48 | return metadataFileProvider.GetReference(t.Assembly.Location, MetadataReferenceProperties.Assembly);
49 | }
50 |
51 | private IDocument CurrentScript
52 | {
53 | get { return _scriptWorkspace.CurrentSolution.GetDocument(_currentDocumentId); }
54 | }
55 |
56 | private static IText UsingText
57 | {
58 | get
59 | {
60 | var usingStatements = AssemblyTypes.Select(t => string.Format("using {0};", t.Namespace));
61 | return new StringText(string.Join(Environment.NewLine, usingStatements));
62 | }
63 | }
64 |
65 | public void SetCurrentScript(ITextContainer container)
66 | {
67 | var currentSolution = _scriptWorkspace.CurrentSolution;
68 |
69 | IProject project;
70 | if (_previousProjectId == null)
71 | {
72 | DocumentId id;
73 | project = CreateSubmissionProject(currentSolution);
74 | currentSolution = project.Solution.AddDocument(project.Id, project.Name, UsingText, out id);
75 | _previousProjectId = project.Id;
76 | }
77 |
78 | project = CreateSubmissionProject(currentSolution);
79 | var currentDocument = SetSubmissionDocument(container, project);
80 | _currentDocumentId = currentDocument.Id;
81 | }
82 |
83 | private IProject CreateSubmissionProject(ISolution solution)
84 | {
85 | var name = "Submission#" + _documentNumber++;
86 | var projectId = ProjectId.CreateNewId(solution.Id, name);
87 |
88 | var version = VersionStamp.Create();
89 | var compilationOptions = _compilationOptions.WithScriptClassName(name);
90 |
91 | var projectInfo = new ProjectInfo(
92 | projectId,
93 | version,
94 | name,
95 | name,
96 | LanguageNames.CSharp,
97 | compilationOptions: compilationOptions,
98 | parseOptions: _parseOptions,
99 | metadataReferences: _references,
100 | isSubmission: true);
101 |
102 | solution = solution.AddProject(projectInfo);
103 |
104 | if (_previousProjectId != null)
105 | {
106 | solution = solution.AddProjectReference(projectId, _previousProjectId);
107 | }
108 |
109 | return solution.GetProject(projectId);
110 | }
111 |
112 | private IDocument SetSubmissionDocument(ITextContainer textContainer, IProject project)
113 | {
114 | DocumentId id;
115 | var solution = project.Solution.AddDocument(project.Id, project.Name, textContainer.CurrentText, out id);
116 |
117 | _scriptWorkspace.SetCurrentSolution(solution);
118 | _scriptWorkspace.OpenDocument(id, textContainer);
119 |
120 | return solution.GetDocument(id);
121 | }
122 |
123 | public bool IsCompletionTriggerCharacter(int position)
124 | {
125 | var currentScriptText = CurrentScript.GetText();
126 | var completionProviders = _completionService.GetDefaultCompletionProviders();
127 |
128 | return _completionService.IsTriggerCharacter(currentScriptText, position, completionProviders);
129 | }
130 |
131 | public IEnumerable GetCompletion(int position, char triggerChar)
132 | {
133 | var completionTrigger = CompletionTriggerInfo.CreateTypeCharTriggerInfo(triggerChar);
134 | var completionProviders = _completionService.GetDefaultCompletionProviders();
135 |
136 | var groups = _completionService.GetGroups(
137 | CurrentScript,
138 | position,
139 | completionTrigger,
140 | completionProviders,
141 | CancellationToken.None);
142 |
143 | if (groups == null) yield break;
144 |
145 | foreach (var completionItem in groups.SelectMany(x => x.Items))
146 | {
147 | yield return completionItem;
148 | }
149 | }
150 | }
151 | }
--------------------------------------------------------------------------------
/ScriptCsPad/ScriptWorkspace.cs:
--------------------------------------------------------------------------------
1 | using Roslyn.Compilers;
2 | using Roslyn.Services;
3 | using Roslyn.Services.Host;
4 |
5 | namespace ScriptCsPad
6 | {
7 | public class ScriptWorkspace : TrackingWorkspace, IScriptWorkspace
8 | {
9 | public ScriptWorkspace(IWorkspaceServiceProvider workspaceServiceProvider)
10 | : base(workspaceServiceProvider, true, true) { }
11 |
12 | public override bool IsSupported(WorkspaceFeature feature)
13 | {
14 | return feature == WorkspaceFeature.OpenDocument || feature == WorkspaceFeature.UpdateDocument;
15 | }
16 |
17 | public void SetCurrentSolution(ISolution solution)
18 | {
19 | SetLatestSolution(solution);
20 | RaiseWorkspaceChangedEventAsync(WorkspaceEventKind.SolutionChanged, solution);
21 | }
22 |
23 | public void OpenDocument(DocumentId documentId, ITextContainer textContainer)
24 | {
25 | OnDocumentOpened(documentId, textContainer);
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/ScriptCsPad/ViewModels/ScriptEditorViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 |
4 | using Caliburn.Micro;
5 |
6 | using ICSharpCode.AvalonEdit.Document;
7 | using ICSharpCode.AvalonEdit.Highlighting;
8 |
9 | using Roslyn.Compilers;
10 |
11 | namespace ScriptCsPad.ViewModels
12 | {
13 | public class ScriptEditorViewModel : Screen, ITextContainer
14 | {
15 | private TextDocument _document;
16 |
17 | private bool _isModified;
18 |
19 | private string _name;
20 |
21 | public ScriptEditorViewModel(string name, string content, IHighlightingDefinition highlighting)
22 | {
23 | Name = name;
24 | Content = content;
25 | CurrentText = new StringText(content);
26 | Highlighting = highlighting;
27 | References = new BindableCollection();
28 | UsingStatements = new BindableCollection();
29 | }
30 |
31 | private IText OldText { get; set; }
32 |
33 | public IText CurrentText { get; private set; }
34 |
35 | public event EventHandler TextChanged;
36 |
37 | public IHighlightingDefinition Highlighting { get; set; }
38 |
39 | public BindableCollection References { get; set; }
40 |
41 | public BindableCollection UsingStatements { get; set; }
42 |
43 | public string Name
44 | {
45 | get { return _name; }
46 | set
47 | {
48 | if (value == _name) return;
49 | _name = value;
50 | NotifyOfPropertyChange(() => Name);
51 | }
52 | }
53 |
54 | public TextDocument Document
55 | {
56 | get { return _document; }
57 | set
58 | {
59 | if (Equals(value, _document)) return;
60 | _document = value;
61 | NotifyOfPropertyChange(() => Document);
62 | }
63 | }
64 |
65 | public string Content
66 | {
67 | get { return Document.Text; }
68 | set
69 | {
70 | if (Document == null)
71 | {
72 | Document = new TextDocument(value);
73 | Document.UndoStack.PropertyChanged += OnUndoStackPropertyChanged;
74 | Document.Changing += OnDocumentChanging;
75 | Document.Changed += OnDocumentChanged;
76 | }
77 | else
78 | {
79 | Document.Text = value;
80 | }
81 | }
82 | }
83 |
84 | public bool IsModified
85 | {
86 | get { return _isModified; }
87 | set
88 | {
89 | if (value.Equals(_isModified)) return;
90 | _isModified = value;
91 | NotifyOfPropertyChange(() => IsModified);
92 |
93 | if (value)
94 | {
95 | Document.UndoStack.MarkAsOriginalFile();
96 | }
97 | }
98 | }
99 |
100 | protected virtual void OnTextChanged(TextChangeEventArgs e)
101 | {
102 | var handler = TextChanged;
103 | if (handler != null) handler(this, e);
104 | }
105 |
106 | protected override void OnDeactivate(bool close)
107 | {
108 | if (close && Document != null)
109 | {
110 | Document.UndoStack.PropertyChanged -= OnUndoStackPropertyChanged;
111 | Document.Changing -= OnDocumentChanging;
112 | Document.Changed -= OnDocumentChanged;
113 | }
114 |
115 | base.OnDeactivate(close);
116 | }
117 |
118 | private void OnDocumentChanging(object sender, DocumentChangeEventArgs e)
119 | {
120 | OldText = CurrentText;
121 | }
122 |
123 | private void OnDocumentChanged(object sender, DocumentChangeEventArgs e)
124 | {
125 | CurrentText = new StringText(Document.Text);
126 | OnTextChanged(new TextChangeEventArgs(OldText, CurrentText, new TextChangeRange[0]));
127 | }
128 |
129 | private void OnUndoStackPropertyChanged(object sender, PropertyChangedEventArgs e)
130 | {
131 | if (e.PropertyName == "IsOriginalFile")
132 | {
133 | IsModified = !Document.UndoStack.IsOriginalFile;
134 | }
135 | }
136 | }
137 | }
--------------------------------------------------------------------------------
/ScriptCsPad/ViewModels/ShellViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Windows.Forms;
3 |
4 | using Caliburn.Micro;
5 |
6 | using ICSharpCode.AvalonEdit.Highlighting;
7 |
8 | using ScriptCsPad.Controls;
9 |
10 | namespace ScriptCsPad.ViewModels
11 | {
12 | public sealed class ShellViewModel : Conductor.Collection.OneActive
13 | {
14 | private readonly IHighlightingDefinition _highlighting;
15 |
16 | private readonly IScriptManager _scriptManager;
17 |
18 | public ShellViewModel(IHighlightingDefinition highlighting, IScriptManager scriptManager)
19 | {
20 | _highlighting = highlighting;
21 | _scriptManager = scriptManager;
22 | DisplayName = "ScriptCsPad";
23 | StatusBar = new StatusBarViewModel();
24 | }
25 |
26 | public StatusBarViewModel StatusBar { get; set; }
27 |
28 | protected override void ChangeActiveItem(ScriptEditorViewModel newItem, bool closePrevious)
29 | {
30 | _scriptManager.SetCurrentScript(newItem);
31 | base.ChangeActiveItem(newItem, closePrevious);
32 | }
33 |
34 | public void New()
35 | {
36 | var scriptEditor = new ScriptEditorViewModel("untitled", string.Empty, _highlighting);
37 | Items.Add(scriptEditor);
38 | ActivateItem(scriptEditor);
39 | }
40 |
41 | public void Open()
42 | {
43 | var dialog = new OpenFileDialog
44 | {
45 | Filter = "C# Scripts|*.csx",
46 | CheckFileExists = true,
47 | Multiselect = false
48 | };
49 |
50 | var result = dialog.ShowDialog();
51 | if (result != DialogResult.OK) return;
52 |
53 | var fileName = Path.GetFileName(dialog.FileName);
54 | var content = File.ReadAllText(dialog.FileName);
55 |
56 | var scriptEditor = new ScriptEditorViewModel(fileName, content, _highlighting);
57 | Items.Add(scriptEditor);
58 | ActivateItem(scriptEditor);
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/ScriptCsPad/ViewModels/StatusBarViewModel.cs:
--------------------------------------------------------------------------------
1 | using Caliburn.Micro;
2 |
3 | namespace ScriptCsPad.ViewModels
4 | {
5 | public class StatusBarViewModel : PropertyChangedBase { }
6 | }
--------------------------------------------------------------------------------
/ScriptCsPad/Views/ScriptEditorView.xaml:
--------------------------------------------------------------------------------
1 |
9 |
16 |
--------------------------------------------------------------------------------
/ScriptCsPad/Views/ScriptEditorView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace ScriptCsPad.Views
17 | {
18 | ///
19 | /// Interaction logic for ScriptEditorView.xaml
20 | ///
21 | public partial class ScriptEditorView : UserControl
22 | {
23 | public ScriptEditorView()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ScriptCsPad/Views/ShellView.xaml:
--------------------------------------------------------------------------------
1 |
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 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
160 |
161 |
162 |
163 |
164 |
166 |
167 |
--------------------------------------------------------------------------------
/ScriptCsPad/Views/ShellView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace ScriptCsPad.Views
4 | {
5 | public partial class ShellView : UserControl
6 | {
7 | public ShellView()
8 | {
9 | InitializeComponent();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/ScriptCsPad/Views/StatusBarView.xaml:
--------------------------------------------------------------------------------
1 |
8 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
25 |
26 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/ScriptCsPad/Views/StatusBarView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace ScriptCsPad.Views
17 | {
18 | ///
19 | /// Interaction logic for StatusBar.xaml
20 | ///
21 | public partial class StatusBarView : UserControl
22 | {
23 | public StatusBarView()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ScriptCsPad/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------