Skip to content

Commit

Permalink
Revert "Fixed ThrowIfNotOnUIThread exception (see #163)"
Browse files Browse the repository at this point in the history
This reverts commit 2ac8e16.
  • Loading branch information
Irame committed Apr 3, 2024
1 parent a618b2a commit c721d84
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion SmartCmdArgs/SmartCmdArgs.Shared/CmdArgsPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private ServiceProvider ConfigureServices()
var services = new ServiceCollection();

services.AddSingleton<Commands>();
services.AddSingleton(x => GetDialogPage<CmdArgsOptionPage>());
services.AddLazySingleton(x => GetDialogPage<CmdArgsOptionPage>());
services.AddLazySingleton<SettingsViewModel>();
services.AddLazySingleton<ToolWindowViewModel>();
services.AddLazySingleton<TreeViewModel>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ internal class OptionsSettingsService : PropertyChangedBase, IOptionsSettingsSer
{
private readonly IVisualStudioHelperService _vsHelperService;
private readonly SettingsViewModel settingsViewModel;
private readonly CmdArgsOptionPage optionPage;
private readonly Lazy<CmdArgsOptionPage> lazyOptionsPage;

public OptionsSettingsService(
IVisualStudioHelperService vsHelperService,
SettingsViewModel settingsViewModel,
CmdArgsOptionPage optionPage)
Lazy<CmdArgsOptionPage> lazyOptionsPage)
{
_vsHelperService = vsHelperService;
this.settingsViewModel = settingsViewModel;
this.optionPage = optionPage;
this.lazyOptionsPage = lazyOptionsPage;
}

private CmdArgsOptionPage OptionsPage => optionPage;
private CmdArgsOptionPage OptionsPage => lazyOptionsPage.Value;

// Settings (possibly with options default)
public bool SaveSettingsToJson => settingsViewModel.SaveSettingsToJson;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace SmartCmdArgs.ViewModel
{
public class SettingsViewModel : PropertyChangedBase
{
private readonly CmdArgsOptionPage optionPage;
private readonly Lazy<CmdArgsOptionPage> optionPage;
private readonly Lazy<ILifeCycleService> lifeCycleService;
private bool _saveSettingsToJson;
private bool? _manageCommandLineArgs;
Expand Down Expand Up @@ -83,13 +83,13 @@ public bool? MacroEvaluationEnabled

public RelayCommand DisableExtensionCommand { get; }

public CmdArgsOptionPage Options => optionPage;
public CmdArgsOptionPage Options => optionPage.Value;
public ILifeCycleService LifeCycle => lifeCycleService.Value;

public RelayCommand OpenOptionsCommand { get; }

public SettingsViewModel(
CmdArgsOptionPage optionPage,
Lazy<CmdArgsOptionPage> optionPage,
Lazy<ILifeCycleService> lifeCycleService)
{
this.optionPage = optionPage;
Expand Down

0 comments on commit c721d84

Please sign in to comment.