Skip to content

Commit d0352f3

Browse files
committed
Revert the changes made - we don't need the assembly at all....
1 parent 6ef9abb commit d0352f3

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

Rubberduck.API/API/VBA/ParserState.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.ComponentModel;
44
using System.Globalization;
55
using System.Linq;
6-
using System.Reflection;
76
using System.Runtime.InteropServices;
87
using Rubberduck.Common;
98
using Rubberduck.Parsing.PreProcessing;
@@ -58,7 +57,7 @@ public sealed class ParserState : IParserState, IDisposable
5857

5958
public ParserState()
6059
{
61-
UiContextProvider.Initialize(Assembly.GetExecutingAssembly());
60+
UiContextProvider.Initialize();
6261
_dispatcher = new UiDispatcher(UiContextProvider.Instance());
6362
}
6463

Rubberduck.Core/App.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
using Rubberduck.Parsing.Inspections.Resources;
1414
using Rubberduck.Parsing.UIContext;
1515
using Rubberduck.UI.Command;
16+
using Rubberduck.VBEditor.ComManagement;
1617
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
18+
using Rubberduck.VBEditor.Utility;
1719
using Rubberduck.VersionCheck;
1820
using Application = System.Windows.Forms.Application;
1921

@@ -48,6 +50,8 @@ public App(IVBE vbe,
4850
_checkVersionCommand = checkVersionCommand;
4951

5052
_configService.SettingsChanged += _configService_SettingsChanged;
53+
54+
UiContextProvider.Initialize();
5155
}
5256

5357
private void _configService_SettingsChanged(object sender, ConfigurationChangedEventArgs e)

Rubberduck.Main/Extension.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
using Rubberduck.VBEditor.ComManagement;
2020
using Rubberduck.VBEditor.Events;
2121
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
22-
using Rubberduck.VBEditor.Utility;
2322
using Windows = Rubberduck.VBEditor.SafeComWrappers.VBA.Windows;
2423

2524
namespace Rubberduck
@@ -220,9 +219,7 @@ private void Startup()
220219
currentDomain.AssemblyResolve += LoadFromSameFolder;
221220

222221
_container = new WindsorContainer().Install(new RubberduckIoCInstaller(_ide, _addin, _initialSettings));
223-
224-
UiContextProvider.Initialize(Assembly.GetExecutingAssembly());
225-
222+
226223
_app = _container.Resolve<App>();
227224
_app.Startup();
228225

Rubberduck.VBEEditor/Utility/UiContext.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Reflection;
32
using System.Threading;
43
using System.Threading.Tasks;
54

@@ -10,7 +9,6 @@ public interface IUiContextProvider
109
bool IsExecutingInUiContext();
1110
SynchronizationContext UiContext { get; }
1211
TaskScheduler UiTaskScheduler { get; }
13-
Assembly GetEntryAssembly { get; }
1412
}
1513

1614
public class UiContextProvider : IUiContextProvider
@@ -19,11 +17,10 @@ public class UiContextProvider : IUiContextProvider
1917
private static TaskScheduler TaskScheduler { get; set; }
2018
private static readonly UiContextProvider UiContextInstance = new UiContextProvider();
2119
private static readonly object Lock = new object();
22-
private static Assembly _entryAssembly;
2320

2421
private UiContextProvider() { }
2522

26-
public static void Initialize(Assembly entryAssembly)
23+
public static void Initialize()
2724
{
2825
lock (Lock)
2926
{
@@ -34,15 +31,13 @@ public static void Initialize(Assembly entryAssembly)
3431

3532
Context = SynchronizationContext.Current;
3633
TaskScheduler = TaskScheduler.FromCurrentSynchronizationContext();
37-
_entryAssembly = entryAssembly;
3834
}
3935
}
4036

4137
public static UiContextProvider Instance() => UiContextInstance;
4238

4339
public SynchronizationContext UiContext => Context;
4440
public TaskScheduler UiTaskScheduler => TaskScheduler;
45-
public Assembly GetEntryAssembly => _entryAssembly;
4641

4742
public bool IsExecutingInUiContext()
4843
{

0 commit comments

Comments
 (0)