├── .gitignore
├── LICENSE
├── Neo4jDriverExcelAddin.sln
├── Neo4jDriverExcelAddin
├── ExecuteCypherQueryArgs.cs
├── ExecuteQuery.Designer.cs
├── ExecuteQuery.cs
├── ExecuteQuery.resx
├── Neo4jDriverExcelAddin.csproj
├── Neo4jDriverExcelAddinRibbon.cs
├── Neo4jDriverExcelAddinRibbon.xml
├── Neo4jDriverExcelAddin_TemporaryKey.pfx
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── ThisAddIn.Designer.cs
├── ThisAddIn.Designer.xml
├── ThisAddIn.cs
└── packages.config
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 | *.VC.VC.opendb
85 |
86 | # Visual Studio profiler
87 | *.psess
88 | *.vsp
89 | *.vspx
90 | *.sap
91 |
92 | # TFS 2012 Local Workspace
93 | $tf/
94 |
95 | # Guidance Automation Toolkit
96 | *.gpState
97 |
98 | # ReSharper is a .NET coding add-in
99 | _ReSharper*/
100 | *.[Rr]e[Ss]harper
101 | *.DotSettings.user
102 |
103 | # JustCode is a .NET coding add-in
104 | .JustCode
105 |
106 | # TeamCity is a build add-in
107 | _TeamCity*
108 |
109 | # DotCover is a Code Coverage Tool
110 | *.dotCover
111 |
112 | # NCrunch
113 | _NCrunch_*
114 | .*crunch*.local.xml
115 | nCrunchTemp_*
116 |
117 | # MightyMoose
118 | *.mm.*
119 | AutoTest.Net/
120 |
121 | # Web workbench (sass)
122 | .sass-cache/
123 |
124 | # Installshield output folder
125 | [Ee]xpress/
126 |
127 | # DocProject is a documentation generator add-in
128 | DocProject/buildhelp/
129 | DocProject/Help/*.HxT
130 | DocProject/Help/*.HxC
131 | DocProject/Help/*.hhc
132 | DocProject/Help/*.hhk
133 | DocProject/Help/*.hhp
134 | DocProject/Help/Html2
135 | DocProject/Help/html
136 |
137 | # Click-Once directory
138 | publish/
139 |
140 | # Publish Web Output
141 | *.[Pp]ublish.xml
142 | *.azurePubxml
143 | # TODO: Comment the next line if you want to checkin your web deploy settings
144 | # but database connection strings (with potential passwords) will be unencrypted
145 | *.pubxml
146 | *.publishproj
147 |
148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
149 | # checkin your Azure Web App publish settings, but sensitive information contained
150 | # in these scripts will be unencrypted
151 | PublishScripts/
152 |
153 | # NuGet Packages
154 | *.nupkg
155 | # The packages folder can be ignored because of Package Restore
156 | **/packages/*
157 | # except build/, which is used as an MSBuild target.
158 | !**/packages/build/
159 | # Uncomment if necessary however generally it will be regenerated when needed
160 | #!**/packages/repositories.config
161 | # NuGet v3's project.json files produces more ignoreable files
162 | *.nuget.props
163 | *.nuget.targets
164 |
165 | # Microsoft Azure Build Output
166 | csx/
167 | *.build.csdef
168 |
169 | # Microsoft Azure Emulator
170 | ecf/
171 | rcf/
172 |
173 | # Windows Store app package directories and files
174 | AppPackages/
175 | BundleArtifacts/
176 | Package.StoreAssociation.xml
177 | _pkginfo.txt
178 |
179 | # Visual Studio cache files
180 | # files ending in .cache can be ignored
181 | *.[Cc]ache
182 | # but keep track of directories ending in .cache
183 | !*.[Cc]ache/
184 |
185 | # Others
186 | ClientBin/
187 | ~$*
188 | *~
189 | *.dbmdl
190 | *.dbproj.schemaview
191 | *.pfx
192 | *.publishsettings
193 | node_modules/
194 | orleans.codegen.cs
195 |
196 | # Since there are multiple workflows, uncomment next line to ignore bower_components
197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
198 | #bower_components/
199 |
200 | # RIA/Silverlight projects
201 | Generated_Code/
202 |
203 | # Backup & report files from converting an old project file
204 | # to a newer Visual Studio version. Backup files are not needed,
205 | # because we have git ;-)
206 | _UpgradeReport_Files/
207 | Backup*/
208 | UpgradeLog*.XML
209 | UpgradeLog*.htm
210 |
211 | # SQL Server files
212 | *.mdf
213 | *.ldf
214 |
215 | # Business Intelligence projects
216 | *.rdl.data
217 | *.bim.layout
218 | *.bim_*.settings
219 |
220 | # Microsoft Fakes
221 | FakesAssemblies/
222 |
223 | # GhostDoc plugin setting file
224 | *.GhostDoc.xml
225 |
226 | # Node.js Tools for Visual Studio
227 | .ntvs_analysis.dat
228 |
229 | # Visual Studio 6 build log
230 | *.plg
231 |
232 | # Visual Studio 6 workspace options file
233 | *.opt
234 |
235 | # Visual Studio LightSwitch build output
236 | **/*.HTMLClient/GeneratedArtifacts
237 | **/*.DesktopClient/GeneratedArtifacts
238 | **/*.DesktopClient/ModelManifest.xml
239 | **/*.Server/GeneratedArtifacts
240 | **/*.Server/ModelManifest.xml
241 | _Pvt_Extensions
242 |
243 | # Paket dependency manager
244 | .paket/paket.exe
245 | paket-files/
246 |
247 | # FAKE - F# Make
248 | .fake/
249 |
250 | # JetBrains Rider
251 | .idea/
252 | *.sln.iml
253 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 Chris Skardon
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Neo4jDriverExcelAddin", "Neo4jDriverExcelAddin\Neo4jDriverExcelAddin.csproj", "{D863562F-C7F1-41E7-94E9-0ED9846A0EAB}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{99AE191A-1A0C-4531-AD05-48299A2E9EA3}"
9 | ProjectSection(SolutionItems) = preProject
10 | LICENSE = LICENSE
11 | README.md = README.md
12 | EndProjectSection
13 | EndProject
14 | Global
15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
16 | Debug|Any CPU = Debug|Any CPU
17 | Release|Any CPU = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {D863562F-C7F1-41E7-94E9-0ED9846A0EAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {D863562F-C7F1-41E7-94E9-0ED9846A0EAB}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {D863562F-C7F1-41E7-94E9-0ED9846A0EAB}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {D863562F-C7F1-41E7-94E9-0ED9846A0EAB}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/ExecuteCypherQueryArgs.cs:
--------------------------------------------------------------------------------
1 | namespace Neo4jDriverExcelAddin
2 | {
3 | using System;
4 |
5 | internal class ExecuteCypherQueryArgs : EventArgs
6 | {
7 | public string Cypher { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/ExecuteQuery.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace Neo4jDriverExcelAddin
2 | {
3 | using System;
4 |
5 | partial class ExecuteQuery
6 | {
7 | ///
8 | /// Required designer variable.
9 | ///
10 | private System.ComponentModel.IContainer components = null;
11 |
12 | ///
13 | /// Clean up any resources being used.
14 | ///
15 | /// true if managed resources should be disposed; otherwise, false.
16 | protected override void Dispose(bool disposing)
17 | {
18 | if (disposing && (components != null))
19 | {
20 | components.Dispose();
21 | }
22 |
23 | if (disposing)
24 | {
25 | ExecuteCypher = null;
26 | }
27 |
28 | base.Dispose(disposing);
29 | }
30 |
31 | #region Component Designer generated code
32 |
33 | ///
34 | /// Required method for Designer support - do not modify
35 | /// the contents of this method with the code editor.
36 | ///
37 | private void InitializeComponent()
38 | {
39 | this.txtCypher = new System.Windows.Forms.TextBox();
40 | this.btnExecute = new System.Windows.Forms.Button();
41 | this.txtNeoResponse = new System.Windows.Forms.TextBox();
42 | this.SuspendLayout();
43 | //
44 | // txtCypher
45 | //
46 | this.txtCypher.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
47 | | System.Windows.Forms.AnchorStyles.Left)
48 | | System.Windows.Forms.AnchorStyles.Right)));
49 | this.txtCypher.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
50 | this.txtCypher.Location = new System.Drawing.Point(0, 0);
51 | this.txtCypher.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
52 | this.txtCypher.Multiline = true;
53 | this.txtCypher.Name = "txtCypher";
54 | this.txtCypher.Size = new System.Drawing.Size(453, 233);
55 | this.txtCypher.TabIndex = 0;
56 | //
57 | // btnExecute
58 | //
59 | this.btnExecute.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
60 | this.btnExecute.Location = new System.Drawing.Point(323, 239);
61 | this.btnExecute.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
62 | this.btnExecute.Name = "btnExecute";
63 | this.btnExecute.Size = new System.Drawing.Size(130, 48);
64 | this.btnExecute.TabIndex = 1;
65 | this.btnExecute.Text = "Execute Cypher";
66 | this.btnExecute.UseVisualStyleBackColor = true;
67 | this.btnExecute.Click += new System.EventHandler(this.btnExecute_Click);
68 | //
69 | // txtNeoResponse
70 | //
71 | this.txtNeoResponse.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
72 | | System.Windows.Forms.AnchorStyles.Right)));
73 | this.txtNeoResponse.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
74 | this.txtNeoResponse.Location = new System.Drawing.Point(0, 292);
75 | this.txtNeoResponse.Multiline = true;
76 | this.txtNeoResponse.Name = "txtNeoResponse";
77 | this.txtNeoResponse.ReadOnly = true;
78 | this.txtNeoResponse.Size = new System.Drawing.Size(453, 206);
79 | this.txtNeoResponse.TabIndex = 2;
80 | //
81 | // ExecuteQuery
82 | //
83 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
84 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
85 | this.Controls.Add(this.txtNeoResponse);
86 | this.Controls.Add(this.btnExecute);
87 | this.Controls.Add(this.txtCypher);
88 | this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
89 | this.Name = "ExecuteQuery";
90 | this.Size = new System.Drawing.Size(453, 498);
91 | this.ResumeLayout(false);
92 | this.PerformLayout();
93 |
94 | }
95 |
96 | #endregion
97 |
98 | private System.Windows.Forms.TextBox txtCypher;
99 | private System.Windows.Forms.Button btnExecute;
100 |
101 |
102 | internal EventHandler ExecuteCypher;
103 | private System.Windows.Forms.TextBox txtNeoResponse;
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/ExecuteQuery.cs:
--------------------------------------------------------------------------------
1 | namespace Neo4jDriverExcelAddin
2 | {
3 | using System;
4 | using System.Windows.Forms;
5 |
6 | public partial class ExecuteQuery : UserControl
7 | {
8 | public ExecuteQuery()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void btnExecute_Click(object sender, EventArgs e)
14 | {
15 | RaiseExecuteCypherEvent(txtCypher.Text);
16 | }
17 |
18 | private void RaiseExecuteCypherEvent(string cypher)
19 | {
20 | if (string.IsNullOrWhiteSpace(cypher))
21 | return;
22 |
23 | ExecuteCypher?.Invoke(this, new ExecuteCypherQueryArgs {Cypher = cypher});
24 | }
25 |
26 | public void SetMessage(string message)
27 | {
28 | txtNeoResponse.Text = message;
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/ExecuteQuery.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 |
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/Neo4jDriverExcelAddin.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
21 |
22 | {BAA0C2D2-18E2-41B9-852F-F413020CAA33};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
23 | Debug
24 | AnyCPU
25 | {D863562F-C7F1-41E7-94E9-0ED9846A0EAB}
26 | Library
27 | false
28 | Neo4jDriverExcelAddin
29 | Neo4jDriverExcelAddin
30 | 3
31 | v4.6.1
32 | VSTO40
33 | true
34 | HomeSite
35 |
36 |
37 |
38 | False
39 | Microsoft Visual Studio 2010 Tools for Office Runtime %28x86 and x64%29
40 | true
41 |
42 |
43 | False
44 | Windows Installer 4.5
45 | true
46 |
47 |
48 |
49 |
53 | Excel
54 |
55 |
71 |
72 | true
73 | full
74 | false
75 | bin\Debug\
76 | false
77 | $(DefineConstants);DEBUG;TRACE
78 | 4
79 |
80 |
96 |
97 | pdbonly
98 | true
99 | bin\Release\
100 | false
101 | $(DefineConstants);TRACE
102 | 4
103 |
104 |
107 |
108 |
109 |
110 | ..\packages\Neo4j.Driver.1.0.2\lib\dotnet\Neo4j.Driver.dll
111 | True
112 |
113 |
114 | ..\packages\rda.SocketsForPCL.1.2.2\lib\net45\Sockets.Plugin.dll
115 | True
116 |
117 |
118 | ..\packages\rda.SocketsForPCL.1.2.2\lib\net45\Sockets.Plugin.Abstractions.dll
119 | True
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 | True
141 |
142 |
143 |
144 |
145 | False
146 | true
147 |
148 |
149 | False
150 | true
151 |
152 |
153 | False
154 |
155 |
156 |
166 |
167 |
168 |
169 | UserControl
170 |
171 |
172 | ExecuteQuery.cs
173 |
174 |
175 |
176 | Code
177 |
178 |
179 | ExecuteQuery.cs
180 |
181 |
182 | ResXFileCodeGenerator
183 | Resources.Designer.cs
184 | Designer
185 |
186 |
187 | True
188 | Resources.resx
189 |
190 |
191 |
192 |
193 | SettingsSingleFileGenerator
194 | Settings.Designer.cs
195 |
196 |
197 | True
198 | Settings.settings
199 |
200 |
201 | Code
202 |
203 |
204 | ThisAddIn.cs
205 |
206 |
207 | ThisAddIn.Designer.xml
208 |
209 |
210 |
211 |
212 |
213 | Designer
214 |
215 |
216 |
217 | 10.0
218 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
219 |
220 |
221 | true
222 |
223 |
224 | Neo4jDriverExcelAddin_TemporaryKey.pfx
225 |
226 |
227 | 23C612D863B3F0DB982584391D81F89FAC83FEC3
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/Neo4jDriverExcelAddinRibbon.cs:
--------------------------------------------------------------------------------
1 | using Office = Microsoft.Office.Core;
2 |
3 | namespace Neo4jDriverExcelAddin
4 | {
5 | using System;
6 | using System.IO;
7 | using System.Reflection;
8 | using System.Runtime.InteropServices;
9 |
10 | [ComVisible(true)]
11 | public class Neo4jDriverExcelAddinRibbon : Office.IRibbonExtensibility
12 | {
13 | private Office.IRibbonUI _ribbon;
14 |
15 | #region IRibbonExtensibility Members
16 |
17 | public string GetCustomUI(string ribbonID)
18 | {
19 | return GetResourceText("Neo4jDriverExcelAddin.Neo4jDriverExcelAddinRibbon.xml");
20 | }
21 |
22 | #endregion
23 |
24 | internal event EventHandler ShowHide;
25 |
26 | public void OnShowHideButton(Office.IRibbonControl control)
27 | {
28 | ShowHide?.Invoke(this, null);
29 | }
30 |
31 | #region Ribbon Callbacks
32 |
33 | //Create callback methods here. For more information about adding callback methods, visit http://go.microsoft.com/fwlink/?LinkID=271226
34 |
35 | public void Ribbon_Load(Office.IRibbonUI ribbonUI)
36 | {
37 | _ribbon = ribbonUI;
38 | }
39 |
40 | #endregion
41 |
42 | #region Helpers
43 |
44 | private static string GetResourceText(string resourceName)
45 | {
46 | var asm = Assembly.GetExecutingAssembly();
47 | var resourceNames = asm.GetManifestResourceNames();
48 | for (var i = 0; i < resourceNames.Length; ++i)
49 | {
50 | if (string.Compare(resourceName, resourceNames[i], StringComparison.OrdinalIgnoreCase) == 0)
51 | {
52 | using (var resourceReader = new StreamReader(asm.GetManifestResourceStream(resourceNames[i])))
53 | {
54 | if (resourceReader != null)
55 | {
56 | return resourceReader.ReadToEnd();
57 | }
58 | }
59 | }
60 | }
61 | return null;
62 | }
63 |
64 | #endregion
65 | }
66 | }
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/Neo4jDriverExcelAddinRibbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/Neo4jDriverExcelAddin_TemporaryKey.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DotNet4Neo4j/Neo4jDriverExcelAddin/e2e4f9a06afbfa47bb1c86514372fd3dc63a4528/Neo4jDriverExcelAddin/Neo4jDriverExcelAddin_TemporaryKey.pfx
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using System.Security;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("Neo4jDriverExcelAddin")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("Neo4jDriverExcelAddin")]
14 | [assembly: AssemblyCopyright("Copyright © 2016")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | // Setting ComVisible to false makes the types in this assembly not visible
19 | // to COM components. If you need to access a type in this assembly from
20 | // COM, set the ComVisible attribute to true on that type.
21 | [assembly: ComVisible(false)]
22 |
23 | // The following GUID is for the ID of the typelib if this project is exposed to COM
24 | [assembly: Guid("50f6ebc3-adbe-491b-a1ec-82611d9e2ce7")]
25 |
26 | // Version information for an assembly consists of the following four values:
27 | //
28 | // Major Version
29 | // Minor Version
30 | // Build Number
31 | // Revision
32 | //
33 | // You can specify all the values or you can default the Build and Revision Numbers
34 | // by using the '*' as shown below:
35 | // [assembly: AssemblyVersion("1.0.*")]
36 | [assembly: AssemblyVersion("1.0.0.0")]
37 | [assembly: AssemblyFileVersion("1.0.0.0")]
38 |
39 |
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Neo4jDriverExcelAddin.Properties {
12 |
13 |
14 | ///
15 | /// A strongly-typed resource class, for looking up localized strings, etc.
16 | ///
17 | // This class was auto-generated by the StronglyTypedResourceBuilder
18 | // class via a tool like ResGen or Visual Studio.
19 | // To add or remove a member, edit your .ResX file then rerun ResGen
20 | // with the /str option, or rebuild your VS project.
21 |
22 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
23 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
24 | internal class Resources {
25 |
26 | private static global::System.Resources.ResourceManager resourceMan;
27 |
28 | private static global::System.Globalization.CultureInfo resourceCulture;
29 |
30 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
31 | internal Resources() {
32 | }
33 |
34 | ///
35 | /// Returns the cached ResourceManager instance used by this class.
36 | ///
37 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
38 | internal static global::System.Resources.ResourceManager ResourceManager {
39 | get {
40 | if (object.ReferenceEquals(resourceMan, null)) {
41 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Neo4jDriverExcelAddin.Properties.Resources", typeof(Resources).Assembly);
42 | resourceMan = temp;
43 | }
44 | return resourceMan;
45 | }
46 | }
47 |
48 | ///
49 | /// Overrides the current thread's CurrentUICulture property for all
50 | /// resource lookups using this strongly typed resource class.
51 | ///
52 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
53 | internal static global::System.Globalization.CultureInfo Culture {
54 | get {
55 | return resourceCulture;
56 | }
57 | set {
58 | resourceCulture = value;
59 | }
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Neo4jDriverExcelAddin.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/ThisAddIn.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | #pragma warning disable 414
12 | namespace Neo4jDriverExcelAddin {
13 |
14 |
15 | ///
16 | [Microsoft.VisualStudio.Tools.Applications.Runtime.StartupObjectAttribute(0)]
17 | [global::System.Security.Permissions.PermissionSetAttribute(global::System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
18 | public sealed partial class ThisAddIn : Microsoft.Office.Tools.AddInBase {
19 |
20 | internal Microsoft.Office.Tools.CustomTaskPaneCollection CustomTaskPanes;
21 |
22 | internal Microsoft.Office.Tools.SmartTagCollection VstoSmartTags;
23 |
24 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
25 | private global::System.Object missing = global::System.Type.Missing;
26 |
27 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
28 | internal Microsoft.Office.Interop.Excel.Application Application;
29 |
30 | ///
31 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
32 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
33 | public ThisAddIn(global::Microsoft.Office.Tools.Excel.ApplicationFactory factory, global::System.IServiceProvider serviceProvider) :
34 | base(factory, serviceProvider, "AddIn", "ThisAddIn") {
35 | Globals.Factory = factory;
36 | }
37 |
38 | ///
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
41 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
42 | protected override void Initialize() {
43 | base.Initialize();
44 | this.Application = this.GetHostItem(typeof(Microsoft.Office.Interop.Excel.Application), "Application");
45 | Globals.ThisAddIn = this;
46 | global::System.Windows.Forms.Application.EnableVisualStyles();
47 | this.InitializeCachedData();
48 | this.InitializeControls();
49 | this.InitializeComponents();
50 | this.InitializeData();
51 | }
52 |
53 | ///
54 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
55 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
56 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
57 | protected override void FinishInitialization() {
58 | this.InternalStartup();
59 | this.OnStartup();
60 | }
61 |
62 | ///
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
65 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
66 | protected override void InitializeDataBindings() {
67 | this.BeginInitialization();
68 | this.BindToData();
69 | this.EndInitialization();
70 | }
71 |
72 | ///
73 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
74 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
75 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
76 | private void InitializeCachedData() {
77 | if ((this.DataHost == null)) {
78 | return;
79 | }
80 | if (this.DataHost.IsCacheInitialized) {
81 | this.DataHost.FillCachedData(this);
82 | }
83 | }
84 |
85 | ///
86 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
87 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
88 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
89 | private void InitializeData() {
90 | }
91 |
92 | ///
93 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
94 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
95 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
96 | private void BindToData() {
97 | }
98 |
99 | ///
100 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
101 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
102 | private void StartCaching(string MemberName) {
103 | this.DataHost.StartCaching(this, MemberName);
104 | }
105 |
106 | ///
107 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
108 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
109 | private void StopCaching(string MemberName) {
110 | this.DataHost.StopCaching(this, MemberName);
111 | }
112 |
113 | ///
114 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
115 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
116 | private bool IsCached(string MemberName) {
117 | return this.DataHost.IsCached(this, MemberName);
118 | }
119 |
120 | ///
121 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
122 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
123 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
124 | private void BeginInitialization() {
125 | this.BeginInit();
126 | this.CustomTaskPanes.BeginInit();
127 | this.VstoSmartTags.BeginInit();
128 | }
129 |
130 | ///
131 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
132 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
133 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
134 | private void EndInitialization() {
135 | this.VstoSmartTags.EndInit();
136 | this.CustomTaskPanes.EndInit();
137 | this.EndInit();
138 | }
139 |
140 | ///
141 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
142 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
143 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
144 | private void InitializeControls() {
145 | this.CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(null, null, "CustomTaskPanes", "CustomTaskPanes", this);
146 | this.VstoSmartTags = Globals.Factory.CreateSmartTagCollection(null, null, "VstoSmartTags", "VstoSmartTags", this);
147 | }
148 |
149 | ///
150 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
151 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
152 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
153 | private void InitializeComponents() {
154 | }
155 |
156 | ///
157 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
158 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
159 | private bool NeedsFill(string MemberName) {
160 | return this.DataHost.NeedsFill(this, MemberName);
161 | }
162 |
163 | ///
164 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
165 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
166 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
167 | protected override void OnShutdown() {
168 | this.VstoSmartTags.Dispose();
169 | this.CustomTaskPanes.Dispose();
170 | base.OnShutdown();
171 | }
172 | }
173 |
174 | ///
175 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
176 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
177 | internal sealed partial class Globals {
178 |
179 | ///
180 | private Globals() {
181 | }
182 |
183 | private static ThisAddIn _ThisAddIn;
184 |
185 | private static global::Microsoft.Office.Tools.Excel.ApplicationFactory _factory;
186 |
187 | private static ThisRibbonCollection _ThisRibbonCollection;
188 |
189 | internal static ThisAddIn ThisAddIn {
190 | get {
191 | return _ThisAddIn;
192 | }
193 | set {
194 | if ((_ThisAddIn == null)) {
195 | _ThisAddIn = value;
196 | }
197 | else {
198 | throw new System.NotSupportedException();
199 | }
200 | }
201 | }
202 |
203 | internal static global::Microsoft.Office.Tools.Excel.ApplicationFactory Factory {
204 | get {
205 | return _factory;
206 | }
207 | set {
208 | if ((_factory == null)) {
209 | _factory = value;
210 | }
211 | else {
212 | throw new System.NotSupportedException();
213 | }
214 | }
215 | }
216 |
217 | internal static ThisRibbonCollection Ribbons {
218 | get {
219 | if ((_ThisRibbonCollection == null)) {
220 | _ThisRibbonCollection = new ThisRibbonCollection(_factory.GetRibbonFactory());
221 | }
222 | return _ThisRibbonCollection;
223 | }
224 | }
225 | }
226 |
227 | ///
228 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
229 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Office.ProgrammingModel.dll", "14.0.0.0")]
230 | internal sealed partial class ThisRibbonCollection : Microsoft.Office.Tools.Ribbon.RibbonCollectionBase {
231 |
232 | ///
233 | internal ThisRibbonCollection(global::Microsoft.Office.Tools.Ribbon.RibbonFactory factory) :
234 | base(factory) {
235 | }
236 | }
237 | }
238 |
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/ThisAddIn.Designer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/ThisAddIn.cs:
--------------------------------------------------------------------------------
1 | using Office = Microsoft.Office.Core;
2 |
3 | namespace Neo4jDriverExcelAddin
4 | {
5 | using System;
6 | using System.Globalization;
7 | using System.Linq;
8 | using Microsoft.Office.Interop.Excel;
9 | using Microsoft.Office.Tools;
10 | using Neo4j.Driver.V1;
11 |
12 | public partial class ThisAddIn
13 | {
14 | private CustomTaskPane _customTaskPane;
15 | private IDriver _driver;
16 | private Neo4jDriverExcelAddinRibbon _ribbon;
17 |
18 | protected override Office.IRibbonExtensibility CreateRibbonExtensibilityObject()
19 | {
20 | _ribbon = new Neo4jDriverExcelAddinRibbon();
21 | _ribbon.ShowHide += RibbonShowHide;
22 | return _ribbon;
23 | }
24 |
25 | private void RibbonShowHide(object sender, EventArgs e)
26 | {
27 | bool forceVisible = false;
28 | if (_customTaskPane == null)
29 | {
30 | InitializePane();
31 | forceVisible = true;
32 | }
33 |
34 | if (_customTaskPane != null)
35 | _customTaskPane.Visible = forceVisible || !_customTaskPane.Visible;
36 | }
37 |
38 | private void ThisAddIn_Startup(object sender, EventArgs e)
39 | {
40 | _driver = GraphDatabase.Driver(new Uri("bolt://localhost")); //TODO: Hard coded Neo4j Instance URL
41 | }
42 |
43 | private void ThisAddIn_Shutdown(object sender, EventArgs e)
44 | {
45 | RemoveOrphanedTaskPanes();
46 | _driver?.Dispose();
47 | }
48 |
49 | private void RemoveOrphanedTaskPanes()
50 | {
51 | try
52 | {
53 | for (var i = CustomTaskPanes.Count; i > 0; i--)
54 | {
55 | var ctp = CustomTaskPanes[i - 1];
56 | if (ctp.Window == null)
57 | {
58 | CustomTaskPanes.Remove(ctp);
59 | var control = ctp.Control as ExecuteQuery;
60 | control?.Dispose();
61 | }
62 | }
63 | }
64 | catch (ObjectDisposedException)
65 | {
66 | }
67 | }
68 |
69 | internal ExecuteQuery InitializePane()
70 | {
71 | try
72 | {
73 | var gotPane = GetPane();
74 | if (gotPane != null)
75 | {
76 | _customTaskPane = gotPane;
77 |
78 | return _customTaskPane.Control as ExecuteQuery;
79 | }
80 |
81 | var executeQueryControl = new ExecuteQuery();
82 | executeQueryControl.ExecuteCypher += ExecuteCypher;
83 |
84 | _customTaskPane = CustomTaskPanes.Add(executeQueryControl, "Execute Query");
85 |
86 | _customTaskPane.Visible = true;
87 | return executeQueryControl;
88 | }
89 | catch
90 | {
91 | return null;
92 | }
93 | }
94 |
95 | internal ExecuteQuery CurrentControl => _customTaskPane.Control as ExecuteQuery;
96 |
97 | ///
98 | /// Gets the appropriate Excel column name given a number index.
99 | ///
100 | /// Initial source: http://stackoverflow.com/questions/4583191/incrementation-of-char
101 | private static string GetColNameFromIndex(int columnNumber)
102 | {
103 | int dividend = columnNumber;
104 | string columnName = string.Empty;
105 |
106 | while (dividend > 0)
107 | {
108 | var modulo = (dividend - 1) % 26;
109 | columnName = Convert.ToChar(65 + modulo) + columnName;
110 | dividend = (dividend - modulo) / 26;
111 | }
112 |
113 | return columnName;
114 | }
115 |
116 |
117 | private void ExecuteCypher(object sender, ExecuteCypherQueryArgs e)
118 | {
119 | try
120 | {
121 | var worksheet = ((Worksheet) Application.ActiveSheet);
122 |
123 | using (var session = _driver.Session())
124 | {
125 | var result = session.Run(e.Cypher);
126 | bool isFirstRow = true;
127 | int row = 2;
128 | foreach (var record in result)
129 | {
130 | for (int i = 0; i < record.Keys.Count; i++)
131 | {
132 | var colName = GetColNameFromIndex(i + 1);
133 | var key = record.Keys[i];
134 | if (isFirstRow)
135 | worksheet.Range[$"{colName}1"].Value2 = key;
136 | worksheet.Range[$"{colName}{row}"].Value2 = record.Values[key].As();
137 | }
138 | row++;
139 | isFirstRow = false;
140 | }
141 | }
142 | }
143 | catch (Neo4jException ex)
144 | {
145 | CurrentControl.SetMessage(ex.Message);
146 | }
147 | }
148 |
149 | ///
150 | ///
151 | /// Based on:
152 | /// http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/COMMUNITYTAGS/V4.0d/root/projects/extensions/AlfrescoOffice2007/AlfrescoWord2007/ThisAddIn.cs
153 | ///
154 | ///
155 | private CustomTaskPane GetPane()
156 | {
157 | try
158 | {
159 | if (CustomTaskPanes.Count > 0)
160 | {
161 | foreach (var ctp in CustomTaskPanes)
162 | {
163 | try
164 | {
165 | if (ctp.Window == Application.ActiveWindow)
166 | {
167 | return ctp;
168 | }
169 | }
170 | catch
171 | {
172 | // Likely due to no active window
173 | if (ctp.Window == null)
174 | {
175 | // This is the one
176 | return ctp;
177 | }
178 | }
179 | }
180 | }
181 | }
182 | catch
183 | {
184 | return null;
185 | }
186 | return null;
187 | }
188 |
189 | #region VSTO generated code
190 |
191 | ///
192 | /// Required method for Designer support - do not modify
193 | /// the contents of this method with the code editor.
194 | ///
195 | private void InternalStartup()
196 | {
197 | Startup += ThisAddIn_Startup;
198 | Shutdown += ThisAddIn_Shutdown;
199 | }
200 |
201 | #endregion
202 | }
203 | }
--------------------------------------------------------------------------------
/Neo4jDriverExcelAddin/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Neo4j-Driver Excel Addin
2 |
3 | This is a super early super alpha super use this as a starting point example of using the `Neo4j-Driver` nuget package
4 | within a VSTO (Visual Studio Tools for Office) application (in this case *Excel*).
5 |
6 | This is mainly just a proof of concept at the moment.
7 |
8 | ## Things to note:
9 |
10 | * Server location is hard coded (to `bolt://localhost`)
11 | * The Column results are put into is hard coded (to `A`)
12 | * The Column retrieved from the Cypher is hard coded (to `UserId`)
13 |
14 | ## Example
15 |
16 | ![alt text][examplegif]
17 |
18 | ## To Use
19 |
20 | Clone the code, open in Visual Studio, and Run. This will start up Excel and then simply click on the 'Add-ins' menu in the
21 | ribbon. You will need to provide Cypher that returns a single column with the alias of `UserId` for example:
22 |
23 | `MATCH (u:User) RETURN u.Id AS UserId LIMIT 10`
24 |
25 | or
26 |
27 | `MATCH (h:House) RETURN h.Address AS UserId`
28 |
29 | This is due to the hard coding of the column retrieved.
30 |
31 | # !!! REMEMBER - THIS IS A PROOF OF CONCEPT !!!
32 |
33 |
34 | [examplegif]: https://p5iwog-ch3302.files.1drv.com/y3mIDySDI5TkjaBoPPstG_LLqDA94VNFbzV-nccm_3B70lu445RCrmZNacSeU9QVYy1Bpz-sw4qHXwKDojVLB38HjWtSdjwhLQr-PQZjjwpqTV6MezuyfmVNN51Yauy2KPT5Pn5uHQPq6grk2Jjycu6qCqOYLETkNJ6my1ddSrCyefkLeM_N7jzjYaFtDOGBNbJ/improvedExcelAddin.gif?psid=1 "Example of the addin working"
--------------------------------------------------------------------------------