Skip to content

Commit f606675

Browse files
committed
Final run through of documentation updates.
1 parent ddea7b2 commit f606675

14 files changed

+229
-219
lines changed

Rubberduck.CodeAnalysis/Rubberduck.CodeAnalysis.xml

Lines changed: 180 additions & 179 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Rubberduck.VBEEditor/ComManagement/TypeLibs/Public/TypeLibWrapperProvider.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Rubberduck.VBEditor.ComManagement.TypeLibs.Abstract;
1+
using System.Runtime.InteropServices.ComTypes;
2+
using Rubberduck.VBEditor.ComManagement.TypeLibs.Abstract;
23
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
34

45
// ReSharper disable once CheckNamespace
@@ -8,6 +9,14 @@ public class TypeLibWrapperProvider : ITypeLibWrapperProvider
89
{
910
private readonly IProjectsProvider _projectsProvider;
1011

12+
/// <summary>
13+
/// Simplifies the work of obtaining a <see cref="ITypeLib"/> for a given
14+
/// <see cref="IVBProject"/> and wraps in a <see cref="ITypeLibWrapper"/>
15+
/// in order to expose some VBE-specific extensions upon the type APIs.
16+
/// </summary>
17+
/// <param name="projectsProvider">
18+
/// Injected provider maintaining a collection of <see cref="IVBProject"/>s
19+
/// </param>
1120
public TypeLibWrapperProvider(IProjectsProvider projectsProvider)
1221
{
1322
_projectsProvider = projectsProvider;

Rubberduck.VBEEditor/ComManagement/TypeLibs/TypeInfoFunction.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
namespace Rubberduck.VBEditor.ComManagement.TypeLibs
77
{
88
/// <summary>
9-
/// A class that represents a function definition within a <see cref="ComTypes.ITypeInfo"/>. Essentially a wrapper for <see cref="ComTypes.FUNCDESC"/>.
9+
/// A class that represents a function definition described in <see cref="ComTypes.FUNCDESC"/>
10+
/// within a <see cref="ComTypes.ITypeInfo"/>.
1011
/// </summary>
1112
internal class TypeInfoFunction : ITypeInfoFunction
1213
{

Rubberduck.VBEEditor/ComManagement/TypeLibs/TypeInfoVariable.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
namespace Rubberduck.VBEditor.ComManagement.TypeLibs
77
{
88
/// <summary>
9-
/// A class that represents a variable or field within a <see cref="ComTypes.ITypeInfo"/>
9+
/// A class that represents a variable or field described in a <see cref="ComTypes.VARDESC"/>
10+
/// within a <see cref="ComTypes.ITypeInfo"/>
1011
/// </summary>
1112
internal class TypeInfoVariable : ITypeInfoVariable
1213
{

Rubberduck.VBEEditor/ComManagement/TypeLibs/TypeInfoWrapper.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ public enum TYPEKIND_VBE
4242
/// so there will be little bugs. This bug is also resolved in the provided wrappers.
4343
///
4444
/// This class can also be cast to <see cref="ComTypes.ITypeInfo"/> for safe access to the underlying type information
45+
///
46+
/// TypeInfos from a VBA hosted project, and obtained through <see cref="VBETypeLibsAccessor"/> will have the following behaviours:
47+
///
48+
/// will expose both public and private procedures and fields
49+
/// will expose constants values, but they are unnamed (their member IDs will be MEMBERID_NIL)
50+
/// module level variables in a standard module are hidden (ref to <see cref="TypeInfoConstantsCollection"/> for details)
51+
/// enumerations are not exposed directly in the type library
52+
/// enumerations may be referenced by field/argument datatypes, and the ITypeInfos for them are then accessible that way
53+
/// UDTs are not exposed directly in the type library
54+
/// UDTs may be referenced by field/argument datatypes, and as such the ITypeInfos for them are then accessible that way
55+
///
56+
/// TypeInfos obtained by other means (such as the IDispatch::GetTypeInfo method) usually expose more restricted
57+
/// versions of ITypeInfo which may not expose private members
4558
/// </remarks>
4659
internal sealed class TypeInfoWrapper : TypeInfoInternalSelfMarshalForwarderBase, ITypeInfoWrapper
4760
{

Rubberduck.VBEEditor/ComManagement/TypeLibs/TypeInfoWrapperCollection.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,6 @@
55
using Rubberduck.VBEditor.ComManagement.TypeLibs.Unmanaged;
66
using Rubberduck.VBEditor.ComManagement.TypeLibs.Utility;
77

8-
/// <summary>
9-
/// For usage examples, please see VBETypeLibsAPI
10-
/// </summary>
11-
/// <remarks>
12-
/// TypeInfos from a VBA hosted project, and obtained through VBETypeLibsAccessor will have the following behaviours:
13-
///
14-
/// will expose both public and private prcoedures and fields
15-
/// will expose constants values, but they are unnamed (their member IDs will be MEMBERID_NIL)
16-
/// enumerations are not exposed directly in the type library
17-
/// enumerations may be referenced by field/argument datatypes, and the ITypeInfos for them are then accessible that way
18-
/// UDTs are not exposed directly in the type library
19-
/// UDTs may be referenced by field/argument datatypes, and as such the ITypeInfos for them are then accessible that way
20-
///
21-
/// TypeInfos obtained by other means (such as the IDispatch::GetTypeInfo method) usually expose more restricted
22-
/// versions of ITypeInfo which may not expose private members
23-
/// </remarks>
24-
258
namespace Rubberduck.VBEditor.ComManagement.TypeLibs
269
{
2710
/// <summary>

Rubberduck.VBEEditor/ComManagement/TypeLibs/Unmanaged/AddressableVariables.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Rubberduck.VBEditor.ComManagement.TypeLibs.Unmanaged
44
{
55
/// <summary>
6-
/// AddressableVariables aid creating and handling unmanaged data
6+
/// AddressableVariables aids in creating and handling unmanaged data
77
/// </summary>
88
/// <remarks>
99
/// AddressableVariables are created in unmanaged memory space, designed to aid creating addressable

Rubberduck.VBEEditor/ComManagement/TypeLibs/Unmanaged/ComHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ internal static class ComHelper
128128
public static bool DoesComObjPtrSupportInterface<T>(IntPtr comObjPtr)
129129
{
130130
var iid = typeof(T).GUID;
131-
int hr = RdMarshal.QueryInterface(comObjPtr, ref iid, out var outInterfacePtr);
131+
var hr = RdMarshal.QueryInterface(comObjPtr, ref iid, out var outInterfacePtr);
132132
if (!ComHelper.HRESULT_FAILED(hr))
133133
{
134134
RdMarshal.Release(outInterfacePtr);

Rubberduck.VBEEditor/ComManagement/TypeLibs/Unmanaged/IDispatchHelper.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
namespace Rubberduck.VBEditor.ComManagement.TypeLibs.Unmanaged
77
{
88
/// <summary>
9-
/// Used by methods in the ITypeInfo and ITypeLib interfaces. Usually used to get the root type or library name.
9+
/// Used by methods in the <see cref="ComTypes.ITypeInfo"/> and <see cref="ComTypes.ITypeLib"/> interfaces.
10+
/// Usually used to get the root type or library name.
1011
/// </summary>
1112
internal enum KnownDispatchMemberIDs
1213
{
@@ -52,7 +53,7 @@ public enum InvokeKind : int
5253
/// see https://msdn.microsoft.com/en-us/library/windows/desktop/ms221416(v=vs.85).aspx
5354
/// </summary>
5455
/// <param name="args">An array of arguments to wrap</param>
55-
/// <returns>DISPPARAMS structure ready to pass to IDispatch::Invoke</returns>
56+
/// <returns><see cref="ComTypes.DISPPARAMS"/> structure ready to pass to IDispatch::Invoke</returns>
5657
private static ComTypes.DISPPARAMS PrepareDispatchArgs(object[] args)
5758
{
5859
var pDispParams = new ComTypes.DISPPARAMS();
@@ -66,7 +67,7 @@ private static ComTypes.DISPPARAMS PrepareDispatchArgs(object[] args)
6667
var variantArgsArray = RdMarshal.AllocHGlobal(argsVariantLength);
6768

6869
// In IDispatch::Invoke, arguments are passed in reverse order
69-
IntPtr variantArgsArrayOffset = variantArgsArray + argsVariantLength;
70+
var variantArgsArrayOffset = variantArgsArray + argsVariantLength;
7071
foreach (var arg in args)
7172
{
7273
variantArgsArrayOffset -= variantStructSize;
@@ -78,7 +79,7 @@ private static ComTypes.DISPPARAMS PrepareDispatchArgs(object[] args)
7879
}
7980

8081
[DllImport("oleaut32.dll", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
81-
static extern Int32 VariantClear(IntPtr pvarg);
82+
static extern int VariantClear(IntPtr pvarg);
8283

8384
/// <summary>
8485
/// frees all unmanaged memory assoicated with a DISPPARAMS structure
@@ -92,7 +93,7 @@ private static void UnprepareDispatchArgs(ComTypes.DISPPARAMS pDispParams)
9293
// free the array of COM VARIANTs
9394
var variantStructSize = RdMarshal.SizeOf(typeof(VARIANT));
9495
var variantArgsArrayOffset = pDispParams.rgvarg;
95-
int argIndex = 0;
96+
var argIndex = 0;
9697
while (argIndex < pDispParams.cArgs)
9798
{
9899
VariantClear(variantArgsArrayOffset);
@@ -117,8 +118,8 @@ public static object Invoke(IDispatch obj, int memberId, InvokeKind invokeKind,
117118
var pDispParams = PrepareDispatchArgs(args);
118119
var pExcepInfo = new ComTypes.EXCEPINFO();
119120

120-
int hr = obj.Invoke(memberId, ref _guid_null, 0, (uint)invokeKind,
121-
ref pDispParams, out object pVarResult, ref pExcepInfo, out uint pErrArg);
121+
var hr = obj.Invoke(memberId, ref _guid_null, 0, (uint)invokeKind,
122+
ref pDispParams, out var pVarResult, ref pExcepInfo, out var pErrArg);
122123

123124
UnprepareDispatchArgs(pDispParams);
124125

Rubberduck.VBEEditor/ComManagement/TypeLibs/Unmanaged/TypeInfoInternalSelfMarshalForwarderBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Rubberduck.VBEditor.ComManagement.TypeLibs.Unmanaged
66
{
77
/// <summary>
8-
/// This class marshals ComTypes.ITypeInfo members to ITypeInfoInternal
8+
/// This class marshals <see cref="ComTypes.ITypeInfo"/> members to <see cref="ITypeInfoInternal"/>
99
/// </summary>
1010
/// <remarks>
1111
/// ITypeInfoInternal must be inherited BEFORE ComTypes.ITypeInfo as they both have the same IID

0 commit comments

Comments
 (0)