Skip to content

Commit aa8770e

Browse files
committed
Rebuild project files post merge.
1 parent 357c70c commit aa8770e

12 files changed

+248
-6
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
using System;
2+
using System.Windows.Forms;
3+
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
4+
5+
namespace Rubberduck.VBEditor.Events
6+
{
7+
public class AutoCompleteEventArgs : EventArgs
8+
{
9+
public AutoCompleteEventArgs(ICodeModule module, KeyPressEventArgs e)
10+
{
11+
if (e.Key == Keys.Delete ||
12+
e.Key == Keys.Back ||
13+
e.Key == Keys.Enter ||
14+
e.Key == Keys.Tab)
15+
{
16+
Keys = e.Key;
17+
}
18+
else
19+
{
20+
Character = e.Character;
21+
}
22+
CodeModule = module;
23+
CurrentSelection = module.GetQualifiedSelection().Value.Selection;
24+
CurrentLine = module.GetLines(CurrentSelection);
25+
}
26+
27+
/// <summary>
28+
/// <c>true</c> if the character has been handled, i.e. written to the code pane.
29+
/// Set to <c>true</c> to swallow the character and prevent the WM message from reaching the code pane.
30+
/// </summary>
31+
public bool Handled { get; set; }
32+
33+
/// <summary>
34+
/// The CodeModule wrapper for the module being edited.
35+
/// </summary>
36+
public ICodeModule CodeModule { get; }
37+
38+
/// <summary>
39+
/// <c>true</c> if the event is originating from a <c>WM_CHAR</c> message.
40+
/// <c>false</c> if the event is originating from a <c>WM_KEYDOWN</c> message.
41+
/// </summary>
42+
/// <remarks>
43+
/// Inline completion is handled on WM_CHAR; deletions and block completion on WM_KEYDOWN.
44+
/// </remarks>
45+
public bool IsCharacter => Keys == default;
46+
/// <summary>
47+
/// The character whose key was pressed. Undefined value if <see cref="Keys"/> isn't `<see cref="Keys.None"/>.
48+
/// </summary>
49+
public char Character { get; }
50+
/// <summary>
51+
/// The actionnable key that was pressed. Value is <see cref="Keys.None"/> when <see cref="IsCharacter"/> is <c>true</c>.
52+
/// </summary>
53+
public Keys Keys { get; }
54+
55+
/// <summary>
56+
/// The current location of the caret.
57+
/// </summary>
58+
public Selection CurrentSelection { get; }
59+
/// <summary>
60+
/// The contents of the current line of code.
61+
/// </summary>
62+
public string CurrentLine { get; }
63+
}
64+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
3+
4+
namespace Rubberduck.VBEditor.Events
5+
{
6+
public class ComponentEventArgs : EventArgs
7+
{
8+
public ComponentEventArgs(string projectId, IVBProject project, IVBComponent component)
9+
{
10+
ProjectId = projectId;
11+
Project = project;
12+
Component = component;
13+
}
14+
15+
public string ProjectId { get; }
16+
17+
public IVBProject Project { get; }
18+
19+
public IVBComponent Component { get; }
20+
}
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
2+
3+
namespace Rubberduck.VBEditor.Events
4+
{
5+
public class ComponentRenamedEventArgs : ComponentEventArgs
6+
{
7+
public ComponentRenamedEventArgs(string projectId, IVBProject project, IVBComponent component, string oldName)
8+
: base(projectId, project, component)
9+
{
10+
OldName = oldName;
11+
}
12+
13+
public string OldName { get; }
14+
}
15+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
3+
namespace Rubberduck.VBEditor.Events
4+
{
5+
public class IntelliSenseEventArgs : EventArgs
6+
{
7+
public static IntelliSenseEventArgs Shown => new IntelliSenseEventArgs(true);
8+
public static IntelliSenseEventArgs Hidden => new IntelliSenseEventArgs(false);
9+
internal IntelliSenseEventArgs(bool visible)
10+
{
11+
Visible = visible;
12+
}
13+
14+
public bool Visible { get; }
15+
}
16+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System;
2+
using System.Windows.Forms;
3+
4+
namespace Rubberduck.VBEditor.Events
5+
{
6+
public class KeyPressEventArgs
7+
{
8+
// Note: This offers additional functionality over WindowsApi.KeyPressEventArgs by passing the WndProc arguments.
9+
public KeyPressEventArgs(IntPtr hwnd, IntPtr wParam, IntPtr lParam, char character = default)
10+
{
11+
Hwnd = hwnd;
12+
WParam = wParam;
13+
LParam = lParam;
14+
Character = character;
15+
if (character == default(char))
16+
{
17+
Key = (Keys)wParam;
18+
}
19+
else
20+
{
21+
IsCharacter = true;
22+
}
23+
}
24+
25+
public bool IsCharacter { get; }
26+
public IntPtr Hwnd { get; }
27+
public IntPtr WParam { get; }
28+
public IntPtr LParam { get; }
29+
30+
public bool Handled { get; set; }
31+
32+
public char Character { get; }
33+
public Keys Key { get; }
34+
}
35+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
3+
4+
namespace Rubberduck.VBEditor.Events
5+
{
6+
public class ProjectEventArgs : EventArgs
7+
{
8+
public ProjectEventArgs(string projectId, IVBProject project)
9+
{
10+
ProjectId = projectId;
11+
Project = project;
12+
}
13+
14+
public string ProjectId { get; }
15+
16+
public IVBProject Project { get; }
17+
}
18+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
2+
3+
namespace Rubberduck.VBEditor.Events
4+
{
5+
public class ProjectRenamedEventArgs : ProjectEventArgs
6+
{
7+
public ProjectRenamedEventArgs(string projectId, IVBProject project, string oldName) : base(projectId, project)
8+
{
9+
OldName = oldName;
10+
}
11+
12+
public string OldName { get; }
13+
}
14+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
3+
4+
namespace Rubberduck.VBEditor.Events
5+
{
6+
public class SelectionChangedEventArgs : EventArgs
7+
{
8+
public SelectionChangedEventArgs()
9+
{
10+
//stub.
11+
}
12+
}
13+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
3+
namespace Rubberduck.VBEditor.Events
4+
{
5+
public enum FocusType
6+
{
7+
GotFocus,
8+
LostFocus,
9+
ChildFocus
10+
}
11+
12+
public class WindowChangedEventArgs : EventArgs
13+
{
14+
public IntPtr Hwnd { get; }
15+
public FocusType EventType { get; }
16+
17+
public WindowChangedEventArgs(IntPtr hwnd, FocusType type)
18+
{
19+
Hwnd = hwnd;
20+
EventType = type;
21+
}
22+
}
23+
}

Rubberduck.VBEEditor/Rubberduck.VBEditor.csproj

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@
6565
<Compile Include="ComManagement\IComSafe.cs" />
6666
<Compile Include="ComManagement\TypeLibs\TypeLibWrapperProvider.cs" />
6767
<Compile Include="Events\AutoCompleteEventArgs.cs" />
68+
<Compile Include="Events\ComponentEventArgs.cs" />
69+
<Compile Include="Events\ComponentRenamedEventArgs.cs" />
70+
<Compile Include="Events\IntelliSenseEventArgs.cs" />
71+
<Compile Include="Events\KeyPressEventArgs.cs" />
72+
<Compile Include="Events\ProjectEventArgs.cs" />
73+
<Compile Include="Events\ProjectRenamedEventArgs.cs" />
74+
<Compile Include="Events\SelectionChangedEventArgs.cs" />
75+
<Compile Include="Events\WindowChangedEventArgs.cs" />
6876
<Compile Include="Extensions\DictionaryExtensions.cs" />
6977
<Compile Include="Factories\AddInFactory.cs" />
7078
<Compile Include="Factories\ISafeComWrapperProvider.cs" />
@@ -103,14 +111,8 @@
103111
<Compile Include="ComManagement\TypeLibs\TypeLibsAPI.cs" />
104112
<Compile Include="ComManagement\ReferenceEqualityComparer.cs" />
105113
<Compile Include="ComManagement\StrongComSafe.cs" />
106-
<Compile Include="Events\ComponentEventArgs.cs" />
107-
<Compile Include="Events\ComponentRenamedEventArgs.cs" />
108-
<Compile Include="Events\ProjectEventArgs.cs" />
109-
<Compile Include="Events\ProjectRenamedEventArgs.cs" />
110-
<Compile Include="Events\SelectionChangedEventArgs.cs" />
111114
<Compile Include="Events\VBEEvents.cs" />
112115
<Compile Include="Events\VBENativeServices.cs" />
113-
<Compile Include="Events\WindowChangedEventArgs.cs" />
114116
<Compile Include="Extensions\VBComponentExtensions.cs" />
115117
<Compile Include="Extensions\KeyValuePairExtensions.cs" />
116118
<Compile Include="Extensions\MSAccessComponentTypeExtensions.cs" />
@@ -169,6 +171,9 @@
169171
<Compile Include="SafeComWrappers\SafeEventedComWrapper.cs" />
170172
<Compile Include="Utility\DisposalActionContainer.cs" />
171173
<Compile Include="Utility\RegistryWrapper.cs" />
174+
<Compile Include="WindowsApi\IFocusProvider.cs" />
175+
<Compile Include="WindowsApi\SubclassManager.cs" />
176+
<Compile Include="WindowsApi\VbeAttachableSubclass.cs" />
172177
<Compile Include="WindowsApi\WindowLocator.cs" />
173178
<Compile Include="WindowsApi\CodePaneSubclass.cs" />
174179
<Compile Include="WindowsApi\DesignerWindowSubclass.cs" />
@@ -191,6 +196,7 @@
191196
<Compile Include="WindowsApi\SubclassingWindow.cs" />
192197
<Compile Include="WindowsApi\User32.cs" />
193198
<Compile Include="WindowsApi\WindowsHook.cs" />
199+
<Compile Include="WindowsApi\WindowType.cs" />
194200
<Compile Include="WindowsApi\WinEvent.cs" />
195201
<Compile Include="WindowsApi\WinEventFlags.cs" />
196202
<Compile Include="WindowsApi\WM.cs" />

0 commit comments

Comments
 (0)