Skip to content

Commit 99931ac

Browse files
committed
Fixed: Configurator.ExportTestClasses: get VBProject of application
1 parent 828dba9 commit 99931ac

File tree

8 files changed

+37
-7
lines changed

8 files changed

+37
-7
lines changed
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

source/AccUnit/Configuration/Configurator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void RemoveTestEnvironment(bool removeTestModules = false, bool exportMod
8282

8383
if (removeTestModules)
8484
{
85-
OfficeApplicationHelper officeApplicationHelper = new VbeOnlyApplicatonHelper(_vbProject.VBE);
85+
OfficeApplicationHelper officeApplicationHelper = new VBProjectOnlyApplicatonHelper(_vbProject);
8686
using (var testClassManager = new TestClassManager(officeApplicationHelper))
8787
{
8888
testClassManager.RemoveTestComponents(exportModulesBeforeRemoving);
@@ -110,7 +110,7 @@ public void ExportTestClasses(string exportPath = null, VBProject vbProject = nu
110110
if (vbProject != null)
111111
_vbProject = vbProject;
112112

113-
OfficeApplicationHelper officeApplicationHelper = new VbeOnlyApplicatonHelper(_vbProject.VBE);
113+
OfficeApplicationHelper officeApplicationHelper = new VBProjectOnlyApplicatonHelper(_vbProject);
114114
using (var testClassManager = new TestClassManager(officeApplicationHelper))
115115
{
116116
testClassManager.ExportTestClasses(exportPath);
@@ -119,7 +119,7 @@ public void ExportTestClasses(string exportPath = null, VBProject vbProject = nu
119119

120120
public void ImportTestClasses(string FileNameFilter = null, string importPath = null, VBProject VBProject = null)
121121
{
122-
OfficeApplicationHelper officeApplicationHelper = new VbeOnlyApplicatonHelper(_vbProject.VBE);
122+
OfficeApplicationHelper officeApplicationHelper = new VBProjectOnlyApplicatonHelper(_vbProject);
123123
using (var testClassManager = new TestClassManager(officeApplicationHelper))
124124
{
125125
testClassManager.ImportTestComponents(FileNameFilter, importPath, true);

source/AccUnit/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
3232
// indem Sie "*" wie unten gezeigt eingeben:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("0.8.6.0")]
35-
[assembly: AssemblyFileVersion("0.8.6.0")]
34+
[assembly: AssemblyVersion("0.8.7.0")]
35+
[assembly: AssemblyFileVersion("0.8.7.0")]

source/Common/Common.VBIDETools/AccessCodeLib.Common.VBIDETools.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
<Compile Include="VbaProjectManagement\VbeManager.cs" />
131131
<Compile Include="VbeAdapter.cs" />
132132
<Compile Include="VbeOnlyApplicatonHelper.cs" />
133+
<Compile Include="VbProjectOnlyApplicatonHelper.cs" />
133134
</ItemGroup>
134135
<ItemGroup>
135136
<COMReference Include="Microsoft.Office.Core">

source/Common/Common.VBIDETools/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
// Build Number
2929
// Revision
3030
//
31-
[assembly: AssemblyVersion("0.9.13.0")]
32-
[assembly: AssemblyFileVersion("0.9.13.0")]
31+
[assembly: AssemblyVersion("0.9.14.0")]
32+
[assembly: AssemblyFileVersion("0.9.14.0")]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using AccessCodeLib.Common.Tools.Logging;
2+
using Microsoft.Vbe.Interop;
3+
4+
namespace AccessCodeLib.Common.VBIDETools
5+
{
6+
public class VBProjectOnlyApplicatonHelper : OfficeApplicationHelper
7+
{
8+
private readonly VBProject _vbProject;
9+
10+
public VBProjectOnlyApplicatonHelper(VBProject vbProject)
11+
: base(vbProject)
12+
{
13+
_vbProject = vbProject;
14+
}
15+
16+
public override VBE VBE
17+
{
18+
get { return _vbProject.VBE; }
19+
}
20+
21+
protected override VBProject GetCheckedVbProject()
22+
{
23+
using (new BlockLogger())
24+
{
25+
return _vbProject;
26+
}
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)