├── .gitattributes
├── .gitignore
├── LICENSE.md
├── README.md
├── Source
├── ExcelDnaHost
│ ├── AddInDna.master
│ ├── AddInLoader.cs
│ ├── AddInXll.master
│ ├── DteHelper.cs
│ ├── ExcelDnaHost-AddIn.dna
│ ├── ExcelDnaHost.csproj
│ ├── MsdevManager.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Ribbon.cs
│ ├── VsConnection.cs
│ ├── VsIde.cs
│ ├── VsLink.cs
│ ├── VsLinkMessage.cs
│ ├── VsLinkServer.cs
│ └── packages.config
├── ExcelDnaTools.sln
└── ExcelDnaTools
│ ├── DebugManager.cs
│ ├── ExcelConnection.cs
│ ├── ExcelDnaTools.csproj
│ ├── ExcelDnaTools.vsct
│ ├── ExcelDnaToolsPackage.cs
│ ├── GlobalSuppressions.cs
│ ├── Guids.cs
│ ├── Key.snk
│ ├── MyControl.xaml
│ ├── MyControl.xaml.cs
│ ├── MyToolWindow.cs
│ ├── Notes.txt
│ ├── PkgCmdID.cs
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Resources
│ ├── Images.png
│ └── Package.ico
│ ├── SolutionHelper.cs
│ ├── VSPackage.resx
│ ├── VsLinkClient.cs
│ └── source.extension.vsixmanifest
└── XmlSchemas
├── ExcelDna.DnaLibrary.xsd
├── ExcelDnaCatalog.xml
├── ExcelDnaSmall.ico
├── Properties
└── AssemblyInfo.cs
├── XmlSchemas.csproj
├── XmlSchemas.sln
├── customUI.xsd
├── customui14.xsd
└── source.extension.vsixmanifest
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore temporary files created to run ExcelDna integration tests
2 | Source/Tests/.exceldna.addin/
3 | Source/Tests/ExcelDna.AddIn.Tasks.IntegrationTests.TestTarget/out/
4 |
5 | ## Ignore Visual Studio temporary files, build results, and
6 | ## files generated by popular Visual Studio add-ons.
7 |
8 | # User-specific files
9 | .vs/
10 | *.suo
11 | *.user
12 | *.sln.docstates
13 | *.xll
14 |
15 | # Build results
16 |
17 | [Dd]ebug/
18 | [Rr]elease/
19 | [Dd]ebug64/
20 | [Rr]elease64/
21 | x64/
22 | build/
23 | [Bb]in/
24 | [Oo]bj/
25 | Package/nupkg/
26 |
27 | # Ignore NuGet Packages
28 | *.nupkg
29 | **/packages/*
30 |
31 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
32 | !packages/*/build/
33 | !Package/*/build/
34 |
35 | # MSTest test Results
36 | [Tt]est[Rr]esult*/
37 | [Bb]uild[Ll]og.*
38 |
39 | *_i.c
40 | *_p.c
41 | *.ilk
42 | *.meta
43 | *.obj
44 | *.pch
45 | *.pgc
46 | *.pgd
47 | *.rsp
48 | *.sbr
49 | *.tlb
50 | *.tli
51 | *.tlh
52 | *.tmp
53 | *.tmp_proj
54 | *.log
55 | *.vspscc
56 | *.vssscc
57 | .builds
58 | *.pidb
59 | *.log
60 | *.scc
61 |
62 | # Visual C++ cache files
63 | ipch/
64 | *.aps
65 | *.ncb
66 | *.opensdf
67 | *.sdf
68 | *.cachefile
69 | *.VC.opendb
70 | *.VC.db
71 |
72 | # Visual Studio profiler
73 | *.psess
74 | *.vsp
75 | *.vspx
76 |
77 | # Guidance Automation Toolkit
78 | *.gpState
79 |
80 | # ReSharper is a .NET coding add-in
81 | _ReSharper*/
82 | *.[Rr]e[Ss]harper
83 |
84 | # TeamCity is a build add-in
85 | _TeamCity*
86 |
87 | # DotCover is a Code Coverage Tool
88 | *.dotCover
89 |
90 | # NCrunch
91 | *.ncrunch*
92 | .*crunch*.local.xml
93 |
94 | # Installshield output folder
95 | [Ee]xpress/
96 |
97 | # DocProject is a documentation generator add-in
98 | DocProject/buildhelp/
99 | DocProject/Help/*.HxT
100 | DocProject/Help/*.HxC
101 | DocProject/Help/*.hhc
102 | DocProject/Help/*.hhk
103 | DocProject/Help/*.hhp
104 | DocProject/Help/Html2
105 | DocProject/Help/html
106 |
107 | # Click-Once directory
108 | publish/
109 |
110 | # Publish Web Output
111 | *.Publish.xml
112 |
113 | # NuGet Packages Directory
114 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
115 | #packages/
116 |
117 | # Windows Azure Build Output
118 | csx
119 | *.build.csdef
120 |
121 | # Windows Store app package directory
122 | AppPackages/
123 |
124 | # Others
125 | sql/
126 | *.Cache
127 | ClientBin/
128 | [Ss]tyle[Cc]op.*
129 | ~$*
130 | *~
131 | *.dbmdl
132 | *.[Pp]ublish.xml
133 | *.pfx
134 | *.publishsettings
135 |
136 | # RIA/Silverlight projects
137 | Generated_Code/
138 |
139 | # Backup & report files from converting an old project file to a newer
140 | # Visual Studio version. Backup files are not needed, because we have git ;-)
141 | _UpgradeReport_Files/
142 | Backup*/
143 | UpgradeLog*.XML
144 | UpgradeLog*.htm
145 |
146 | # SQL Server files
147 | App_Data/*.mdf
148 | App_Data/*.ldf
149 |
150 |
151 | #LightSwitch generated files
152 | GeneratedArtifacts/
153 | _Pvt_Extensions/
154 | ModelManifest.xml
155 |
156 | # =========================
157 | # Windows detritus
158 | # =========================
159 |
160 | # Windows image file caches
161 | Thumbs.db
162 | ehthumbs.db
163 |
164 | # Folder config file
165 | Desktop.ini
166 |
167 | # Recycle Bin used on file shares
168 | $RECYCLE.BIN/
169 |
170 | # Mac desktop service store files
171 | .DS_Store
172 | /Source/Tests/ExcelDna.AddIn.Tasks.IntegrationTests.TestTarget/MultipleAddInBuild/MultipleAddInProjectOne.dll
173 | /Source/Tests/ExcelDna.AddIn.Tasks.IntegrationTests.TestTarget/MultipleAddInBuild/MultipleAddInProjectOne.pdb
174 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Govert van Drimmelen
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Visual Studio Tools for Excel-DNA
2 | =================================
3 |
4 | Visual Studio Tools for Excel-DNA is a Visual Studio extension (targeting VS 2012 Professional and better) to assist in the development of Excel-DNA add-ins for Excel.
5 |
6 | The aims is to enable VBA users to move to .NET (with Excel-DNA) more easily, without reinventing the IDE.
7 |
8 | Current Status
9 | --------------
10 |
11 | We're exploring some ideas...
12 |
13 | License
14 | -------
15 |
16 | Visual Studio Tools for Excel-DNA is licensed under the MIT license.
17 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/AddInDna.master:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/AddInLoader.cs:
--------------------------------------------------------------------------------
1 | using ExcelDna.Integration;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace ExcelDna.ExcelDnaTools
10 | {
11 | class AddInLoader
12 | {
13 | // Puts an .xll next to the .dll, together with a trivial .dna file, and loads as an add-in into Excel
14 | // CONSIDER: Keep track of what we change in the directory, so we can clean up when unloading.
15 | // CONSIDER: Should Excel-DNA support setting the BaseDirectory explicitly, so that we would not need to copy the .xll into the project output directory.
16 | // TODO: Put the templates into a resource, or build from scratch using the executing .xll, or something.
17 | // TODO: 64-bit support
18 | // TODO: Only do this the first time...?
19 | public static void RegisterDll(string addInPath)
20 | {
21 | var xllDirectory = Path.GetDirectoryName(ExcelDnaUtil.XllPath);
22 | var masterXllPath = Path.Combine(xllDirectory, "AddInXll.master");
23 | var masterDnaPath = Path.Combine(xllDirectory, "AddInDna.master");
24 |
25 | var addInDirectory = Path.GetDirectoryName(addInPath);
26 | var externalLibraryPath = Path.GetFileName(addInPath);
27 | var addInXllPath = Path.Combine(addInDirectory, Path.ChangeExtension(externalLibraryPath, "xll"));
28 | var addInDnaPath = Path.ChangeExtension(addInXllPath, "dna");
29 |
30 | if (!File.Exists(addInXllPath))
31 | {
32 | File.Copy(masterXllPath, addInXllPath, false);
33 | }
34 | if (!File.Exists(addInDnaPath))
35 | {
36 | File.Copy(masterDnaPath, addInDnaPath, false);
37 | var dnaContent = File.ReadAllText(addInDnaPath);
38 | dnaContent = dnaContent.Replace("%AddIn_Path%", externalLibraryPath);
39 | File.WriteAllText(addInDnaPath, dnaContent);
40 | }
41 |
42 | ExcelIntegration.RegisterXLL(addInXllPath);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/AddInXll.master:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Excel-DNA/VSExcel/aa85e670e9a063c9167b5fbf99660d6759ce5763/Source/ExcelDnaHost/AddInXll.master
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/DteHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 |
7 | namespace AppToolsHost
8 | {
9 | // This code from: http://www.codeproject.com/Articles/7984/Automating-a-specific-instance-of-Visual-Studio-NE
10 | // By Mohamed Hendawi
11 | class DteHelper
12 | {
13 | [DllImport("user32.dll")]
14 | private static extern bool SetForegroundWindow(IntPtr hWnd);
15 |
16 | private const int SW_RESTORE = 9;
17 | [DllImport("user32.dll")]
18 | private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
19 |
20 | [DllImport("user32.dll")]
21 | private static extern bool IsIconic(IntPtr hWnd);
22 |
23 | ///
24 | /// Raises an instance of the Visual Studio IDE to the foreground.
25 | ///
26 | /// The DTE object for the IDE you
27 | /// would like to raise to the foreground
28 |
29 | public static void ShowIDE(EnvDTE.DTE ide)
30 | {
31 | // To show an existing IDE, we get the HWND for the MainWindow
32 | // and do a little interop to bring the desired IDE to the
33 | // foreground. I tried some of the following other potentially
34 | // promising approaches but could only succeed in getting the
35 | // IDE's taskbar button to flash (this is as designed). Ex:
36 | //
37 | // ide.MainWindow.Activate();
38 | // ide.MainWindow.SetFocus();
39 | // ide.MainWindow.Visible = true;
40 | // ide.MainWindow.WindowState = EnvDTE.vsWindowState.vsWindowStateMinimize;
41 | // ide.MainWindow.WindowState = EnvDTE.vsWindowState.vsWindowStateMaximize;
42 |
43 | System.IntPtr hWnd = (System.IntPtr)ide.MainWindow.HWnd;
44 | if (IsIconic(hWnd))
45 | {
46 | ShowWindowAsync(hWnd, SW_RESTORE);
47 | }
48 | SetForegroundWindow(hWnd);
49 | ide.MainWindow.Visible = true;
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/ExcelDnaHost-AddIn.dna:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/ExcelDnaHost.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {664F7E0C-6316-4E35-86FC-2D6E28F583B8}
8 | Library
9 | Properties
10 | ExcelDna.ExcelDnaTools
11 | ExcelDnaHost
12 | v4.5
13 | 512
14 |
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 | false
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 | false
34 |
35 |
36 |
37 | True
38 |
39 |
40 | ..\packages\Excel-DNA.Lib.0.32.0\lib\ExcelDna.Integration.dll
41 | False
42 |
43 |
44 | True
45 | True
46 | ..\packages\Excel-DNA.Interop.14.0.1\lib\Microsoft.Office.Interop.Excel.dll
47 |
48 |
49 | True
50 | True
51 | ..\packages\Excel-DNA.Interop.14.0.1\lib\Microsoft.Vbe.Interop.dll
52 |
53 |
54 | True
55 | True
56 | ..\packages\Excel-DNA.Interop.14.0.1\lib\Office.dll
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | PreserveNewest
81 |
82 |
83 | PreserveNewest
84 | ASPXCodeBehind
85 |
86 |
87 | PreserveNewest
88 |
89 |
90 |
91 |
92 |
93 | xcopy "C:\Work\ExcelDna\ExcelDnaTools\Source\packages\Excel-DNA.0.32.0\tools\ExcelDna.xll" "$(TargetDir)ExcelDnaHost-AddIn.xll*" /C /Y
94 | xcopy "$(TargetDir)ExcelDnaHost-AddIn.dna*" "$(TargetDir)ExcelDnaHost-AddIn64.dna*" /C /Y
95 | xcopy "C:\Work\ExcelDna\ExcelDnaTools\Source\packages\Excel-DNA.0.32.0\tools\ExcelDna64.xll" "$(TargetDir)ExcelDnaHost-AddIn64.xll*" /C /Y
96 | "C:\Work\ExcelDna\ExcelDnaTools\Source\packages\Excel-DNA.0.32.0\tools\ExcelDnaPack.exe" "$(TargetDir)ExcelDnaHost-AddIn.dna" /Y
97 | "C:\Work\ExcelDna\ExcelDnaTools\Source\packages\Excel-DNA.0.32.0\tools\ExcelDnaPack.exe" "$(TargetDir)ExcelDnaHost-AddIn64.dna" /Y
98 |
99 |
106 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/MsdevManager.cs:
--------------------------------------------------------------------------------
1 | // This code is from the CodeProject article: http://www.codeproject.com/Articles/7984/Automating-a-specific-instance-of-Visual-Studio-NE
2 | // by Mohamed Hendawi. (Thank you!)
3 |
4 | using System;
5 | using System.Collections;
6 | using System.ComponentModel;
7 | using System.Runtime.InteropServices;
8 | using System.Threading;
9 | using EnvDTE;
10 | using Microsoft.Win32;
11 |
12 | namespace MsdevManager
13 | {
14 | ///
15 | /// Utility class to get you a list of the running instances of the Microsoft Visual
16 | /// Studio IDE. The list is obtained by looking at the system's Running Object Table (ROT)
17 | ///
18 | ///
19 | /// Other ways to get a pointer to a VisualStudio instance:
20 | ///
21 | /// EnvDTE.DTE dte = (EnvDTE.DTE) System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.7.1");
22 |
23 | public class Msdev
24 | {
25 | #region Interop imports
26 |
27 | [DllImport("ole32.dll")]
28 | public static extern int GetRunningObjectTable(int reserved, out UCOMIRunningObjectTable prot);
29 |
30 | [DllImport("ole32.dll")]
31 | public static extern int CreateBindCtx(int reserved, out UCOMIBindCtx ppbc);
32 |
33 | [DllImport("user32.dll")]
34 | private static extern bool SetForegroundWindow(IntPtr hWnd);
35 |
36 | private const int SW_RESTORE = 9;
37 | [DllImport("user32.dll")]
38 | private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
39 |
40 | [DllImport("user32.dll")]
41 | private static extern bool IsIconic(IntPtr hWnd);
42 |
43 | #endregion
44 |
45 | ///
46 | /// Get the DTE object for the instance of Visual Studio IDE that has
47 | /// the specified solution open.
48 | ///
49 | /// The absolute filename of the solution
50 | /// Corresponding DTE object or null if no such IDE is running
51 | public static EnvDTE.DTE GetIDEInstance(string solutionFile)
52 | {
53 | Hashtable runningInstances = GetIDEInstances(true);
54 | IDictionaryEnumerator enumerator = runningInstances.GetEnumerator();
55 |
56 | while (enumerator.MoveNext())
57 | {
58 | try
59 | {
60 | _DTE ide = (_DTE)enumerator.Value;
61 | if (ide != null)
62 | {
63 | if (ide.Solution.FullName == solutionFile)
64 | {
65 | return (EnvDTE.DTE)ide;
66 | }
67 | }
68 | }
69 | catch { }
70 | }
71 |
72 | return null;
73 | }
74 |
75 | ///
76 | /// Raises an instance of the Visual Studio IDE to the foreground.
77 | ///
78 | /// The DTE object for the IDE you would like to raise to the foreground
79 | public static void ShowIDE(EnvDTE.DTE ide)
80 | {
81 | // To show an existing IDE, we get the HWND for the MainWindow
82 | // and do a little interop to bring the desired IDE to the
83 | // foreground. I tried some of the following other potentially
84 | // promising approaches but could only succeed in getting the
85 | // IDE's taskbar button to flash. Ex:
86 | //
87 | // ide.MainWindow.Activate();
88 | // ide.MainWindow.SetFocus();
89 | // ide.MainWindow.Visible = true;
90 | // ide.MainWindow.WindowState = EnvDTE.vsWindowState.vsWindowStateMinimize;
91 | // ide.MainWindow.WindowState = EnvDTE.vsWindowState.vsWindowStateMaximize;
92 |
93 | System.IntPtr hWnd = (System.IntPtr)ide.MainWindow.HWnd;
94 | if (IsIconic(hWnd))
95 | {
96 | ShowWindowAsync(hWnd, SW_RESTORE);
97 | }
98 | SetForegroundWindow(hWnd);
99 | ide.MainWindow.Visible = true;
100 | }
101 |
102 | public static void ShowIDE(string solutionFile)
103 | {
104 | EnvDTE.DTE ide = Msdev.GetIDEInstance(solutionFile);
105 | if (ide != null)
106 | {
107 | ShowIDE(ide);
108 | }
109 | else
110 | {
111 | // To create a new instance of the IDE, opened to the selected solution we
112 | // could try:
113 | //
114 | // Type dteType = Type.GetTypeFromProgID("VisualStudio.DTE.7.1");
115 | // EnvDTE.DTE dte = Activator.CreateInstance(dteType) as EnvDTE.DTE;
116 | // dte.MainWindow.WindowState = EnvDTE.vsWindowState.vsWindowStateMaximize;
117 | // dte.MainWindow.Visible = true;
118 | // dte.Solution.Open( solutionFile.Filename );
119 | //
120 | // This works but the new devenv.exe process does not exit when you close the
121 | // IDE. You could then just reattach as described and the closed IDE would
122 | // quickly redisplay (possibly useful as a feature).
123 | //
124 | // Instead we lookup the path to the IDE executable in the registry and
125 | // just start another process.
126 |
127 | RegistryKey devKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VS");
128 | string idePath = (string)devKey.GetValue("EnvironmentPath");
129 |
130 | System.Diagnostics.Process p = new System.Diagnostics.Process();
131 | p.StartInfo.RedirectStandardOutput = false;
132 | p.StartInfo.Arguments = solutionFile;
133 | p.StartInfo.FileName = idePath;
134 | p.StartInfo.UseShellExecute = true;
135 | p.Start();
136 | }
137 | }
138 |
139 | ///
140 | /// Get a table of the currently running instances of the Visual Studio .NET IDE.
141 | ///
142 | /// Only return instances that have opened a solution
143 | /// A hashtable mapping the name of the IDE in the running object table to the corresponding DTE object
144 | public static Hashtable GetIDEInstances(bool openSolutionsOnly)
145 | {
146 | Hashtable runningIDEInstances = new Hashtable();
147 | Hashtable runningObjects = GetRunningObjectTable();
148 |
149 | IDictionaryEnumerator rotEnumerator = runningObjects.GetEnumerator();
150 | while (rotEnumerator.MoveNext())
151 | {
152 | string candidateName = (string)rotEnumerator.Key;
153 | if (!candidateName.StartsWith("!VisualStudio.DTE"))
154 | continue;
155 |
156 | _DTE ide = rotEnumerator.Value as _DTE;
157 | if (ide == null)
158 | continue;
159 |
160 | if (openSolutionsOnly)
161 | {
162 | try
163 | {
164 | string solutionFile = ide.Solution.FullName;
165 | if (solutionFile != String.Empty)
166 | {
167 | runningIDEInstances[candidateName] = ide;
168 | }
169 | }
170 | catch { }
171 | }
172 | else
173 | {
174 | runningIDEInstances[candidateName] = ide;
175 | }
176 | }
177 | return runningIDEInstances;
178 | }
179 |
180 | ///
181 | /// Get a snapshot of the running object table (ROT).
182 | ///
183 | /// A hashtable mapping the name of the object in the ROT to the corresponding object
184 | [STAThread]
185 | public static Hashtable GetRunningObjectTable()
186 | {
187 | Hashtable result = new Hashtable();
188 |
189 | int numFetched;
190 | UCOMIRunningObjectTable runningObjectTable;
191 | UCOMIEnumMoniker monikerEnumerator;
192 | UCOMIMoniker[] monikers = new UCOMIMoniker[1];
193 |
194 | GetRunningObjectTable(0, out runningObjectTable);
195 | runningObjectTable.EnumRunning(out monikerEnumerator);
196 | monikerEnumerator.Reset();
197 |
198 | while (monikerEnumerator.Next(1, monikers, out numFetched) == 0)
199 | {
200 | UCOMIBindCtx ctx;
201 | CreateBindCtx(0, out ctx);
202 |
203 | string runningObjectName;
204 | monikers[0].GetDisplayName(ctx, null, out runningObjectName);
205 |
206 | object runningObjectVal;
207 | runningObjectTable.GetObject(monikers[0], out runningObjectVal);
208 |
209 | result[runningObjectName] = runningObjectVal;
210 | }
211 |
212 | return result;
213 | }
214 |
215 | public static bool CompareInstances(Hashtable instances1, Hashtable instances2)
216 | {
217 | bool changed = false;
218 | foreach (string instances1Key in instances1.Keys)
219 | {
220 | if (!instances2.ContainsKey(instances1Key))
221 | {
222 | changed = true;
223 | break;
224 | }
225 | }
226 |
227 | if (!changed)
228 | {
229 | foreach (string instances2Key in instances2.Keys)
230 | {
231 | if (!instances1.ContainsKey(instances2Key))
232 | {
233 | changed = true;
234 | break;
235 | }
236 | }
237 | }
238 |
239 | return changed;
240 | }
241 | }
242 |
243 | public class MsdevMonitorThread
244 | {
245 | public delegate void MonitorMsdevHandler();
246 | public event MonitorMsdevHandler Changed;
247 |
248 | private System.Threading.Thread m_thread = null;
249 | private ISynchronizeInvoke m_invokeObject = null;
250 | private int m_period = 2000;
251 | private bool m_isRunning = false;
252 | private bool m_openSolutionsOnly = false;
253 |
254 | public MsdevMonitorThread(ISynchronizeInvoke invokeObject, bool openSolutionsOnly)
255 | {
256 | m_invokeObject = invokeObject;
257 | m_openSolutionsOnly = openSolutionsOnly;
258 | }
259 |
260 | ~MsdevMonitorThread()
261 | {
262 | Stop();
263 | }
264 |
265 | public void Start()
266 | {
267 | m_isRunning = true;
268 | if (m_thread == null)
269 | m_thread = new System.Threading.Thread(new ThreadStart(ThreadMain));
270 | m_thread.Start();
271 | }
272 |
273 | public void Stop()
274 | {
275 | m_isRunning = false;
276 | m_thread = null;
277 | }
278 |
279 | private void ThreadMain()
280 | {
281 | // Take a snapshot of the currently running instances of Visual Studio
282 | // We'll also separately keep track of the solution files that each
283 | // instance has open at this time. We'll use it to detect when an
284 | // IDE has loaded or unloaded a solution.
285 |
286 | Hashtable snapshotInstances = Msdev.GetIDEInstances(m_openSolutionsOnly);
287 | Hashtable snapshotSolutions = new Hashtable();
288 | foreach (string snapshotKey in snapshotInstances.Keys)
289 | {
290 | string solutionFile = String.Empty;
291 | try
292 | {
293 | EnvDTE.DTE ide = (EnvDTE.DTE)snapshotInstances[snapshotKey];
294 | solutionFile = ide.Solution.FullName;
295 | }
296 | catch { }
297 |
298 | snapshotSolutions[snapshotKey] = solutionFile;
299 | }
300 |
301 | // We'll just keep looping in this thread, periodically checking the
302 | // currently running list of IDE's. If there is any change we'll
303 | // raise a Changed event.
304 |
305 | while (m_isRunning)
306 | {
307 | System.Threading.Thread.Sleep(m_period);
308 | if (Changed != null)
309 | {
310 | Hashtable currentInstances = Msdev.GetIDEInstances(m_openSolutionsOnly);
311 | bool changed = Msdev.CompareInstances(snapshotInstances, currentInstances);
312 | if (changed)
313 | {
314 | m_invokeObject.BeginInvoke(Changed, null);
315 | snapshotInstances = currentInstances;
316 | }
317 | else
318 | {
319 | foreach (string currentKey in currentInstances.Keys)
320 | {
321 | string prevSolutionFile = (string)snapshotSolutions[currentKey];
322 | string currentSolutionFile = String.Empty;
323 | try
324 | {
325 | EnvDTE.DTE ide = (EnvDTE.DTE)currentInstances[currentKey];
326 | currentSolutionFile = ide.Solution.FullName;
327 | }
328 | catch { }
329 | if (prevSolutionFile != currentSolutionFile)
330 | {
331 | m_invokeObject.BeginInvoke(Changed, null);
332 | snapshotInstances = currentInstances;
333 | snapshotSolutions[currentKey] = currentSolutionFile;
334 | break;
335 | }
336 | }
337 | }
338 | }
339 | }
340 | }
341 | }
342 | }
343 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ExcelDnaHost")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ExcelDnaHost")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("c0c944c1-e478-460a-ac79-9ee89f96e821")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/Ribbon.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Runtime.InteropServices;
4 | using System.Linq;
5 | using System.Text;
6 | using ExcelDna.Integration;
7 | using ExcelDna.Integration.CustomUI;
8 |
9 | namespace ExcelDna.ExcelDnaTools
10 | {
11 | [ComVisible(true)]
12 | public class Ribbon : ExcelRibbon
13 | {
14 | public override string GetCustomUI(string RibbonID)
15 | {
16 | // string tabLabel = ExcelDnaUtil.ExcelVersion >= 15.0 ? "EXCEL-DNA" : "Excel-DNA";
17 | return
18 | @"
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | ";
31 | }
32 |
33 | public string GetLabel(IRibbonControl control)
34 | {
35 | return ExcelDnaUtil.ExcelVersion >= 15.0 ? "EXCEL-DNA" : "Excel-DNA";
36 | }
37 |
38 | public void OnShowIde(IRibbonControl control)
39 | {
40 | VsConnection.Show();
41 | }
42 |
43 | public void OnHideIde(IRibbonControl control)
44 | {
45 | VsConnection.Hide();
46 | }
47 |
48 | public void OnShutdownIde(IRibbonControl control)
49 | {
50 | VsConnection.Shutdown();
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/VsConnection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using ExcelDna.Integration;
6 | using Microsoft.Office.Interop.Excel;
7 |
8 | namespace ExcelDna.ExcelDnaTools
9 | {
10 | static class VsConnection
11 | {
12 | static readonly VsLinkServer _vsLinkServer;
13 | static readonly VsIde _vsIde;
14 |
15 | static VsConnection()
16 | {
17 | _vsLinkServer = new VsLinkServer(VsLinkMessageHandler);
18 | _vsIde = new VsIde(_vsLinkServer.PipeName);
19 | }
20 |
21 | // Called on the VsLinkServer thread - should not block
22 | public static void VsLinkMessageHandler(VsLinkMessage message)
23 | {
24 | var registerXllMessage = message as RegisterAddInMessage;
25 | if (registerXllMessage != null)
26 | {
27 | if (registerXllMessage.AddInPath.EndsWith(".xll"))
28 | {
29 | ExcelAsyncUtil.QueueAsMacro(() => ExcelIntegration.RegisterXLL(registerXllMessage.AddInPath));
30 | }
31 | else if (registerXllMessage.AddInPath.EndsWith(".dll"))
32 | {
33 | ExcelAsyncUtil.QueueAsMacro(() => AddInLoader.RegisterDll(registerXllMessage.AddInPath));
34 | }
35 | }
36 | }
37 |
38 | public static void Show()
39 | {
40 | var Application = ExcelDnaUtil.Application as Application;
41 | var oldStatus = Application.StatusBar;
42 | var oldCursor = Application.Cursor;
43 | try
44 | {
45 | Application.StatusBar = "Loading Visual Studio ...";
46 | Application.Cursor = XlMousePointer.xlWait;
47 | _vsIde.Show();
48 | }
49 | catch (Exception ex)
50 | {
51 | }
52 | finally
53 | {
54 | Application.StatusBar = oldStatus;
55 | Application.Cursor = oldCursor;
56 | }
57 | }
58 |
59 | public static void Hide()
60 | {
61 | _vsIde.Hide();
62 | }
63 |
64 | public static void Shutdown()
65 | {
66 | _vsIde.Shutdown();
67 | _vsLinkServer.Dispose();
68 | }
69 |
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/VsIde.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | namespace ExcelDna.ExcelDnaTools
3 | {
4 | public class VsIde
5 | {
6 | EnvDTE.DTE _dte;
7 | readonly string _pipeName;
8 |
9 | public VsIde(string pipeName)
10 | {
11 | _pipeName = pipeName;
12 | }
13 |
14 | public void Show()
15 | {
16 | if (_dte == null)
17 | {
18 | // Check whether there are any VS processes running.
19 | // TODO: Show dialog with instances to connect to. For now make a new one...?
20 | // var instances = MsdevManager.Msdev.GetIDEInstances(false);
21 | // For now, just create a new instance
22 | Type type = Type.GetTypeFromProgID("VisualStudio.DTE");
23 | object dte = Activator.CreateInstance(type, true);
24 | _dte = (EnvDTE.DTE)dte;
25 |
26 | //System.IServiceProvider serviceProvider = new Microsoft.VisualStudio.Shell.ServiceProvider(_dte as Microsoft.VisualStudio.OLE.Interop.IServiceProvider);
27 | //IVsShell shell = serviceProvider.GetService(typeof(SVsShell)) as IVsShell;
28 | //if (shell == null)
29 | //{
30 | // return;
31 | //}
32 |
33 | //IEnumPackages enumPackages;
34 | //int result = shell.GetPackageEnum(out enumPackages);
35 |
36 | //IVsPackage package = null;
37 | //Guid PackageToBeLoadedGuid =
38 | // new Guid("10e82a35-4493-43be-b6d3-228399509924");
39 | //shell.LoadPackage(ref PackageToBeLoadedGuid, out package);
40 |
41 | _dte.MainWindow.WindowState = EnvDTE.vsWindowState.vsWindowStateNormal;
42 |
43 | // Load the AppToolsClient into Visual Studio, and connect the pipes.
44 | }
45 | _dte.MainWindow.Visible = true;
46 | // Now bring the _dte to the front (this might be done by the AppToolsClient?)
47 | if (_dte.MainWindow.WindowState == EnvDTE.vsWindowState.vsWindowStateMinimize)
48 | {
49 | _dte.MainWindow.WindowState = EnvDTE.vsWindowState.vsWindowStateNormal;
50 | }
51 | _dte.MainWindow.Activate();
52 | _dte.MainWindow.SetFocus();
53 | _dte.ExecuteCommand("ExcelDna.AttachExcel", _pipeName);
54 | }
55 |
56 | public void Hide()
57 | {
58 | _dte.MainWindow.Visible = false;
59 | }
60 |
61 | public void Shutdown()
62 | {
63 | _dte.Quit();
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/VsLink.cs:
--------------------------------------------------------------------------------
1 |
2 | // NOTE: This file is also included (as a link) in the ExcelDnaTools project
3 |
4 | using System;
5 | using System.Collections.Generic;
6 | using System.IO.Pipes;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 |
10 | namespace ExcelDna.ExcelDnaTools
11 | {
12 | // The VsLink is used to create a VS -> Excel channel
13 | // (We use VS Commands and the DTE object to communicate Excel -> VS)
14 | // An alternative would be to use COM, and call Application.Run(...) for VS -> Excel add-in messages.
15 | abstract class VsLink : IDisposable
16 | {
17 | public string PipeName { get; protected set; }
18 | public PipeStream PipeStream { get; protected set; }
19 | readonly byte[] _buffer = new byte[1024];
20 |
21 | public bool IsConnected { get { return PipeStream.IsConnected; } }
22 |
23 | public Task SendMessageAsync(VsLinkMessage message)
24 | {
25 | byte[] messageBytes = message.ToBytes();
26 | return PipeStream.WriteAsync(messageBytes, 0, messageBytes.Length);
27 | }
28 |
29 | // TODO: Timeout and CancellationToken
30 | // TODO: Receive all messages / blocking receive?
31 | public async Task ReceiveMessageAsync()
32 | {
33 | var messageBytes = new List();
34 | do
35 | {
36 | var numBytes = await PipeStream.ReadAsync(_buffer, 0, _buffer.Length /*, cancellationToken*/);
37 | if (numBytes == 0)
38 | {
39 | // End-of-stream (pipe closed?)
40 | if (messageBytes.Count > 0)
41 | {
42 | throw new InvalidOperationException("Pipe closed while transmitting message");
43 | }
44 | return null;
45 | }
46 | // normal case - add to the message bytes
47 | messageBytes.AddRange(_buffer.Take(numBytes));
48 | }
49 | while (!PipeStream.IsMessageComplete);
50 |
51 | return VsLinkMessage.FromBytes(messageBytes.ToArray());
52 | }
53 |
54 | public virtual void Dispose()
55 | {
56 | PipeStream.Dispose();
57 | }
58 |
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/VsLinkMessage.cs:
--------------------------------------------------------------------------------
1 |
2 | // NOTE: This file is also included (as a link) in the ExcelDnaTools project
3 |
4 | using System;
5 | using System.IO;
6 | using System.Text;
7 |
8 | namespace ExcelDna.ExcelDnaTools
9 | {
10 |
11 | // Message numbers etc. are shared with the client
12 | // CONSIDER: Move to a shared assembly.
13 | // Make nice / proper serialization, classes whatever
14 | enum VsLinkMessageType
15 | {
16 | EchoRequest = 1, // Excel -> VS or VS -> Excel
17 | EchoReply = 2, // Excel -> VS or VS -> Excel
18 | RegisterAddIn = 3, // VS -> Excel (Reload if loaded...?) + XllPath / DllPath
19 | }
20 |
21 | // abstract or generic.... VsLinkMessage where TMessage: IVsLinkMessage ???
22 | abstract class VsLinkMessage
23 | {
24 | public virtual byte[] GetData()
25 | {
26 | return new byte[0];
27 | }
28 |
29 | public VsLinkMessageType MessageType
30 | {
31 | get
32 | {
33 | if (this is EchoRequestMessage) return VsLinkMessageType.EchoRequest;
34 | if (this is EchoReplyMessage) return VsLinkMessageType.EchoReply;
35 | if (this is RegisterAddInMessage) return VsLinkMessageType.RegisterAddIn;
36 | throw new InvalidOperationException("VsLinkMessage.MessageType - unknown type");
37 | }
38 | }
39 |
40 | public byte[] ToBytes()
41 | {
42 | using (var ms = new MemoryStream())
43 | using (var sw = new BinaryWriter(ms))
44 | {
45 | sw.Write((int)MessageType);
46 | byte[] data = GetData();
47 | sw.Write(data.Length);
48 | sw.Write(data);
49 | return ms.ToArray();
50 | }
51 | }
52 |
53 | public static VsLinkMessage FromBytes(byte[] bytes)
54 | {
55 | if (bytes.Length < 8)
56 | throw new ArgumentException("VsLinkMessage is malformed - message too short");
57 | int messageType = BitConverter.ToInt32(bytes, 0);
58 | var dataLength = BitConverter.ToInt32(bytes, 4);
59 | if (bytes.Length - 8 != dataLength)
60 | throw new ArgumentException("VsLinkMessage is malformed - data length incorrect");
61 |
62 | switch ((VsLinkMessageType)messageType)
63 | {
64 | case VsLinkMessageType.EchoRequest:
65 | return new EchoRequestMessage();
66 | case VsLinkMessageType.EchoReply:
67 | return new EchoReplyMessage();
68 | case VsLinkMessageType.RegisterAddIn:
69 | return new RegisterAddInMessage(bytes, 8);
70 | default:
71 | throw new ArgumentOutOfRangeException();
72 | }
73 | }
74 | }
75 |
76 | class EchoRequestMessage : VsLinkMessage
77 | {
78 | }
79 |
80 | class EchoReplyMessage : VsLinkMessage
81 | {
82 | }
83 |
84 | class RegisterAddInMessage : VsLinkMessage
85 | {
86 | public readonly string AddInPath;
87 |
88 | public RegisterAddInMessage(string addInPath)
89 | {
90 | AddInPath = addInPath;
91 | }
92 |
93 | public RegisterAddInMessage(byte[] data, int startIndex)
94 | {
95 | AddInPath = Encoding.UTF8.GetString(data, startIndex, data.Length - startIndex);
96 | }
97 |
98 | public override byte[] GetData()
99 | {
100 | return Encoding.UTF8.GetBytes(AddInPath);
101 | }
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/VsLinkServer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using System.IO.Pipes;
7 | using ExcelDna.Integration;
8 | using System.Threading;
9 |
10 | namespace ExcelDna.ExcelDnaTools
11 | {
12 | // More Pipe info: http://www.codeproject.com/Tips/492231/Csharp-Async-Named-Pipes
13 |
14 | // Provides the server-side named pipe server when linked to a Vs instance
15 | // TODO: Shutdown?
16 | class VsLinkServer : VsLink, IDisposable
17 | {
18 | readonly Action _messageHandler;
19 | Thread _listenerThread;
20 |
21 | // messageHandler will be called from the listener thread, so should not block
22 | public VsLinkServer(Action messageHandler)
23 | {
24 | PipeName = @"ExcelDna\VsLink\" + Process.GetCurrentProcess().Id;
25 | // We create an anonymous named pipe, and then return the pipeName to pass to Vs.
26 | var ps = new NamedPipeServerStream(PipeName, PipeDirection.InOut, 1, PipeTransmissionMode.Message, PipeOptions.Asynchronous);
27 | _messageHandler = messageHandler;
28 | PipeStream = ps;
29 | _listenerThread = new Thread(Run);
30 | _listenerThread.Start();
31 | }
32 |
33 | public void Run(object _unused_)
34 | {
35 | ((NamedPipeServerStream)PipeStream).WaitForConnection();
36 | while (true)
37 | {
38 | var message = ReceiveMessageAsync().Result;
39 | if (message == null)
40 | {
41 | return;
42 | }
43 | _messageHandler(message);
44 | }
45 | }
46 |
47 | public override void Dispose()
48 | {
49 | if (_listenerThread != null)
50 | {
51 | // TODO: Does this shut down the blocking WaitForConnection and Read calls cleanly?
52 | _listenerThread.Abort();
53 | _listenerThread = null;
54 | }
55 | base.Dispose();
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/Source/ExcelDnaHost/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelDnaTools", "ExcelDnaTools\ExcelDnaTools.csproj", "{E9725BBA-C950-466A-9B9B-8E56D1C5A333}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelDnaHost", "ExcelDnaHost\ExcelDnaHost.csproj", "{664F7E0C-6316-4E35-86FC-2D6E28F583B8}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {E9725BBA-C950-466A-9B9B-8E56D1C5A333}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {E9725BBA-C950-466A-9B9B-8E56D1C5A333}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {E9725BBA-C950-466A-9B9B-8E56D1C5A333}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {E9725BBA-C950-466A-9B9B-8E56D1C5A333}.Release|Any CPU.Build.0 = Release|Any CPU
18 | {664F7E0C-6316-4E35-86FC-2D6E28F583B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {664F7E0C-6316-4E35-86FC-2D6E28F583B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {664F7E0C-6316-4E35-86FC-2D6E28F583B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {664F7E0C-6316-4E35-86FC-2D6E28F583B8}.Release|Any CPU.Build.0 = Release|Any CPU
22 | EndGlobalSection
23 | GlobalSection(SolutionProperties) = preSolution
24 | HideSolutionNode = FALSE
25 | EndGlobalSection
26 | EndGlobal
27 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/DebugManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Microsoft.VisualStudio;
7 | using Microsoft.VisualStudio.Debugger.Interop;
8 | using Microsoft.VisualStudio.Shell.Interop;
9 | using EnvDTE;
10 | using EnvDTE80;
11 | using System.Diagnostics;
12 | using Microsoft.VisualStudio.Shell;
13 |
14 |
15 | namespace ExcelDna.ExcelDnaTools
16 | {
17 | // Projects that do this:
18 | // * https://github.com/erlandranvinge/ReAttach
19 | // * https://github.com/ashmind/AttachToAnything
20 |
21 | // Alternative with more control is in IVsSolutionBuildManager (package can implement this interface, and implement DebugLaunch):
22 | // http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.ivssolutionbuildmanager.debuglaunch.aspx
23 |
24 | // And the whole sorry list of ways to attach:
25 | // http://stackoverflow.com/questions/15524038/visual-studio-how-to-get-idebugengine2-from-vs-package-except-ivsloader
26 |
27 | class DebugManager : IVsDebuggerEvents, IDebugEventCallback2
28 | {
29 | readonly ExcelDnaToolsPackage _package;
30 | readonly ExcelConnection _connection;
31 | readonly IVsDebugger _debugger; // IVsDebugger2 ???
32 | readonly DTE _dte;
33 | readonly Debugger2 _dteDebugger;
34 | readonly uint _debuggerEventsCookie;
35 |
36 | public DebugManager(ExcelDnaToolsPackage package, ExcelConnection connection)
37 | {
38 | _package = package;
39 | _connection = connection;
40 | var packageServiceProvider = (IServiceProvider)package;
41 | _debugger = packageServiceProvider.GetService(typeof(SVsShellDebugger)) as IVsDebugger;
42 | // var dgr = Package.GetGlobalService(typeof(SVsShellDebugger)) ;
43 | // _debugger = dgr as IVsDebugger;
44 | _dte = packageServiceProvider.GetService(typeof(SDTE)) as DTE;
45 | if (_dte != null)
46 | {
47 | _dteDebugger = _dte.Debugger as Debugger2;
48 | }
49 |
50 | if (_package == null || _debugger == null || _dte == null || _dteDebugger == null)
51 | {
52 | Debug.Fail("DebugManager setup failed");
53 | return;
54 | }
55 |
56 | if (_debugger.AdviseDebuggerEvents(this, out _debuggerEventsCookie) != VSConstants.S_OK)
57 | {
58 | Debug.Fail("DebugManager setup failed");
59 | }
60 |
61 | if (_debugger.AdviseDebugEventCallback(this) != VSConstants.S_OK)
62 | {
63 | Debug.Fail("DebugManager setup failed");
64 | }
65 | }
66 |
67 | public void AttachDebuggerToExcel()
68 | {
69 | var process = _dteDebugger.LocalProcesses.OfType().Where(p => p.ProcessID == _connection.ProcessID).FirstOrDefault();
70 | if (process == null)
71 | {
72 | Debug.Fail("Could not find Excel process!?");
73 | }
74 |
75 | try
76 | {
77 | process.Attach2("Managed (v4.5, v4.0)"); // Maybe "Managed (v4.0)" under VS 2010??? or VsConstants.DebugEngineGuids.Managedv4...
78 | }
79 | catch (Exception e)
80 | {
81 | Debug.Fail("Couldn't launch debugger: " + e);
82 | }
83 | // TODO: We might need to set DBGLAUNCH_DetachOnStop or something
84 | // IVsDebugLaunch debugger = GetService(typeof(SVsDebugLaunch)) as IVsDebugLaunch;
85 | // debugger.LaunchDebugTargets(
86 | // IVsDebugLaunch.DebugLaunch
87 | // Use DBGLAUNCH_DetachOnStop
88 | // Also: IVsProjectDebugTargetProvider ???
89 | }
90 |
91 |
92 | public int OnModeChange(DBGMODE dbgmodeNew)
93 | {
94 | return VSConstants.S_OK;
95 | }
96 |
97 | public int Event(IDebugEngine2 pEngine, IDebugProcess2 pProcess, IDebugProgram2 pProgram, IDebugThread2 pThread, IDebugEvent2 pEvent, ref Guid riidEvent, uint dwAttrib)
98 | {
99 | return VSConstants.S_OK;
100 | }
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/ExcelConnection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace ExcelDna.ExcelDnaTools
8 | {
9 | // Counterpart of VsConnection in the ExcelDnaHost
10 | public class ExcelConnection
11 | {
12 | VsLinkClient _vsLinkClient;
13 | int _processID;
14 |
15 | public void AttachExcel(string pipeName)
16 | {
17 | // PipeName ends with process id
18 | _processID = int.Parse(pipeName.Substring(pipeName.LastIndexOf('\\') + 1));
19 | _vsLinkClient = new VsLinkClient(pipeName);
20 | }
21 |
22 | public Task RegisterAddIn(string pathName)
23 | {
24 | return _vsLinkClient.SendMessageAsync(new RegisterAddInMessage(pathName));
25 | }
26 |
27 | public int ProcessID { get { return _processID; } }
28 |
29 | // RunMacro
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/ExcelDnaTools.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 10.0
5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
6 |
7 |
8 |
9 | $(VisualStudioVersion)
10 |
11 |
12 |
13 | 4.0
14 |
15 |
16 |
17 | Debug
18 | AnyCPU
19 | 2.0
20 | {E9725BBA-C950-466A-9B9B-8E56D1C5A333}
21 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
22 | Library
23 | Properties
24 | ExcelDna.ExcelDnaTools
25 | ExcelDnaTools
26 | True
27 | Key.snk
28 | v4.5
29 |
30 |
31 | true
32 | full
33 | false
34 | bin\Debug\
35 | DEBUG;TRACE
36 | prompt
37 | 4
38 |
39 |
40 | pdbonly
41 | true
42 | bin\Release\
43 | TRACE
44 | prompt
45 | 4
46 | true
47 |
48 |
49 |
50 |
51 | False
52 | True
53 | ..\..\..\..\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK\VisualStudioIntegration\Common\Assemblies\v2.0\Microsoft.VisualStudio.Debugger.Interop.dll
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | true
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | {80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}
82 | 8
83 | 0
84 | 0
85 | primary
86 | False
87 | False
88 |
89 |
90 | {26AD1324-4B7C-44BC-84F8-B86AED45729F}
91 | 10
92 | 0
93 | 0
94 | primary
95 | False
96 | False
97 |
98 |
99 | {1A31287A-4D7D-413E-8E32-3B374931BD89}
100 | 8
101 | 0
102 | 0
103 | primary
104 | False
105 | False
106 |
107 |
108 | {2CE2370E-D744-4936-A090-3FFFE667B0E1}
109 | 9
110 | 0
111 | 0
112 | primary
113 | False
114 | False
115 |
116 |
117 | {1CBA492E-7263-47BB-87FE-639000619B15}
118 | 8
119 | 0
120 | 0
121 | primary
122 | False
123 | False
124 |
125 |
126 | {00020430-0000-0000-C000-000000000046}
127 | 2
128 | 0
129 | 0
130 | primary
131 | False
132 | False
133 |
134 |
135 |
136 |
137 | VsLink.cs
138 |
139 |
140 | VsLinkMessage.cs
141 |
142 |
143 |
144 |
145 | MyControl.xaml
146 |
147 |
148 |
149 |
150 | True
151 | True
152 | Resources.resx
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 | ResXFileCodeGenerator
164 | Resources.Designer.cs
165 | Designer
166 |
167 |
168 | true
169 | VSPackage
170 |
171 |
172 |
173 |
174 | Designer
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 | Menus.ctmenu
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 | Designer
195 | MSBuild:Compile
196 |
197 |
198 |
199 | true
200 |
201 |
202 |
203 |
210 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/ExcelDnaTools.vsct:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
29 |
36 |
37 |
38 |
45 |
46 |
47 |
48 |
52 |
53 |
54 |
57 |
58 |
61 |
62 |
63 |
64 |
65 |
67 |
68 |
75 |
76 |
83 |
84 |
85 |
92 |
93 |
100 |
101 |
109 |
110 |
111 |
112 |
113 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
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 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/ExcelDnaToolsPackage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Globalization;
4 | using System.IO;
5 | using System.Runtime.InteropServices;
6 | using System.ComponentModel.Design;
7 | using Microsoft.Win32;
8 | using Microsoft.VisualStudio;
9 | using Microsoft.VisualStudio.Shell.Interop;
10 | using Microsoft.VisualStudio.OLE.Interop;
11 | using Microsoft.VisualStudio.Shell;
12 |
13 | namespace ExcelDna.ExcelDnaTools
14 | {
15 | ///
16 | /// This is the class that implements the package exposed by this assembly.
17 | ///
18 | /// The minimum requirement for a class to be considered a valid package for Visual Studio
19 | /// is to implement the IVsPackage interface and register itself with the shell.
20 | /// This package uses the helper classes defined inside the Managed Package Framework (MPF)
21 | /// to do it: it derives from the Package class that provides the implementation of the
22 | /// IVsPackage interface and uses the registration attributes defined in the framework to
23 | /// register itself and its components with the shell.
24 | ///
25 | // This attribute tells the PkgDef creation utility (CreatePkgDef.exe) that this class is
26 | // a package.
27 | [PackageRegistration(UseManagedResourcesOnly = true)]
28 | // This attribute is used to register the information needed to show this package
29 | // in the Help/About dialog of Visual Studio.
30 | [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
31 | // This attribute is needed to let the shell know that this package exposes some menus.
32 | [ProvideMenuResource("Menus.ctmenu", 1)]
33 |
34 | // [ProvideAutoLoad(VSConstants.UICONTEXT.NoSolution_string)] // If we always want to be loaded...?
35 |
36 | // This attribute registers a tool window exposed by this package.
37 | [ProvideToolWindow(typeof(MyToolWindow))]
38 | [Guid(GuidList.guidExcelDnaToolsPkgString)]
39 | public sealed class ExcelDnaToolsPackage : Package, System.IServiceProvider
40 | {
41 | ExcelConnection _connection;
42 | DebugManager _debugManager;
43 | SolutionHelper _solutionHelper;
44 |
45 | ///
46 | /// Default constructor of the package.
47 | /// Inside this method you can place any initialization code that does not require
48 | /// any Visual Studio service because at this point the package object is created but
49 | /// not sited yet inside Visual Studio environment. The place to do all the other
50 | /// initialization is the Initialize method.
51 | ///
52 | public ExcelDnaToolsPackage()
53 | {
54 | Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString()));
55 | }
56 |
57 | ///
58 | /// This function is called when the user clicks the menu item that shows the
59 | /// tool window. See the Initialize method to see how the menu item is associated to
60 | /// this function using the OleMenuCommandService service and the MenuCommand class.
61 | ///
62 | private void ShowToolWindow(object sender, EventArgs e)
63 | {
64 | // Get the instance number 0 of this tool window. This window is single instance so this instance
65 | // is actually the only one.
66 | // The last flag is set to true so that if the tool window does not exists it will be created.
67 | ToolWindowPane window = this.FindToolWindow(typeof(MyToolWindow), 0, true);
68 | if ((null == window) || (null == window.Frame))
69 | {
70 | throw new NotSupportedException(Resources.CanNotCreateWindow);
71 | }
72 | IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;
73 | Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
74 | }
75 |
76 |
77 | /////////////////////////////////////////////////////////////////////////////
78 | // Overridden Package Implementation
79 | #region Package Members
80 |
81 | ///
82 | /// Initialization of the package; this method is called right after the package is sited, so this is the place
83 | /// where you can put all the initialization code that rely on services provided by VisualStudio.
84 | ///
85 | protected override void Initialize()
86 | {
87 | IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));
88 | Guid clsid = Guid.Empty;
89 | int result;
90 | uiShell.ShowMessageBox(0,
91 | ref clsid,
92 | "ExcelDnaTools",
93 | "Hello There!!!",
94 | string.Empty,
95 | 0,
96 | OLEMSGBUTTON.OLEMSGBUTTON_OK,
97 | OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
98 | OLEMSGICON.OLEMSGICON_INFO,
99 | 0, // false
100 | out result);
101 | Debug.WriteLine (string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
102 | base.Initialize();
103 |
104 | // Initialize our internal helpers
105 | _connection = new ExcelConnection(); // Not connected at this point
106 | _debugManager = new DebugManager(this, _connection);
107 | _solutionHelper = new SolutionHelper(this);
108 |
109 | // Add our command handlers for menu (commands must exist in the .vsct file)
110 | OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
111 | if (mcs == null)
112 | {
113 | Debug.Fail("MenuCommandService not found!?");
114 | return;
115 | }
116 |
117 | // Create the command for the menu item.
118 | CommandID menuCommandID = new CommandID(GuidList.guidExcelDnaToolsCmdSet, (int)PkgCmdIDList.cmdidExcelDna);
119 | MenuCommand menuItem = new MenuCommand(MenuItemCallback, menuCommandID );
120 | mcs.AddCommand( menuItem );
121 |
122 | // Create the command for the tool window
123 | CommandID toolwndCommandID = new CommandID(GuidList.guidExcelDnaToolsCmdSet, (int)PkgCmdIDList.cmdidExcelDnaExplorer);
124 | MenuCommand menuToolWin = new MenuCommand(ShowToolWindow, toolwndCommandID);
125 | mcs.AddCommand( menuToolWin );
126 |
127 | CommandID attachExcelCommandID = new CommandID(GuidList.guidExcelDnaToolsCmdSet, (int)PkgCmdIDList.cmdidExcelDnaAttachExcel);
128 | OleMenuCommand menuAttachExcel = new OleMenuCommand(AttachExcelCallback, attachExcelCommandID);
129 | menuAttachExcel.ParametersDescription = "$"; // Documented http://www.getcodesamples.com/src/7D389846/8A0A4E48
130 | mcs.AddCommand(menuAttachExcel);
131 |
132 | CommandID attachDebuggerCommandID = new CommandID(GuidList.guidExcelDnaToolsCmdSet, (int)PkgCmdIDList.cmdidExcelDnaAttachDebugger);
133 | OleMenuCommand menuAttachDebugger = new OleMenuCommand(AttachDebuggerCallback, attachDebuggerCommandID);
134 | mcs.AddCommand(menuAttachDebugger);
135 | }
136 | #endregion
137 |
138 | ///
139 | /// This function is the callback used to execute a command when the a menu item is clicked.
140 | /// See the Initialize method to see how the menu item is associated to this function using
141 | /// the OleMenuCommandService service and the MenuCommand class.
142 | ///
143 | private void MenuItemCallback(object sender, EventArgs e)
144 | {
145 | // Show a Message Box to prove we were here
146 | IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));
147 | Guid clsid = Guid.Empty;
148 | int result;
149 | //Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(uiShell.ShowMessageBox(
150 | // 0,
151 | // ref clsid,
152 | // "ExcelDnaTools",
153 | // string.Format(CultureInfo.CurrentCulture, "Inside {0}.MenuItemCallback()", this.ToString()),
154 | // string.Empty,
155 | // 0,
156 | // OLEMSGBUTTON.OLEMSGBUTTON_OK,
157 | // OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
158 | // OLEMSGICON.OLEMSGICON_INFO,
159 | // 0, // false
160 | // out result));
161 | // uiShell.GetToolWindowEnum
162 |
163 | Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(uiShell.ShowMessageBox(
164 | 0,
165 | ref clsid,
166 | "ExcelDnaTools",
167 | "Wrote Register message",
168 | string.Empty,
169 | 0,
170 | OLEMSGBUTTON.OLEMSGBUTTON_OK,
171 | OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
172 | OLEMSGICON.OLEMSGICON_INFO,
173 | 0, // false
174 | out result));
175 | }
176 |
177 | // TODO: Rename this to ConnectExcel
178 | void AttachExcelCallback(object sender, EventArgs e)
179 | {
180 | var omce = e as OleMenuCmdEventArgs;
181 | if (omce == null)
182 | return;
183 |
184 | // Show a Message Box to prove we were here
185 | IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));
186 | Guid clsid = Guid.Empty;
187 | int result;
188 | Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(uiShell.ShowMessageBox(
189 | 0,
190 | ref clsid,
191 | "ExcelDnaTools",
192 | "Inside AttachExcel: " + omce.InValue + " !!!",
193 | string.Empty,
194 | 0,
195 | OLEMSGBUTTON.OLEMSGBUTTON_OK,
196 | OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
197 | OLEMSGICON.OLEMSGICON_INFO,
198 | 0, // false
199 | out result));
200 |
201 | _connection.AttachExcel((string)omce.InValue);
202 |
203 | }
204 |
205 | void AttachDebuggerCallback(object sender, EventArgs e)
206 | {
207 | // CONSIDER: Different approaches here:
208 | // 1. Get current project through Shell, figure out path and reload, the attach debugger
209 | // 2. Use debugger events to know when to reload
210 |
211 | // This is suitable for NuGet Excel-DNA package.
212 | var startArguments = _solutionHelper.GetActiveStartArguments();
213 | if (!string.IsNullOrEmpty(startArguments) && startArguments.EndsWith(".xll"))
214 | {
215 | // TODO: UI indicator for slow call...
216 | _connection.RegisterAddIn(startArguments).Wait();
217 | }
218 | else
219 | {
220 | // Maybe this is just a Class Library project, without the full Excel-DNA package.
221 | var pathName = _solutionHelper.GetActiveTargetName();
222 | _connection.RegisterAddIn(pathName).Wait();
223 | }
224 | _debugManager.AttachDebuggerToExcel();
225 | }
226 | }
227 | }
228 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project. Project-level
3 | // suppressions either have no target or are given a specific target
4 | // and scoped to a namespace, type, member, etc.
5 | //
6 | // To add a suppression to this file, right-click the message in the
7 | // Error List, point to "Suppress Message(s)", and click "In Project
8 | // Suppression File". You do not need to add suppressions to this
9 | // file manually.
10 |
11 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")]
12 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/Guids.cs:
--------------------------------------------------------------------------------
1 | // Guids.cs
2 | // MUST match guids.h
3 | using System;
4 |
5 | namespace ExcelDna.ExcelDnaTools
6 | {
7 | static class GuidList
8 | {
9 | public const string guidExcelDnaToolsPkgString = "10e82a35-4493-43be-b6d3-228399509924";
10 | public const string guidExcelDnaToolsCmdSetString = "ed07e70d-6403-4bc3-aa0a-50c726b6442b";
11 | public const string guidToolWindowPersistanceString = "f4ef482c-71f3-4638-88bd-65eedaa4665e";
12 |
13 | public static readonly Guid guidExcelDnaToolsCmdSet = new Guid(guidExcelDnaToolsCmdSetString);
14 | };
15 | }
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Excel-DNA/VSExcel/aa85e670e9a063c9167b5fbf99660d6759ce5763/Source/ExcelDnaTools/Key.snk
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/MyControl.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | Excel-DNA Explorer
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/MyControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Navigation;
13 | using System.Windows.Shapes;
14 |
15 | namespace ExcelDna.ExcelDnaTools
16 | {
17 | ///
18 | /// Interaction logic for MyControl.xaml
19 | ///
20 | public partial class MyControl : UserControl
21 | {
22 | public MyControl()
23 | {
24 | InitializeComponent();
25 | }
26 |
27 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1300:SpecifyMessageBoxOptions")]
28 | private void button1_Click(object sender, RoutedEventArgs e)
29 | {
30 | MessageBox.Show(string.Format(System.Globalization.CultureInfo.CurrentUICulture, "We are inside {0}.button1_Click()", this.ToString()),
31 | "Excel-DNA Explorer");
32 |
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/MyToolWindow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Windows;
7 | using System.Runtime.InteropServices;
8 | using Microsoft.VisualStudio.Shell.Interop;
9 | using Microsoft.VisualStudio.Shell;
10 |
11 | namespace ExcelDna.ExcelDnaTools
12 | {
13 | ///
14 | /// This class implements the tool window exposed by this package and hosts a user control.
15 | ///
16 | /// In Visual Studio tool windows are composed of a frame (implemented by the shell) and a pane,
17 | /// usually implemented by the package implementer.
18 | ///
19 | /// This class derives from the ToolWindowPane class provided from the MPF in order to use its
20 | /// implementation of the IVsUIElementPane interface.
21 | ///
22 | [Guid("f4ef482c-71f3-4638-88bd-65eedaa4665e")]
23 | public class MyToolWindow : ToolWindowPane
24 | {
25 | ///
26 | /// Standard constructor for the tool window.
27 | ///
28 | public MyToolWindow() :
29 | base(null)
30 | {
31 | // Set the window title reading it from the resources.
32 | this.Caption = Resources.ToolWindowTitle;
33 | // Set the image that will appear on the tab of the window frame
34 | // when docked with an other window
35 | // The resource ID correspond to the one defined in the resx file
36 | // while the Index is the offset in the bitmap strip. Each image in
37 | // the strip being 16x16.
38 | this.BitmapResourceID = 301;
39 | this.BitmapIndex = 1;
40 |
41 | // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
42 | // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
43 | // the object returned by the Content property.
44 | base.Content = new MyControl();
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/Notes.txt:
--------------------------------------------------------------------------------
1 | Adding NuGet packages to Templates:
2 | http://docs.nuget.org/docs/reference/packages-in-visual-studio-templates
3 | Sample: https://bitbucket.org/marcind/nugetinvstemplates
4 |
5 | Import/Export vssettings:
6 | http://blogs.msdn.com/b/saraford/archive/2008/12/05/did-you-know-you-can-create-toolbar-buttons-to-quickly-toggle-your-favorite-vs-settings-371.aspx
7 | http://stackoverflow.com/questions/21455741/export-import-visual-studio-settings-from-command-line
8 |
9 | Various articles (MZ-Tools):
10 | http://www.mztools.com/resources_vsnet_addins.aspx
11 |
12 | Shipping snippets in an extension: http://madskristensen.net/post/shipping-visual-studio-snippets-in-an-extension
13 |
14 | Open source add-ins:
15 | http://www.diaryofaninja.com/blog/2014/02/18/who-said-building-visual-studio-extensions-was-hard
16 | https://bitbucket.org/s_cadwallader/codemaid
17 |
18 | Various Bugs (by MZ-Tools guy):
19 | http://connect.microsoft.com/VisualStudio/SearchResults.aspx?UserHandle=Carlos%20J.%20Quintero
20 |
21 | Named Commands in the vsct (by CommandWellOnly:
22 | http://social.msdn.microsoft.com/Forums/vstudio/en-US/b805f1d8-1603-49a4-bab4-3f9ec4b1a1e1/creating-a-custom-command-and-accessing-it-by-name?forum=vsx
23 |
24 | Project Subtypes (Project Flavor)
25 | http://msdn.microsoft.com/en-us/library/bb166488.aspx
26 | http://code.msdn.microsoft.com/windowsdesktop/CSVSXProjectSubType-2221cf55
27 |
28 | Major Series: LearnVSXNow!
29 | http://dotneteers.net/blogs/divedeeper/default.aspx
30 |
31 | REPL that is integrated with the Python and Node tools for Visual Studio
32 | With Roslyn IntelliSense and injected Application object...?
33 | Pipe to Excel process and run on main thread ..
34 |
35 | Message Filter to use DTE from other thread: http://www.viva64.com/en/b/0169/#ID0E5YAI
36 |
37 | Create other instances / profiles of Visual Studio with different root-suffixes
38 | Installing VSIX packages: http://blog.slaks.net/2014-01-27/creating-multiple-visual-studio-profiles-with-rootsuffix/
39 | TODO: Check whether the ROT plan can detect the experimental instance.
40 | We can update / create registry entries with LocalServer32: "...devenv.exe" /rootsuffix Exp
41 | Targeting a specific root suffix: Last comment at http://stackoverflow.com/questions/7294995/developing-multiple-visual-studio-2010-extensions
42 | "If you define a property called VSSDKTargetPlatformRegRootSuffix in your package or template project files
43 | (anything that includes Microsoft.VsSDK.Common.targets), it will publish the extension files there, instead."
44 |
45 | .vssettings
46 | https://github.com/mrchief/Simplify-Visual-Studio-Menus / http://mrchief2000.wordpress.com/2011/05/18/simplify-visual-studio-context-menus/
47 | Command to Import / Export: http://blogs.msdn.com/b/saraford/archive/2008/12/05/did-you-know-you-can-create-toolbar-buttons-to-quickly-toggle-your-favorite-vs-settings-371.aspx
48 | Tools.ImportExportSettings
49 | Porject to make a GUI for switching settings: https://vsswitch.codeplex.com/
50 | (So we can give users the options to switch between simple and cluttered mode)
51 |
52 | PVS Addin write-up (SlideShare...?) http://www.slideshare.net/Andrey_Karpov/developing-extension-packages-for-visual-studio-2005200820102012-using-c-with-reallife-samples#
53 | Includes COM threading and message filter discussion
54 |
55 | Setting for Extension: http://haacked.com/archive/2014/07/30/visual-studios-extensions-settings/
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/PkgCmdID.cs:
--------------------------------------------------------------------------------
1 | // PkgCmdID.cs
2 | // MUST match PkgCmdID.h
3 | using System;
4 |
5 | namespace ExcelDna.ExcelDnaTools
6 | {
7 | static class PkgCmdIDList
8 | {
9 | public const uint cmdidExcelDna = 0x100;
10 | public const uint cmdidExcelDnaExplorer = 0x101;
11 | public const uint cmdidExcelDnaAttachExcel = 0x102;
12 | public const uint cmdidExcelDnaAttachDebugger = 0x103;
13 |
14 | };
15 | }
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Resources;
4 | using System.Runtime.CompilerServices;
5 | using System.Runtime.InteropServices;
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("ExcelDnaTools")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("Excel-DNA")]
14 | [assembly: AssemblyProduct("ExcelDnaTools")]
15 | [assembly: AssemblyCopyright("")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 | [assembly: ComVisible(false)]
19 | [assembly: CLSCompliant(false)]
20 | [assembly: NeutralResourcesLanguage("en-US")]
21 |
22 | // Version information for an assembly consists of the following four values:
23 | //
24 | // Major Version
25 | // Minor Version
26 | // Build Number
27 | // Revision
28 | //
29 | // You can specify all the values or you can default the Revision and Build Numbers
30 | // by using the '*' as shown below:
31 |
32 | [assembly: AssemblyVersion("1.0.0.0")]
33 | [assembly: AssemblyFileVersion("1.0.0.0")]
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
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 ExcelDna.ExcelDnaTools {
12 | using System;
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 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ExcelDna.ExcelDnaTools.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized string similar to Can not create tool window..
65 | ///
66 | internal static string CanNotCreateWindow {
67 | get {
68 | return ResourceManager.GetString("CanNotCreateWindow", resourceCulture);
69 | }
70 | }
71 |
72 | ///
73 | /// Looks up a localized string similar to Excel-DNA Explorer.
74 | ///
75 | internal static string ToolWindowTitle {
76 | get {
77 | return ResourceManager.GetString("ToolWindowTitle", resourceCulture);
78 | }
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/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 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | Can not create tool window.
122 |
123 |
124 | Excel-DNA Explorer
125 |
126 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/Resources/Images.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Excel-DNA/VSExcel/aa85e670e9a063c9167b5fbf99660d6759ce5763/Source/ExcelDnaTools/Resources/Images.png
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/Resources/Package.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Excel-DNA/VSExcel/aa85e670e9a063c9167b5fbf99660d6759ce5763/Source/ExcelDnaTools/Resources/Package.ico
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/SolutionHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using EnvDTE;
7 | using EnvDTE80;
8 | using Microsoft.VisualStudio.Shell;
9 | using System.IO;
10 |
11 | namespace ExcelDna.ExcelDnaTools
12 | {
13 | // Follows the '*Helper' anti-pattern
14 | class SolutionHelper
15 | {
16 | readonly ExcelDnaToolsPackage _package;
17 | readonly DTE _dte;
18 | public SolutionHelper(ExcelDnaToolsPackage package)
19 | {
20 | _package = package;
21 | var packageServiceProvider = (IServiceProvider)package;
22 | _dte = packageServiceProvider.GetService(typeof(DTE)) as DTE;
23 | }
24 |
25 | public string GetActiveTargetName()
26 | {
27 | // Getting the output path from the build: http://stackoverflow.com/questions/5626303/how-do-i-get-the-output-directories-from-the-last-build
28 | // and: http://stackoverflow.com/questions/5486593/getting-the-macro-value-of-projects-targetpath-via-dte
29 | // and: http://social.msdn.microsoft.com/Forums/vstudio/en-US/b6ec12c6-a0e7-419d-b43b-143a3cb4c326/getting-the-macro-value-of-projects-targetpath-via-dte?forum=vsx
30 |
31 | // TODO: This might not work for the default VB configuration, where the Advanced Configuration is not on.
32 | // From http://social.msdn.microsoft.com/Forums/vstudio/en-US/03d9d23f-e633-4a27-9b77-9029735cfa8d/how-to-get-the-right-output-path-from-envdteproject-by-code-if-show-advanced-build?forum=vsx
33 | // If the Advanced configuration is disabled, the detection of output path is context sensitive during the build operation.
34 | // e.g. If you disable the advanced configuration in VS and do an F5 the active configuration selected is debug and if you
35 | // do a project build from the project node its release. So the VS shell picks up the configuration information in this case
36 | // based on context of the operation. The host application could do a similiar context detection from the dte object and
37 | // select the appropriate ActiveConfiguration.
38 |
39 | // Alternative is to get the IVsSolution of the SVsSolution service...?
40 | Array projs = (Array)_dte.ActiveSolutionProjects;
41 | if (projs.Length == 0)
42 | return null;
43 |
44 | var vsProject = (EnvDTE.Project)projs.GetValue(0);
45 | var fullPath = vsProject.Properties.Item("FullPath").Value.ToString();
46 | var outputPath = vsProject.ConfigurationManager.ActiveConfiguration.Properties.Item("OutputPath").Value.ToString();
47 | var outputDir = Path.Combine(fullPath, outputPath);
48 | var outputFileName = vsProject.Properties.Item("OutputFileName").Value.ToString();
49 | var assemblyPath = Path.Combine(outputDir, outputFileName);
50 | return assemblyPath;
51 | }
52 |
53 | public string GetActiveStartArguments()
54 | {
55 | Array projs = (Array)_dte.ActiveSolutionProjects;
56 | if (projs.Length == 0)
57 | return null;
58 |
59 | var vsProject = (EnvDTE.Project)projs.GetValue(0);
60 | var debugConfiguration = vsProject.ConfigurationManager.Cast().FirstOrDefault(c => c.ConfigurationName == "Debug");
61 | if (debugConfiguration != null)
62 | {
63 | var startArguments = debugConfiguration.Properties.Item("StartArguments").Value.ToString();
64 | // TODO: Check that this is valid
65 | return startArguments;
66 | }
67 | // TODO: Message / Log about things being wrong
68 | return null;
69 | }
70 |
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/VSPackage.resx:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
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 |
115 |
116 |
117 |
118 |
119 | text/microsoft-resx
120 |
121 |
122 | 2.0
123 |
124 |
125 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
126 |
127 |
128 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
129 |
130 |
131 |
132 | ExcelDnaTools
133 |
134 |
135 | Excel-DNA Tools for Visual Studio.
136 |
137 |
138 | Resources\Package.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
139 |
140 |
141 | Resources\Images.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
142 |
143 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/VsLinkClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO.Pipes;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ExcelDna.ExcelDnaTools
9 | {
10 | // Connects to the pipe id passed in
11 | class VsLinkClient : VsLink
12 | {
13 | public VsLinkClient(string pipeName)
14 | {
15 | var ps = new NamedPipeClientStream(".", pipeName, PipeDirection.InOut, PipeOptions.Asynchronous);
16 | ps.Connect(/* timeout */);
17 | PipeStream = ps;
18 | }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Source/ExcelDnaTools/source.extension.vsixmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ExcelDnaTools
6 | Excel-DNA Tools for Visual Studio.
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/XmlSchemas/ExcelDna.DnaLibrary.xsd:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
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 |
84 |
87 |
90 |
93 |
96 |
99 |
102 |
105 |
108 |
109 |
110 |
111 |
112 |
114 |
115 |
116 |
119 |
122 |
125 |
126 |
127 |
128 |
129 |
131 |
132 |
135 |
139 |
140 |
144 |
145 |
146 |
147 |
150 |
153 |
156 |
159 |
162 |
165 |
168 |
171 |
172 |
173 |
174 |
175 |
176 |
179 |
182 |
185 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
198 |
201 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
213 |
214 |
215 |
216 |
218 |
219 |
222 |
226 |
227 |
231 |
232 |
236 |
237 |
241 |
242 |
246 |
247 |
248 |
249 |
252 |
255 |
258 |
261 |
264 |
267 |
270 |
273 |
274 |
275 |
277 |
278 |
279 |
--------------------------------------------------------------------------------
/XmlSchemas/ExcelDnaCatalog.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/XmlSchemas/ExcelDnaSmall.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Excel-DNA/VSExcel/aa85e670e9a063c9167b5fbf99660d6759ce5763/XmlSchemas/ExcelDnaSmall.ico
--------------------------------------------------------------------------------
/XmlSchemas/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Excel-DNA XML Schemas Extension")]
9 | [assembly: AssemblyDescription("Visual Studio extension to provide XML schemas for Excel-DNA")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Excel-DNA Add-In Framework for Microsoft Excel")]
13 | [assembly: AssemblyCopyright("Copyright © 2005-2020 Govert van Drimmelen")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // Version information for an assembly consists of the following four values:
23 | //
24 | // Major Version
25 | // Minor Version
26 | // Build Number
27 | // Revision
28 | //
29 | // You can specify all the values or you can default the Build and Revision Numbers
30 | // by using the '*' as shown below:
31 | // [assembly: AssemblyVersion("1.0.*")]
32 | [assembly: AssemblyVersion("0.3.0.0")]
33 | [assembly: AssemblyFileVersion("0.3.0.0")]
34 |
--------------------------------------------------------------------------------
/XmlSchemas/XmlSchemas.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 15.0
5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
6 |
7 |
8 |
9 | Debug
10 | AnyCPU
11 | 2.0
12 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
13 | {8274A02D-3335-4A09-9F37-C585645DDFFE}
14 | Library
15 | Properties
16 | ExcelDna.XmlSchemas
17 | ExcelDna.XmlSchemas
18 | v4.7.1
19 | false
20 | false
21 | false
22 | false
23 | false
24 | false
25 | Program
26 | $(DevEnvDir)devenv.exe
27 | /rootsuffix Exp
28 |
29 |
30 | true
31 | full
32 | false
33 | bin\Debug\
34 | DEBUG;TRACE
35 | prompt
36 | 4
37 |
38 |
39 | pdbonly
40 | true
41 | bin\Release\
42 | TRACE
43 | prompt
44 | 4
45 |
46 |
47 |
48 |
49 |
50 |
51 | Designer
52 | true
53 | Schemas
54 |
55 |
56 | Designer
57 | true
58 | Schemas
59 |
60 |
61 | Designer
62 | true
63 | Schemas
64 |
65 |
66 | Always
67 | true
68 |
69 |
70 | Designer
71 |
72 |
73 |
74 |
75 | true
76 | Schemas
77 |
78 |
79 |
80 |
81 |
88 |
--------------------------------------------------------------------------------
/XmlSchemas/XmlSchemas.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27703.2000
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlSchemas", "XmlSchemas.csproj", "{8274A02D-3335-4A09-9F37-C585645DDFFE}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {8274A02D-3335-4A09-9F37-C585645DDFFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {8274A02D-3335-4A09-9F37-C585645DDFFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {8274A02D-3335-4A09-9F37-C585645DDFFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {8274A02D-3335-4A09-9F37-C585645DDFFE}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {96C85693-43FD-4E9F-B568-4C35D4C74608}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/XmlSchemas/customUI.xsd:
--------------------------------------------------------------------------------
1 |
2 |
7 |
14 |
15 |
16 | ----------------------------------------------------------------------
17 | Schema definition for Ribbon Extensibility
18 | ----------------------------------------------------------------------
19 |
20 |
21 |
22 |
23 |
24 | ----------------------------------------------------------------------
25 | Attribute types
26 | ----------------------------------------------------------------------
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | The qualified ID of a control.
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | The custom ID of a control.
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | A unique ID.
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | A callback. Callbacks are used to provide status, update properties or perform actions.
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | A numeric argument for maximum string length in controls.
91 | String length is limited to 1024 characters.
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 | A numeric argument for the maximum number of rows or columns in galleries.
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | A numeric argument for the maximum width or height of a gallery item.
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 | A string argument.
134 | String length is limited to 1024 characters.
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 | A long string argument.
149 | String length is limited to 4096 characters.
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 | A string argument for a path to a file or a resource.
164 | String length is limited to 1024 characters.
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 | The size of a button. Values are "normal" or "large."
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 | The size of items in a menu. Values are "normal" or "large."
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 | A box control. Values are "horizontal" or "vertical."
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 | A keytip. Value is 1-3 alphanumeric characters.
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 | ----------------------------------------------------------------------
234 | Attributes
235 | ----------------------------------------------------------------------
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 | Attributes for a custom control ID.
244 |
245 |
246 |
247 |
250 |
251 |
252 | The ID of a custom UI element. IDs must be unique.
253 |
254 |
255 |
256 |
259 |
260 |
261 |
262 | A qualified control ID. Qualified IDs allow different add-ins to modify the same custom group, tab, or menu.
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 | The ID of a built-in control.
274 |
275 |
276 |
277 |
280 |
281 |
282 | The ID of a built-in control.
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 | Custom data.
293 |
294 |
295 |
296 |
299 |
300 |
301 | Custom data.
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 | The title of a menu.
313 |
314 |
315 |
316 |
319 |
320 |
321 | The title of a menu.
322 |
323 |
324 |
325 |
328 |
329 |
330 | Callback for the title of a menu.
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 | Attributes that specify control ID.
341 | One of id, idMso, or idQ must be specified to identify a control.
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 | The image or icon of a control.
355 | Image attributes are mutually exclusive - only one of
356 | "image", "imageMso", or "getImage" may be specified.
357 |
358 |
359 |
360 |
363 |
364 |
365 | A custom image or icon.
366 |
367 |
368 |
369 |
372 |
373 |
374 | The image of a built-in control.
375 |
376 |
377 |
378 |
381 |
382 |
383 | Callback for a custom image.
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 | Attributes that can be applied to all commands and controls.
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 | Attributes that set the position of an object relative to its siblings,
405 | such as the position of a control within a group or position of a tab relative to other tabs.
406 |
407 |
408 |
409 |
412 |
413 |
414 | The ID of built-in control to be inserted after.
415 | Mutually exclusive with InsertBeforeMso, InsertAfterQ, InsertBeforeQ.
416 |
417 |
418 |
419 |
422 |
423 |
424 | The ID of built-in control to be inserted before.
425 | Mutually exclusive with InsertAfterMso, InsertAfterQ, InsertBeforeQ.
426 |
427 |
428 |
429 |
432 |
433 |
434 | The ID of control to be inserted after.
435 | Mutually exclusive with InsertAfterMso, InsertBeforeMso, InsertBeforeQ.
436 |
437 |
438 |
439 |
442 |
443 |
444 | The ID of control to be inserted before.
445 | Mutually exclusive with InsertAfterMso, InsertBeforeMso, InsertAfterQ.
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 | Attributes for a control's enabled state.
456 |
457 |
458 |
459 |
462 |
463 |
464 | Whether the control is enabled.
465 |
466 |
467 |
468 |
471 |
472 |
473 | Callback that returns true if the control is enabled.
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 | Attributes for a control's visibility.
484 |
485 |
486 |
487 |
490 |
491 |
492 | Whether the control is visible.
493 |
494 |
495 |
496 |
499 |
500 |
501 | Callback that returns true if the control is visible.
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 | Attributes that set a control's label.
512 |
513 |
514 |
515 |
518 |
519 |
520 | Sets the label.
521 |
522 |
523 |
524 |
527 |
528 |
529 | Callback that sets the label.
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 | Attributes to set a control's keytip.
540 |
541 |
542 |
543 |
546 |
547 |
548 | Sets the keytip.
549 |
550 |
551 |
552 |
555 |
556 |
557 | Callback that sets the keytip.
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 | Attributes for a control's screentip.
568 |
569 |
570 |
571 |
574 |
575 |
576 | Sets the screentip, which appears on mouse hover.
577 |
578 |
579 |
580 |
583 |
584 |
585 | Callback that sets the screentip.
586 |
587 |
588 |
589 |
592 |
593 |
594 | Sets the supertip, a large screentip.
595 |
596 |
597 |
598 |
601 |
602 |
603 | Callback that sets the supertip, a large screentip.
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 | Attributes for the extended description of a control.
614 |
615 |
616 |
617 |
620 |
621 |
622 | Sets the extended description of the control, which appears in menus with itemSize set to large.
623 |
624 |
625 |
626 |
629 |
630 |
631 | Callback that sets the description.
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 | Attributes that can be applied to all controls.
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 | Common attributes that can be applied to controls and groups.
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 | Attributes applied to controls.
670 |
671 |
672 |
673 |
674 |
677 |
678 |
679 | Whether to show a control's label.
680 |
681 |
682 |
683 |
686 |
687 |
688 | Callback for whether to show a control's label.
689 |
690 |
691 |
692 |
695 |
696 |
697 | Whether to show a control's image.
698 |
699 |
700 |
701 |
704 |
705 |
706 | Callback for whether to show a control's image.
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 | Callback fired on user action.
717 |
718 |
719 |
720 |
723 |
724 |
725 | Callback fired on user action (for example, a button press).
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 | A size attribute.
736 |
737 |
738 |
739 |
742 |
743 |
744 | The size of a control.
745 |
746 |
747 |
748 |
751 |
752 |
753 | Callback for a control's size.
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 | Common attributes for controls with dropdowns (such as comboBox, gallery, or dropDown).
764 |
765 |
766 |
767 |
770 |
771 |
772 | Whether item images are shown in the dropdown.
773 |
774 |
775 |
776 |
779 |
780 |
781 | Callback for the number of items in the dropdown.
782 |
783 |
784 |
785 |
788 |
789 |
790 | Callback for an item's label.
791 |
792 |
793 |
794 |
797 |
798 |
799 | Callback for an item's screentip.
800 |
801 |
802 |
803 |
806 |
807 |
808 | Callback for an item's supertip.
809 |
810 |
811 |
812 |
815 |
816 |
817 | Callback for an item's image.
818 |
819 |
820 |
821 |
824 |
825 |
826 | Callback for an item's ID.
827 |
828 |
829 |
830 |
833 |
834 |
835 | A representative string that sets the control's width.
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 |
845 | Attributes for dynamic controls that support the getContent callback.
846 |
847 |
848 |
849 |
852 |
853 |
854 | Callback that returns the dynamic content for this control.
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 | Attributes for controls that support dynamic content.
865 |
866 |
867 |
868 |
871 |
872 |
873 | Whether to fire callback for dynamic content each time the control is dropped.
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 | ----------------------------------------------------------------------
882 | Global settings
883 | ----------------------------------------------------------------------
884 |
885 |
886 |
887 |
889 |
890 |
891 |
892 | Attribute overrides for all controls with specified built-in ID.
893 | For example
894 | <command idMso="Print" enabled="false">
895 | disables all instances of the Print button.
896 |
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 |
906 | ----------------------------------------------------------------------
907 | Controls
908 | ----------------------------------------------------------------------
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 | Base control type.
917 | Doesn't define ID attributes.
918 | Abstract type, not to be used directly.
919 |
920 |
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 |
929 | A type of control that can be used to
930 | enable, disable, or clone an existing control.
931 |
932 |
933 |
934 |
935 |
936 |
937 |
938 |
939 |
940 |
941 |
942 |
943 |
944 |
945 | A clone of a built-in control.
946 | Only the most common attributes can be applied here; to set
947 | control-specific properties the actual control type must be specified.
948 |
949 |
950 |
951 |
952 |
953 |
955 |
956 |
957 | Custom controls can't be cloned.
958 |
959 |
960 |
961 |
962 |
963 |
964 |
965 |
966 |
967 |
968 |
969 | A clone of built-in control that can be sized.
970 |
971 |
972 |
973 |
974 |
975 |
977 |
978 |
979 | Custom controls can't be cloned.
980 |
981 |
982 |
983 |
985 |
986 |
987 | OnAction does not apply to 'control'.
988 |
989 |
990 |
991 |
992 |
993 |
994 |
995 |
996 |
997 |
998 |
999 | Shows text and/or icon but can't have any associated actions.
1000 |
1001 |
1002 |
1003 |
1004 |
1005 |
1007 |
1008 |
1009 | Image does not apply to labelControl.
1010 |
1011 |
1012 |
1013 |
1015 |
1016 |
1017 | ImageMso does not apply to labelControl.
1018 |
1019 |
1020 |
1021 |
1023 |
1024 |
1025 | GetImage does not apply to labelControl.
1026 |
1027 |
1028 |
1029 |
1031 |
1032 |
1033 | Keytip does not apply to labelControl.
1034 |
1035 |
1036 |
1037 |
1039 |
1040 |
1041 | GetKeyTip does not apply to labelControl.
1042 |
1043 |
1044 |
1045 |
1047 |
1048 |
1049 | ShowImage does not apply to labelControl.
1050 |
1051 |
1052 |
1053 |
1055 |
1056 |
1057 | GetShowImage does not apply to labelControl.
1058 |
1059 |
1060 |
1061 |
1062 |
1063 |
1064 |
1065 |
1066 |
1067 |
1068 |
1069 | A fixed-size button.
1070 | Size of this button is determined by its container such as a menu.
1071 |
1072 |
1073 |
1074 |
1075 |
1076 |
1077 |
1078 |
1079 |
1080 |
1081 |
1082 |
1083 |
1084 |
1085 |
1086 |
1087 |
1088 | A push-type button.
1089 |
1090 |
1091 |
1092 |
1093 |
1094 |
1095 |
1096 |
1097 |
1098 |
1099 |
1100 |
1101 |
1102 |
1103 | A button which is always visible.
1104 |
1105 |
1106 |
1107 |
1108 |
1109 |
1111 |
1112 |
1113 | Visible does not apply to these buttons.
1114 |
1115 |
1116 |
1117 |
1119 |
1120 |
1121 | GetVisible does not apply to these buttons.
1122 |
1123 |
1124 |
1125 |
1126 |
1127 |
1128 |
1129 |
1130 |
1131 |
1132 |
1133 | A fixed-size button with an on/off state like the 'Bold' button.
1134 |
1135 |
1136 |
1137 |
1138 |
1139 |
1142 |
1143 |
1144 | Callback for whether the button is pressed.
1145 |
1146 |
1147 |
1148 |
1149 |
1150 |
1151 |
1152 |
1153 |
1154 |
1155 |
1156 | A button with an on/off state that can be sized.
1157 |
1158 |
1159 |
1160 |
1161 |
1162 |
1163 |
1164 |
1165 |
1166 |
1167 |
1168 |
1169 |
1170 |
1171 | A toggleButton which is always visible.
1172 |
1173 |
1174 |
1175 |
1176 |
1177 |
1179 |
1180 |
1181 | Visible does not apply to these buttons.
1182 |
1183 |
1184 |
1185 |
1187 |
1188 |
1189 | GetVisible does not apply to these buttons.
1190 |
1191 |
1192 |
1193 |
1194 |
1195 |
1196 |
1197 |
1198 |
1199 |
1200 |
1201 |
1202 | A check box.
1203 |
1204 |
1205 |
1206 |
1207 |
1208 |
1210 |
1211 |
1212 | Image does not apply to checkBox.
1213 |
1214 |
1215 |
1216 |
1218 |
1219 |
1220 | ImageMso does not apply to checkBox.
1221 |
1222 |
1223 |
1224 |
1226 |
1227 |
1228 | GetImage does not apply to checkBox.
1229 |
1230 |
1231 |
1232 |
1234 |
1235 |
1236 | ShowImage does not apply to checkBox.
1237 |
1238 |
1239 |
1240 |
1242 |
1243 |
1244 | GetShowImage does not apply to checkBox.
1245 |
1246 |
1247 |
1248 |
1250 |
1251 |
1252 | ShowLabel does not apply to checkBox.
1253 |
1254 |
1255 |
1256 |
1258 |
1259 |
1260 | GetShowLabel does not apply to checkBox.
1261 |
1262 |
1263 |
1264 |
1265 |
1266 |
1267 |
1268 |
1269 |
1270 |
1271 |
1272 | An editBox.
1273 |
1274 |
1275 |
1276 |
1277 |
1278 |
1279 |
1282 |
1283 |
1284 | The maximum number of characters the user may enter.
1285 |
1286 |
1287 |
1288 |
1291 |
1292 |
1293 | Callback for to populate text in the edit box before the user edits it.
1294 |
1295 |
1296 |
1297 |
1300 |
1301 |
1302 | Callback that fires when the user changes the editBox content.
1303 |
1304 |
1305 |
1306 |
1309 |
1310 |
1311 | A representative string that sets the control's width.
1312 |
1313 |
1314 |
1315 |
1316 |
1317 |
1318 |
1319 |
1320 |
1321 |
1322 |
1323 |
1324 | An item in a dropdown-type control.
1325 |
1326 |
1327 |
1328 |
1331 |
1332 |
1333 | The ID of an item. Items cannot use idMso or idQ.
1334 |
1335 |
1336 |
1337 |
1340 |
1341 |
1342 | An item label.
1343 |
1344 |
1345 |
1346 |
1349 |
1350 |
1351 | An item image.
1352 |
1353 |
1354 |
1355 |
1358 |
1359 |
1360 | A built-in image.
1361 |
1362 |
1363 |
1364 |
1367 |
1368 |
1369 | The screentip.
1370 |
1371 |
1372 |
1373 |
1376 |
1377 |
1378 | The supertip.
1379 |
1380 |
1381 |
1382 |
1383 |
1384 |
1385 |
1386 |
1387 |
1388 | A comboBox control.
1389 |
1390 |
1391 |
1392 |
1393 |
1394 |
1395 |
1399 |
1400 |
1401 | An item in a comboBox.
1402 | When selected, the label of the item becomes text content of the comboBox.
1403 |
1404 |
1405 |
1406 |
1407 |
1408 |
1409 |
1410 |
1411 |
1412 |
1413 |
1414 |
1415 |
1416 |
1417 |
1418 | A dropdown-type control with a fixed size.
1419 | Contains items followed by buttons.
1420 | OnAction reports the selected item.
1421 |
1422 |
1423 |
1424 |
1425 |
1426 |
1427 |
1431 |
1432 |
1433 | An item in the dropdown.
1434 |
1435 |
1436 |
1437 |
1441 |
1442 |
1443 | Button in footer of dropdown.
1444 |
1445 |
1446 |
1447 |
1448 |
1449 |
1450 |
1451 |
1452 |
1455 |
1456 |
1457 | Callback that returns the ID of currently selected item.
1458 |
1459 |
1460 |
1461 |
1464 |
1465 |
1466 | Callback that returns the index of currently selected item.
1467 |
1468 |
1469 |
1470 |
1473 |
1474 |
1475 | Whether the label is shown or hidden on dropdown items.
1476 |
1477 |
1478 |
1479 |
1480 |
1481 |
1482 |
1483 |
1484 |
1485 |
1486 |
1487 | A dropdown grid control that can be sized.
1488 |
1489 |
1490 |
1491 |
1492 |
1493 |
1494 |
1495 |
1498 |
1499 |
1500 | Number of columns in dropdown gallery.
1501 |
1502 |
1503 |
1504 |
1507 |
1508 |
1509 | Number of rows in dropdown gallery.
1510 |
1511 |
1512 |
1513 |
1516 |
1517 |
1518 | Item width in pixels.
1519 |
1520 |
1521 |
1522 |
1525 |
1526 |
1527 | Item height in pixels.
1528 |
1529 |
1530 |
1531 |
1534 |
1535 |
1536 | Callback that returns the item width.
1537 |
1538 |
1539 |
1540 |
1543 |
1544 |
1545 | Callback that returns the item height.
1546 |
1547 |
1548 |
1549 |
1552 |
1553 |
1554 | Whether the label is shown or hidden on gallery items.
1555 |
1556 |
1557 |
1558 |
1559 |
1560 |
1561 |
1562 |
1563 |
1564 |
1565 |
1566 | A gallery control.
1567 |
1568 |
1569 |
1570 |
1571 |
1572 |
1573 |
1574 |
1575 |
1576 |
1577 |
1578 |
1579 |
1580 | A group of controls allowed in all menus.
1581 |
1582 |
1583 |
1584 |
1586 |
1587 |
1588 | Control can enable, disable, or clone built-in controls.
1589 |
1590 |
1591 |
1592 |
1594 |
1595 |
1596 | Button control.
1597 |
1598 |
1599 |
1600 |
1602 |
1603 |
1604 | CheckBox control.
1605 |
1606 |
1607 |
1608 |
1610 |
1611 |
1612 | Gallery control.
1613 |
1614 |
1615 |
1616 |
1618 |
1619 |
1620 | ToggleButton control.
1621 |
1622 |
1623 |
1624 |
1626 |
1627 |
1628 | Control group separator.
1629 |
1630 |
1631 |
1632 |
1633 |
1634 |
1635 |
1636 |
1637 |
1638 |
1639 | Defines menu or splitButton controls.
1640 |
1641 |
1642 |
1643 |
1645 |
1646 |
1647 | SplitButton control.
1648 |
1649 |
1650 |
1651 |
1653 |
1654 |
1655 | Menu.
1656 |
1657 |
1658 |
1659 |
1661 |
1662 |
1663 | DynamicMenu.
1664 |
1665 |
1666 |
1667 |
1668 |
1669 |
1670 |
1671 |
1672 |
1673 |
1674 | Menu or split button controls with title.
1675 |
1676 |
1677 |
1678 |
1680 |
1681 |
1682 | SplitButton control.
1683 |
1684 |
1685 |
1686 |
1688 |
1689 |
1690 | Menu.
1691 |
1692 |
1693 |
1694 |
1696 |
1697 |
1698 | DynamicMenu.
1699 |
1700 |
1701 |
1702 |
1703 |
1704 |
1705 |
1706 |
1707 |
1708 |
1709 |
1710 | The OfficeMenu control.
1711 |
1712 |
1713 |
1714 |
1715 |
1717 |
1718 |
1719 |
1720 |
1721 |
1722 |
1723 |
1724 |
1725 |
1726 |
1727 |
1728 | A menu with a fixed-size button.
1729 | Contains one or more controls or other menus.
1730 |
1731 |
1732 |
1733 |
1734 |
1735 |
1736 |
1738 |
1739 |
1740 |
1741 |
1742 |
1745 |
1746 |
1747 | The size of menu items.
1748 |
1749 |
1750 |
1751 |
1752 |
1753 |
1754 |
1755 |
1756 |
1757 |
1758 |
1759 |
1760 |
1761 | A dynamicMenu with a fixed-size button.
1762 |
1763 |
1764 |
1765 |
1766 |
1767 |
1768 |
1769 |
1770 |
1771 |
1772 |
1773 |
1774 |
1775 |
1776 |
1777 |
1778 |
1779 |
1780 | A menu with a fixed-size button.
1781 | Contains one or more controls or other menus and has a 'title' attribute.
1782 |
1783 |
1784 |
1785 |
1786 |
1787 |
1788 |
1790 |
1791 |
1792 |
1793 |
1794 |
1795 |
1798 |
1799 |
1800 | The size of menu items.
1801 |
1802 |
1803 |
1804 |
1805 |
1806 |
1807 |
1808 |
1809 |
1810 |
1811 |
1812 |
1813 | A menu with a button that can be sized.
1814 |
1815 |
1816 |
1817 |
1818 |
1819 |
1820 |
1823 |
1824 |
1825 | The size of menu items. Large menu items show the 'description' attribute inline.
1826 |
1827 |
1828 |
1829 |
1830 |
1831 |
1832 |
1833 |
1834 |
1835 |
1836 |
1837 | A dynamicMenu with a button that can be sized.
1838 |
1839 |
1840 |
1841 |
1842 |
1843 |
1844 |
1845 |
1846 |
1847 |
1848 |
1849 |
1850 |
1851 |
1852 |
1853 | A splitButton-type control with a fixed-size.
1854 | SplitButton contains a button or toggleButton and a menu.
1855 |
1856 |
1857 |
1858 |
1859 |
1860 |
1861 |
1862 |
1863 |
1864 |
1865 |
1866 |
1867 |
1868 |
1869 | Attributes that do not apply to splitButton.
1870 | They are inherited from the button inside of the splitButton.
1871 |
1872 |
1873 |
1874 |
1875 |
1876 |
1878 |
1879 |
1880 | Label does not apply to splitButton, set it on the button inside the splitButton.
1881 |
1882 |
1883 |
1884 |
1886 |
1887 |
1888 | GetLabel inherited from button inside splitButton.
1889 |
1890 |
1891 |
1892 |
1894 |
1895 |
1896 | Screentip inherited from button inside splitButton.
1897 |
1898 |
1899 |
1900 |
1902 |
1903 |
1904 | GetScreentip inherited from button inside splitButton.
1905 |
1906 |
1907 |
1908 |
1910 |
1911 |
1912 | Supertip inherited from button inside splitButton.
1913 |
1914 |
1915 |
1916 |
1918 |
1919 |
1920 | GetSuperTip inherited from button inside splitButton.
1921 |
1922 |
1923 |
1924 |
1926 |
1927 |
1928 | Image inherited from button inside splitButton.
1929 |
1930 |
1931 |
1932 |
1934 |
1935 |
1936 | ImageMso inherited from button inside splitButton.
1937 |
1938 |
1939 |
1940 |
1942 |
1943 |
1944 | GetImage inherited from button inside splitButton.
1945 |
1946 |
1947 |
1948 |
1950 |
1951 |
1952 | ShowImage inherited from button inside splitButton.
1953 |
1954 |
1955 |
1956 |
1958 |
1959 |
1960 | GetShowImage inherited from button inside splitButton.
1961 |
1962 |
1963 |
1964 |
1965 |
1966 |
1967 |
1968 |
1969 |
1970 |
1971 |
1972 | A splitButton with a fixed-size.
1973 | SplitButton contains a button or toggleButton and a menu.
1974 |
1975 |
1976 |
1977 |
1978 |
1979 |
1980 |
1981 |
1983 |
1984 |
1985 | Button.
1986 |
1987 |
1988 |
1989 |
1991 |
1992 |
1993 | ToggleButton.
1994 |
1995 |
1996 |
1997 |
1998 |
2000 |
2001 |
2002 | Menu.
2003 |
2004 |
2005 |
2006 |
2007 |
2008 |
2009 |
2010 |
2011 |
2012 |
2013 |
2014 |
2015 | A splitButton with a fixed-size, and title attribute.
2016 | SplitButton contains a button or toggleButton and a menu.
2017 |
2018 |
2019 |
2020 |
2021 |
2022 |
2023 |
2024 |
2026 |
2027 |
2028 | Button.
2029 |
2030 |
2031 |
2032 |
2034 |
2035 |
2036 | ToggleButton.
2037 |
2038 |
2039 |
2040 |
2041 |
2043 |
2044 |
2045 | Menu.
2046 |
2047 |
2048 |
2049 |
2050 |
2051 |
2052 |
2053 |
2054 |
2055 |
2056 |
2057 |
2058 | A splitButton that can be sized.
2059 | SplitButton contains a button or toggleButton and a menu.
2060 |
2061 |
2062 |
2063 |
2064 |
2065 |
2066 |
2067 |
2068 |
2069 |
2070 |
2071 |
2072 |
2073 |
2074 | Control types.
2075 |
2076 |
2077 |
2078 |
2080 |
2081 |
2082 | Control element can enable, disable or clone built-in controls.
2083 |
2084 |
2085 |
2086 |
2088 |
2089 |
2090 | LabelControl.
2091 | Shows text and/or image.
2092 |
2093 |
2094 |
2095 |
2097 |
2098 |
2099 | Button control.
2100 |
2101 |
2102 |
2103 |
2105 |
2106 |
2107 | ToggleButton control, a button with on/off state.
2108 |
2109 |
2110 |
2111 |
2113 |
2114 |
2115 | CheckBox control.
2116 |
2117 |
2118 |
2119 |
2121 |
2122 |
2123 | EditBox control.
2124 |
2125 |
2126 |
2127 |
2129 |
2130 |
2131 | ComboBox control.
2132 |
2133 |
2134 |
2135 |
2137 |
2138 |
2139 | DropDown control.
2140 |
2141 |
2142 |
2143 |
2145 |
2146 |
2147 | Gallery control.
2148 |
2149 |
2150 |
2151 |
2153 |
2154 |
2155 | Menu control.
2156 |
2157 |
2158 |
2159 |
2161 |
2162 |
2163 | DynamicMenu control.
2164 |
2165 |
2166 |
2167 |
2169 |
2170 |
2171 | SplitButton control.
2172 |
2173 |
2174 |
2175 |
2177 |
2178 |
2179 | Box control.
2180 |
2181 |
2182 |
2183 |
2185 |
2186 |
2187 | ButtonGroup control.
2188 |
2189 |
2190 |
2191 |
2192 |
2193 |
2194 |
2195 |
2196 |
2197 | ----------------------------------------------------------------------
2198 | Containers
2199 | ----------------------------------------------------------------------
2200 |
2201 |
2202 |
2203 |
2204 |
2205 |
2206 |
2207 | Opens a dialog related to its parent group.
2208 |
2209 |
2210 |
2211 |
2212 |
2216 |
2217 |
2218 | Opens a dialog related to its parent group.
2219 |
2220 |
2221 |
2222 |
2223 |
2224 |
2225 |
2226 |
2227 |
2228 |
2229 |
2230 | A box control, useful for grouping controls horizontally and vertically.
2231 |
2232 |
2233 |
2234 |
2237 |
2238 |
2239 |
2240 |
2243 |
2244 |
2245 | Flow of controls inside the box.
2246 |
2247 |
2248 |
2249 |
2250 |
2251 |
2252 |
2253 |
2254 |
2255 |
2256 | An in-Ribbon separator. Renders as a vertical bar.
2257 |
2258 |
2259 |
2260 |
2261 |
2262 |
2263 |
2264 |
2265 |
2266 |
2267 |
2268 |
2269 | A menuSeparator. Renders as a horizontal bar.
2270 |
2271 |
2272 |
2273 |
2274 |
2275 |
2276 |
2277 |
2278 |
2279 |
2280 |
2281 |
2282 | A ButtonGroup. A horizontal box with special visual appearance.
2283 |
2284 |
2285 |
2286 |
2287 |
2289 |
2291 |
2292 |
2293 | Control element can enable, disable or clone built-in controls.
2294 |
2295 |
2296 |
2297 |
2299 |
2300 |
2301 | Button.
2302 |
2303 |
2304 |
2305 |
2307 |
2308 |
2309 | ToggleButton control, a button with on/off state.
2310 |
2311 |
2312 |
2313 |
2315 |
2316 |
2317 | Gallery control.
2318 |
2319 |
2320 |
2321 |
2323 |
2324 |
2325 | Menu control.
2326 |
2327 |
2328 |
2329 |
2331 |
2332 |
2333 | DynamicMenu control.
2334 |
2335 |
2336 |
2337 |
2339 |
2340 |
2341 | SplitButton control.
2342 |
2343 |
2344 |
2345 |
2346 |
2347 |
2348 |
2349 |
2350 |
2351 |
2352 |
2353 |
2354 |
2355 |
2356 |
2357 | A group.
2358 |
2359 |
2360 |
2361 |
2362 |
2363 |
2365 |
2366 |
2368 |
2369 |
2370 | Separator control.
2371 |
2372 |
2373 |
2374 |
2375 |
2376 |
2380 |
2381 |
2382 | DialogBoxLauncher. Opens a dialog related to its parent group.
2383 |
2384 |
2385 |
2386 |
2387 |
2388 |
2389 |
2390 |
2391 |
2392 |
2393 |
2394 |
2395 |
2396 |
2397 |
2398 |
2399 |
2400 |
2401 | A tab that contains groups.
2402 |
2403 |
2404 |
2405 |
2406 |
2408 |
2410 |
2411 |
2412 |
2413 | Group. Contains controls.
2414 |
2415 |
2416 |
2417 |
2418 |
2419 |
2420 |
2421 |
2422 |
2423 |
2424 |
2425 |
2426 |
2427 |
2428 |
2429 |
2430 |
2431 |
2432 | Quick Access Toolbar items (shared or document-specific).
2433 |
2434 |
2435 |
2436 |
2437 |
2439 |
2441 |
2442 |
2443 | Control element can enable, disable or clone built-in controls.
2444 |
2445 |
2446 |
2447 |
2449 |
2450 |
2451 | Button control.
2452 |
2453 |
2454 |
2455 |
2457 |
2458 |
2459 | Control group separator.
2460 |
2461 |
2462 |
2463 |
2464 |
2465 |
2466 |
2467 |
2468 |
2469 |
2470 |
2471 |
2472 | The Quick Access Toolbar.
2473 | Two control collections: 1) Shared - applied to all windows and documents and 2) Document - attached to a document.
2474 |
2475 |
2476 |
2477 |
2478 |
2481 |
2482 |
2483 | Set of controls shared between all windows or instances of the application.
2484 |
2485 |
2486 |
2487 |
2490 |
2491 |
2492 | Set of controls attached to the current document.
2493 |
2494 |
2495 |
2496 |
2497 |
2498 |
2499 |
2500 |
2501 |
2502 |
2503 |
2504 | A collection of tabs.
2505 |
2506 |
2507 |
2508 |
2509 |
2513 |
2514 |
2515 | Tab.
2516 |
2517 |
2518 |
2519 |
2520 |
2521 |
2522 |
2523 |
2524 |
2525 |
2526 |
2527 | A collection of contextual tab sets.
2528 |
2529 |
2530 |
2531 |
2532 |
2536 |
2537 |
2538 | A Contextual Tab.
2539 |
2540 |
2541 |
2542 |
2543 |
2546 |
2547 |
2548 | The ID of a built-in control.
2549 |
2550 |
2551 |
2552 |
2553 |
2554 |
2555 |
2556 |
2557 |
2558 |
2559 |
2560 | A collection of contextual tab sets.
2561 |
2562 |
2563 |
2564 |
2565 |
2569 |
2570 |
2571 | TabSet.
2572 |
2573 |
2574 |
2575 |
2576 |
2577 |
2578 |
2579 |
2580 |
2581 | ----------------------------------------------------------------------
2582 | Root elements
2583 | ----------------------------------------------------------------------
2584 |
2585 |
2586 |
2587 |
2588 |
2589 |
2590 |
2591 | A collection of Command elements.
2592 |
2593 |
2594 |
2595 |
2596 |
2600 |
2601 |
2602 | Attribute overrides for all controls with specified idMso.
2603 |
2604 |
2605 |
2606 |
2607 |
2608 |
2609 |
2610 |
2611 |
2612 |
2613 | The Ribbon which contains the tabs, contextualTabs, officeMenu, and qat control types.
2614 |
2615 |
2616 |
2617 |
2618 |
2622 |
2623 |
2624 | OfficeMenu.
2625 |
2626 |
2627 |
2628 |
2632 |
2633 |
2634 | The Quick Access Toolbar.
2635 | Two control collections: 1) Shared - applied to all windows and documents and 2) Document - attached to a document.
2636 |
2637 |
2638 |
2639 |
2643 |
2644 |
2645 | A collection of tabs.
2646 |
2647 |
2648 |
2649 |
2653 |
2654 |
2655 | A collection of contextual tab sets.
2656 |
2657 |
2658 |
2659 |
2660 |
2663 |
2664 |
2665 | Whether startFromScratch is enabled. It's a mode that hides almost all of the standard UI.
2666 |
2667 |
2668 |
2669 |
2670 |
2671 |
2672 |
2673 |
2674 |
2675 | The root element of the customization XML returned by the getContent callback on dynamicMenus.
2676 |
2677 |
2678 |
2679 |
2680 |
2682 |
2683 |
2684 |
2685 |
2686 |
2687 |
2690 |
2691 |
2692 | The size of menu items.
2693 |
2694 |
2695 |
2696 |
2697 |
2698 |
2700 |
2701 |
2702 |
2703 | The root element of the customization XML used in dynamicMenu's getContent callback.
2704 |
2705 |
2706 |
2707 |
2708 |
2709 |
2710 |
2711 |
2712 |
2713 | The root element of the customization file which is used to create or modify the Ribbon and other UI elements.
2714 |
2715 |
2716 |
2717 |
2718 |
2722 |
2723 |
2724 | Command overrides.
2725 |
2726 |
2727 |
2728 |
2732 |
2733 |
2734 | Ribbon.
2735 |
2736 |
2737 |
2738 |
2739 |
2742 |
2743 |
2744 | Callback invoked when custom UI is loaded.
2745 | IRibbonUI object is passed as a parameter. This object exposes Invalidate and InvalidateControl.
2746 |
2747 |
2748 |
2749 |
2752 |
2753 |
2754 | A callback to load all images. If specified, all controls with the image attribute set will call this callback with the attribute value passed as a string.
2755 |
2756 |
2757 |
2758 |
2759 |
2760 |
2762 |
2763 |
2764 |
2765 | The root element used to create or modify the Ribbon and other UI components.
2766 |
2767 |
2768 |
2769 |
2770 |
2771 |
--------------------------------------------------------------------------------
/XmlSchemas/source.extension.vsixmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Excel-DNA XML Schemas
6 | Provides IntelliSense when editing .dna and ribbon extension .xml files for Excel-DNA add-ins.
7 | http://excel-dna.net
8 | ExcelDnaSmall.ico
9 | excel, excel-dna, ribbon, schema, xml
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------