Skip to content

Commit 8f6f295

Browse files
committed
Starting Access document resolvers
1 parent a52afc5 commit 8f6f295

File tree

5 files changed

+59
-1
lines changed

5 files changed

+59
-1
lines changed

Rubberduck.VBEEditor/Application/AccessApp.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
using System.Collections.Generic;
2+
using System.IO;
3+
using System.Reflection;
4+
using Microsoft.Office.Interop.Access;
5+
16
namespace Rubberduck.VBEditor.Application
27
{
38
public class AccessApp : HostApplicationBase<Microsoft.Office.Interop.Access.Application>
@@ -10,6 +15,21 @@ public override void Run(QualifiedMemberName qualifiedMemberName)
1015
Application.Run(call);
1116
}
1217

18+
//public List<string> FormDeclarations(QualifiedModuleName qualifiedModuleName)
19+
//{
20+
// Application.DoCmd.OutputTo(AcOutputObjectType.acOutputForm, qualifiedModuleName.Name, AcCommand.acCmdExportText,
21+
// Path.Combine(ExportPath, qualifiedModuleName.Name), null, null, null);
22+
//}
23+
24+
//private string ExportPath
25+
//{
26+
// get
27+
// {
28+
// var assemblyLocation = Assembly.GetAssembly(typeof(AccessApp)).Location;
29+
// return Path.GetDirectoryName(assemblyLocation);
30+
// }
31+
//}
32+
1333
private string GenerateMethodCall(QualifiedMemberName qualifiedMemberName)
1434
{
1535
//Access only supports Project.Procedure syntax. Error occurs if there are naming conflicts.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Rubberduck.VBEditor.SafeComWrappers;
2+
3+
namespace Rubberduck.VBEditor.Extensions
4+
{
5+
public static class MSAccessComponentTypeExtensions
6+
{
7+
internal const string AccessFormExtension = ".accfrm";
8+
internal const string AccessReportExtension = ".accrpt";
9+
10+
/// <summary>
11+
/// Returns the proper file extension for the MS Access Component Type.
12+
/// </summary>
13+
/// <param name="componentType"></param>
14+
/// <returns>File extension that includes a preceeding "dot" (.) </returns>
15+
public static string FileExtension(this MSAccessComponentType componentType)
16+
{
17+
switch (componentType)
18+
{
19+
case MSAccessComponentType.Form:
20+
return AccessFormExtension;
21+
case MSAccessComponentType.Report:
22+
return AccessReportExtension;
23+
default:
24+
return string.Empty;
25+
}
26+
}
27+
}
28+
}

Rubberduck.VBEEditor/Rubberduck.VBEditor.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,12 @@
126126
<Compile Include="Events\ISinks.cs" />
127127
<Compile Include="Events\ProjectEventArgs.cs" />
128128
<Compile Include="Events\ProjectRenamedEventArgs.cs" />
129+
<Compile Include="Extensions\MSAccessComponentTypeExtensions.cs" />
129130
<Compile Include="SafeComWrappers\Abstract\ISafeComWrapper.cs" />
130131
<Compile Include="SafeComWrappers\Abstract\IVBComponentsEventsSink.cs" />
131132
<Compile Include="SafeComWrappers\Abstract\IVBProjectsEventsSink.cs" />
132133
<Compile Include="SafeComWrappers\DispatcherEventArgs.cs" />
134+
<Compile Include="SafeComWrappers\MSAccessComponentType.cs" />
133135
<Compile Include="SafeComWrappers\MSForms\ControlType.cs" />
134136
<Compile Include="SafeComWrappers\Abstract\ICodePanes.cs" />
135137
<Compile Include="SafeComWrappers\Office.Core\Abstract\ICommandBarButton.cs" />
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace Rubberduck.VBEditor.SafeComWrappers
2+
{
3+
public enum MSAccessComponentType
4+
{
5+
Form,
6+
Report
7+
}
8+
}

Rubberduck.VBEEditor/SafeComWrappers/VB6/VBComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void Export(string path)
110110
}
111111

112112
/// <summary>
113-
/// Exports the component to the folder. The file is name matches the component name and file extension is based on the component's type.
113+
/// Exports the component to the folder. The file name matches the component name and file extension is based on the component's type.
114114
/// </summary>
115115
/// <param name="folder">Destination folder for the resulting source file.</param>
116116
public string ExportAsSourceFile(string folder)

0 commit comments

Comments
 (0)