├── .gitattributes
├── Documentation
└── images
│ ├── DocxToSourceIntro.gif
│ ├── DocxToSourceSyntax.gif
│ └── DocxToSourceNewLang.gif
├── .gitmodules
├── src
├── DocxToSource.Wpf
│ ├── App.config
│ ├── Properties
│ │ ├── Settings.settings
│ │ ├── Settings.Designer.cs
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── App.xaml.cs
│ ├── App.xaml
│ ├── packages.config
│ ├── MainWindow.xaml.cs
│ ├── Languages
│ │ ├── CSharpLanguageDefinition.cs
│ │ ├── VBLanguageDefinition.cs
│ │ ├── BooLanguageDefinition.cs
│ │ └── LanguageDefinition.cs
│ ├── Controls
│ │ ├── OpenXmlPackageTreeViewItem.cs
│ │ ├── OpenXmlTreeView.cs
│ │ ├── OpenXmlPartTreeViewItem.cs
│ │ ├── OpenXmlElementTreeViewItem.cs
│ │ └── OpenXmlTreeViewItem.cs
│ ├── MainWindow.xaml
│ ├── DocxToSource.Wpf.csproj
│ └── MainWindowModel.cs
└── DocxToSource
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── MainWindow.xaml.cs
│ ├── AssemblyInfo.cs
│ ├── DocxToSource.csproj
│ ├── Languages
│ ├── CSharpLanguageDefinition.cs
│ ├── VBLanguageDefinition.cs
│ └── LanguageDefinition.cs
│ ├── Controls
│ ├── OpenXmlPackageTreeViewItem.cs
│ ├── OpenXmlTreeView.cs
│ ├── OpenXmlPartTreeViewItem.cs
│ ├── OpenXmlElementTreeViewItem.cs
│ └── OpenXmlTreeViewItem.cs
│ ├── MainWindow.xaml
│ └── MainWindowModel.cs
├── .config
└── dotnet-tools.json
├── .editorconfig
├── README.md
├── LICENSE
├── .vscode
├── launch.json
└── tasks.json
├── DocxToSource.sln
└── .gitignore
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
--------------------------------------------------------------------------------
/Documentation/images/DocxToSourceIntro.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rmboggs/DocxToSource/HEAD/Documentation/images/DocxToSourceIntro.gif
--------------------------------------------------------------------------------
/Documentation/images/DocxToSourceSyntax.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rmboggs/DocxToSource/HEAD/Documentation/images/DocxToSourceSyntax.gif
--------------------------------------------------------------------------------
/Documentation/images/DocxToSourceNewLang.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rmboggs/DocxToSource/HEAD/Documentation/images/DocxToSourceNewLang.gif
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 |
2 | [submodule "src/Serialize.OpenXml.CodeGen"]
3 | path = src/Serialize.OpenXml.CodeGen
4 | url = https://github.com/Docx2Src/Serialize.OpenXml.CodeGen
5 |
--------------------------------------------------------------------------------
/src/DocxToSource.Wpf/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.config/dotnet-tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "isRoot": true,
4 | "tools": {
5 | "cake.tool": {
6 | "version": "1.3.0",
7 | "commands": [
8 | "dotnet-cake"
9 | ]
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/DocxToSource.Wpf/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # top-most EditorConfig file
2 | root = true
3 |
4 | # Unix-style newlines with a newline ending every file
5 | [*]
6 | end_of_line = lf
7 | trim_trailing_whitespace = true
8 | indent_style = space
9 |
10 | [*.ps1]
11 | indent_size = 2
12 |
13 | [*.{cs,cake,csproj}]
14 | indent_size = 4
15 |
--------------------------------------------------------------------------------
/src/DocxToSource/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/DocxToSource/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 DocxToSource
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/DocxToSource.Wpf/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 DocxToSource.Wpf
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/DocxToSource.Wpf/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/DocxToSource/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using ICSharpCode.AvalonEdit.Search;
2 | using System.Windows;
3 |
4 | namespace DocxToSource
5 | {
6 | ///
7 | /// Interaction logic for MainWindow.xaml
8 | ///
9 | public partial class MainWindow : Window
10 | {
11 | public MainWindow()
12 | {
13 | InitializeComponent();
14 | SearchPanel.Install(this.xXmlSourceEditor);
15 | SearchPanel.Install(this.xCodeSourceEditor);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/DocxToSource/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly:ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # DocxToSource
2 | A multi-platform application that will be able to generate dotnet source code based on OpenXml based documents. This is still a work in progress.
3 |
4 | An initial mockup using WPF technologies is working, albeit not yet fully functional. Screenshots below....
5 |
6 | Open an OpenXml based document:
7 | 
8 |
9 | Highlight Syntax:
10 | 
11 |
12 | Switch Language:
13 | 
14 |
--------------------------------------------------------------------------------
/src/DocxToSource.Wpf/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/DocxToSource.Wpf/MainWindow.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 DocxToSource.Wpf
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | ICSharpCode.AvalonEdit.Search.SearchPanel.Install(this.xXmlSourceEditor);
27 | ICSharpCode.AvalonEdit.Search.SearchPanel.Install(this.xCodeSourceEditor);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Ryan Boggs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/DocxToSource.Wpf/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
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 DocxToSource.Wpf.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 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to find out which attributes exist for C# debugging
3 | // Use hover for the description of the existing attributes
4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": ".NET Core Launch (console)",
9 | "type": "coreclr",
10 | "request": "launch",
11 | "preLaunchTask": "build",
12 | // If you have changed target frameworks, make sure to update the program path.
13 | "program": "${workspaceFolder}/src/DocxToSource.Avalonia/bin/Debug/netcoreapp3.0/DocxToSource.Avalonia.dll",
14 | "args": [],
15 | "cwd": "${workspaceFolder}/src/DocxToSource.Avalonia",
16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
17 | "console": "internalConsole",
18 | "stopAtEntry": false
19 | },
20 | {
21 | "name": ".NET Core Attach",
22 | "type": "coreclr",
23 | "request": "attach",
24 | "processId": "${command:pickProcess}"
25 | }
26 | ]
27 | }
--------------------------------------------------------------------------------
/src/DocxToSource/DocxToSource.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net6.0-windows
6 | true
7 | MIT
8 | Ryan Boggs
9 | Ryan Boggs
10 | https://github.com/rmboggs/docxtosource
11 | https://github.com/rmboggs/docxtosource
12 | git
13 | openxml;DocumentFormat
14 | 0.1.0-alpha
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "command": "dotnet",
7 | "type": "process",
8 | "args": [
9 | "build",
10 | "${workspaceFolder}/src/DocxToSource.Avalonia/DocxToSource.Avalonia.csproj",
11 | "/property:GenerateFullPaths=true",
12 | "/consoleloggerparameters:NoSummary"
13 | ],
14 | "problemMatcher": "$msCompile"
15 | },
16 | {
17 | "label": "publish",
18 | "command": "dotnet",
19 | "type": "process",
20 | "args": [
21 | "publish",
22 | "${workspaceFolder}/src/DocxToSource.Avalonia/DocxToSource.Avalonia.csproj",
23 | "/property:GenerateFullPaths=true",
24 | "/consoleloggerparameters:NoSummary"
25 | ],
26 | "problemMatcher": "$msCompile"
27 | },
28 | {
29 | "label": "watch",
30 | "command": "dotnet",
31 | "type": "process",
32 | "args": [
33 | "watch",
34 | "run",
35 | "${workspaceFolder}/src/DocxToSource.Avalonia/DocxToSource.Avalonia.csproj",
36 | "/property:GenerateFullPaths=true",
37 | "/consoleloggerparameters:NoSummary"
38 | ],
39 | "problemMatcher": "$msCompile"
40 | }
41 | ]
42 | }
--------------------------------------------------------------------------------
/src/DocxToSource/Languages/CSharpLanguageDefinition.cs:
--------------------------------------------------------------------------------
1 | /* MIT License
2 |
3 | Copyright (c) 2020 Ryan Boggs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this
6 | software and associated documentation files (the "Software"), to deal in the Software
7 | without restriction, including without limitation the rights to use, copy, modify,
8 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all copies
13 | or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
18 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | DEALINGS IN THE SOFTWARE.
21 | */
22 |
23 | using Microsoft.CSharp;
24 |
25 | namespace DocxToSource.Languages
26 | {
27 | ///
28 | /// Definition for the CSharp language.
29 | ///
30 | public class CSharpLanguageDefinition : LanguageDefinition
31 | {
32 | #region Public Constructors
33 |
34 | ///
35 | /// Initializes a new instance of the
36 | /// class that is empty.
37 | ///
38 | public CSharpLanguageDefinition() : base(new CSharpCodeProvider())
39 | {
40 | DisplayName = "C#";
41 | }
42 |
43 | #endregion
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/DocxToSource.Wpf/Languages/CSharpLanguageDefinition.cs:
--------------------------------------------------------------------------------
1 | /* MIT License
2 |
3 | Copyright (c) 2020 Ryan Boggs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this
6 | software and associated documentation files (the "Software"), to deal in the Software
7 | without restriction, including without limitation the rights to use, copy, modify,
8 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all copies
13 | or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
18 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | DEALINGS IN THE SOFTWARE.
21 | */
22 |
23 | using Microsoft.CSharp;
24 |
25 | namespace DocxToSource.Wpf.Languages
26 | {
27 | ///
28 | /// Definition for the CSharp language.
29 | ///
30 | public class CSharpLanguageDefinition : LanguageDefinition
31 | {
32 | #region Public Constructors
33 |
34 | ///
35 | /// Initializes a new instance of the
36 | /// class that is empty.
37 | ///
38 | public CSharpLanguageDefinition() : base(new CSharpCodeProvider())
39 | {
40 | DisplayName = "C#";
41 | }
42 |
43 | #endregion
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/DocxToSource/Languages/VBLanguageDefinition.cs:
--------------------------------------------------------------------------------
1 | /* MIT License
2 |
3 | Copyright (c) 2020 Ryan Boggs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this
6 | software and associated documentation files (the "Software"), to deal in the Software
7 | without restriction, including without limitation the rights to use, copy, modify,
8 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all copies
13 | or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
18 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | DEALINGS IN THE SOFTWARE.
21 | */
22 |
23 | using Microsoft.VisualBasic;
24 |
25 | namespace DocxToSource.Languages
26 | {
27 | ///
28 | /// Definition for the Visual Basic.net language.
29 | ///
30 | public class VBLanguageDefinition : LanguageDefinition
31 | {
32 | #region Public Constructors
33 |
34 | ///
35 | /// Initializes a new instance of the
36 | /// class that is empty.
37 | ///
38 | public VBLanguageDefinition() : base(new VBCodeProvider())
39 | {
40 | DisplayName = "Visual Basic.Net";
41 | }
42 |
43 | #endregion
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/DocxToSource.Wpf/Languages/VBLanguageDefinition.cs:
--------------------------------------------------------------------------------
1 | /* MIT License
2 |
3 | Copyright (c) 2020 Ryan Boggs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this
6 | software and associated documentation files (the "Software"), to deal in the Software
7 | without restriction, including without limitation the rights to use, copy, modify,
8 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all copies
13 | or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
18 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | DEALINGS IN THE SOFTWARE.
21 | */
22 |
23 | using Microsoft.VisualBasic;
24 |
25 | namespace DocxToSource.Wpf.Languages
26 | {
27 | ///
28 | /// Definition for the Visual Basic.net language.
29 | ///
30 | public class VBLanguageDefinition : LanguageDefinition
31 | {
32 | #region Public Constructors
33 |
34 | ///
35 | /// Initializes a new instance of the
36 | /// class that is empty.
37 | ///
38 | public VBLanguageDefinition() : base(new VBCodeProvider())
39 | {
40 | DisplayName = "Visual Basic.Net";
41 | }
42 |
43 | #endregion
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/DocxToSource.Wpf/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("DocxToSource.Wpf")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("DocxToSource.Wpf")]
15 | [assembly: AssemblyCopyright("Copyright © 2020")]
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 |
--------------------------------------------------------------------------------
/src/DocxToSource.Wpf/Languages/BooLanguageDefinition.cs:
--------------------------------------------------------------------------------
1 | /* MIT License
2 |
3 | Copyright (c) 2020 Ryan Boggs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this
6 | software and associated documentation files (the "Software"), to deal in the Software
7 | without restriction, including without limitation the rights to use, copy, modify,
8 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all copies
13 | or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
18 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | DEALINGS IN THE SOFTWARE.
21 | */
22 |
23 | using Boo.Lang.CodeDom;
24 | using Serialize.OpenXml.CodeGen;
25 |
26 | namespace DocxToSource.Wpf.Languages
27 | {
28 | ///
29 | /// Definition of the Boo language.
30 | ///
31 | public class BooLanguageDefinition : LanguageDefinition
32 | {
33 | #region Public Constructors
34 |
35 | ///
36 | /// Initializes a new instance of the class
37 | /// that is empty.
38 | ///
39 | public BooLanguageDefinition()
40 | : base(new BooNamespaceAliasOptions(), new BooCodeProvider())
41 | {
42 | DisplayName = "Boo";
43 | }
44 |
45 | #endregion
46 |
47 | ///
48 | /// Custom needed for the Boo language.
49 | ///
50 | private sealed class BooNamespaceAliasOptions : NamespaceAliasOptions
51 | {
52 | #region Public Constructors
53 |
54 | ///
55 | /// Initializes a new instance of the
56 | /// class that is empty.
57 | ///
58 | public BooNamespaceAliasOptions() : base()
59 | {
60 | Order = NamespaceAliasOrder.NamespaceFirst;
61 | AssignmentOperator = "as";
62 | }
63 |
64 | #endregion
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/DocxToSource/Controls/OpenXmlPackageTreeViewItem.cs:
--------------------------------------------------------------------------------
1 | /* MIT License
2 |
3 | Copyright (c) 2020 Ryan Boggs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this
6 | software and associated documentation files (the "Software"), to deal in the Software
7 | without restriction, including without limitation the rights to use, copy, modify,
8 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all copies
13 | or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
18 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | DEALINGS IN THE SOFTWARE.
21 | */
22 |
23 | using DocumentFormat.OpenXml.Packaging;
24 | using Serialize.OpenXml.CodeGen;
25 | using System.CodeDom.Compiler;
26 | using System.Collections.Generic;
27 | using System.Linq;
28 |
29 | namespace DocxToSource.Controls
30 | {
31 | ///
32 | /// derived class that contains information
33 | /// about a given object.
34 | ///
35 | public class OpenXmlPackageTreeViewItem : OpenXmlTreeViewItem
36 | {
37 | #region Private Instance Fields
38 |
39 | ///
40 | /// Holds the OpenXmlPackage that is currently open.
41 | ///
42 | private readonly OpenXmlPackage _package;
43 |
44 | #endregion
45 |
46 | #region Public Constructors
47 |
48 | ///
49 | /// Initializes a new instance of the class
50 | /// that is empty.
51 | ///
52 | public OpenXmlPackageTreeViewItem(OpenXmlPackage pkg)
53 | : base(pkg.Parts != null && pkg.Parts.Any()) { _package = pkg; }
54 |
55 | #endregion
56 |
57 | #region Public Instance Methods
58 |
59 | ///
60 | public override string BuildCodeDomTextDocument(CodeDomProvider provider)
61 | {
62 | return _package.GenerateSourceCode(provider);
63 | }
64 |
65 | #endregion
66 |
67 | #region Protected Instance Methods
68 |
69 | ///
70 | protected override IEnumerable GetOpenXmlSubtreeItems()
71 | {
72 | return _package.Parts is null ? null : BuildOpenXmlPartTreeViewItems(_package.Parts);
73 | }
74 |
75 | #endregion
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/DocxToSource.Wpf/Controls/OpenXmlPackageTreeViewItem.cs:
--------------------------------------------------------------------------------
1 | /* MIT License
2 |
3 | Copyright (c) 2020 Ryan Boggs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this
6 | software and associated documentation files (the "Software"), to deal in the Software
7 | without restriction, including without limitation the rights to use, copy, modify,
8 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all copies
13 | or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
18 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | DEALINGS IN THE SOFTWARE.
21 | */
22 |
23 | using DocumentFormat.OpenXml.Packaging;
24 | using Serialize.OpenXml.CodeGen;
25 | using System.CodeDom.Compiler;
26 | using System.Collections.Generic;
27 | using System.Linq;
28 |
29 | namespace DocxToSource.Wpf.Controls
30 | {
31 | ///
32 | /// derived class that contains information
33 | /// about a given object.
34 | ///
35 | public class OpenXmlPackageTreeViewItem : OpenXmlTreeViewItem
36 | {
37 | #region Private Instance Fields
38 |
39 | ///
40 | /// Holds the OpenXmlPackage that is currently open.
41 | ///
42 | private readonly OpenXmlPackage _package;
43 |
44 | #endregion
45 |
46 | #region Public Constructors
47 |
48 | ///
49 | /// Initializes a new instance of the class
50 | /// that is empty.
51 | ///
52 | public OpenXmlPackageTreeViewItem(OpenXmlPackage pkg)
53 | : base(pkg.Parts != null && pkg.Parts.Count() > 0) { _package = pkg; }
54 |
55 | #endregion
56 |
57 | #region Public Instance Methods
58 |
59 | ///
60 | public override string BuildCodeDomTextDocument(CodeDomProvider provider)
61 | {
62 | return _package.GenerateSourceCode(provider);
63 | }
64 |
65 | #endregion
66 |
67 | #region Protected Instance Methods
68 |
69 | ///
70 | protected override IEnumerable GetOpenXmlSubtreeItems()
71 | {
72 | if (_package.Parts is null) return null;
73 | return BuildOpenXmlPartTreeViewItems(_package.Parts);
74 | }
75 |
76 | #endregion
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/DocxToSource.Wpf/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
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 DocxToSource.Wpf.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("DocxToSource.Wpf.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 |
--------------------------------------------------------------------------------
/src/DocxToSource/Controls/OpenXmlTreeView.cs:
--------------------------------------------------------------------------------
1 | /* MIT License
2 |
3 | Copyright (c) 2020 Ryan Boggs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this
6 | software and associated documentation files (the "Software"), to deal in the Software
7 | without restriction, including without limitation the rights to use, copy, modify,
8 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all copies
13 | or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
18 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | DEALINGS IN THE SOFTWARE.
21 | */
22 |
23 | using System.Windows;
24 | using System.Windows.Controls;
25 |
26 | namespace DocxToSource.Controls
27 | {
28 | ///
29 | /// A subclass of the default wpf designed
30 | /// specifically for objects from the DocumentFormat.OpenXml library.
31 | ///
32 | public class OpenXmlTreeView : TreeView
33 | {
34 | #region Public Static Fields
35 |
36 | ///
37 | /// Static dependency property handler for the SelectedTreeItem property.
38 | ///
39 | public static readonly DependencyProperty SelectedItem_Property =
40 | DependencyProperty.Register("SelectedTreeItem", typeof(object),
41 | typeof(OpenXmlTreeView), new UIPropertyMetadata(null));
42 |
43 | #endregion
44 |
45 | #region Public Constructors
46 |
47 | ///
48 | /// Initializes a new instance of the class that
49 | /// is empty.
50 | ///
51 | public OpenXmlTreeView() : base()
52 | {
53 | SelectedItemChanged +=
54 | new RoutedPropertyChangedEventHandler