Skip to content

Commit 6fef3d4

Browse files
authored
Merge pull request #136 from rubberduck-vba/next
sync with main repo
2 parents bf6380e + bf56525 commit 6fef3d4

File tree

104 files changed

+1024
-463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+1024
-463
lines changed

RetailCoder.VBE/App.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public sealed class App : IDisposable
3737
private bool _handleSinkEvents = true;
3838
private readonly BranchesViewViewModel _branchesVM;
3939
private readonly SourceControlViewViewModel _sourceControlPanelVM;
40+
private readonly UI.Settings.Settings _settings;
4041

4142
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
4243

@@ -52,6 +53,7 @@ public sealed class App : IDisposable
5253
new Dictionary<string, Tuple<IConnectionPoint, int>>();
5354

5455
public App(VBE vbe, IMessageBox messageBox,
56+
UI.Settings.Settings settings,
5557
IRubberduckParser parser,
5658
IGeneralConfigService configService,
5759
IAppMenu appMenus,
@@ -61,6 +63,7 @@ public App(VBE vbe, IMessageBox messageBox,
6163
{
6264
_vbe = vbe;
6365
_messageBox = messageBox;
66+
_settings = settings;
6467
_parser = parser;
6568
_configService = configService;
6669
_autoSave = new AutoSave.AutoSave(_vbe, _configService);
@@ -543,6 +546,11 @@ public void Dispose()
543546
_hooks = null;
544547
}
545548

549+
if (_settings != null)
550+
{
551+
_settings.Dispose();
552+
}
553+
546554
if (_configService != null)
547555
{
548556
_configService.SettingsChanged -= _configService_SettingsChanged;

RetailCoder.VBE/Common/DeclarationExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static class DeclarationExtensions
2222

2323
public static string ToLocalizedString(this DeclarationType type)
2424
{
25-
return RubberduckUI.ResourceManager.GetString("DeclarationType_" + type);
25+
return RubberduckUI.ResourceManager.GetString("DeclarationType_" + type, UI.Settings.Settings.Culture);
2626
}
2727

2828
public static BitmapImage BitmapImage(this Declaration declaration)

RetailCoder.VBE/Inspections/DefaultProjectNameInspectionResult.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class RenameProjectQuickFix : CodeInspectionQuickFix
4141
private readonly RubberduckParserState _state;
4242

4343
public RenameProjectQuickFix(ParserRuleContext context, QualifiedSelection selection, Declaration target, RubberduckParserState state)
44-
: base(context, selection, string.Format(RubberduckUI.Rename_DeclarationType, RubberduckUI.ResourceManager.GetString("DeclarationType_" + DeclarationType.Project, RubberduckUI.Culture)))
44+
: base(context, selection, string.Format(RubberduckUI.Rename_DeclarationType, RubberduckUI.ResourceManager.GetString("DeclarationType_" + DeclarationType.Project, UI.Settings.Settings.Culture)))
4545
{
4646
_target = target;
4747
_state = state;

RetailCoder.VBE/Inspections/InspectionBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ protected InspectionBase(RubberduckParserState state, CodeInspectionSeverity def
5454
/// <summary>
5555
/// Meta-information about why an inspection exists.
5656
/// </summary>
57-
public virtual string Meta { get { return InspectionsUI.ResourceManager.GetString(Name + "Meta"); } }
57+
public virtual string Meta { get { return InspectionsUI.ResourceManager.GetString(Name + "Meta", UI.Settings.Settings.Culture); } }
5858

5959
/// <summary>
6060
/// Gets a localized string representing the type of inspection.
6161
/// <see cref="InspectionType"/>
6262
/// </summary>
63-
public virtual string InspectionTypeName { get { return InspectionsUI.ResourceManager.GetString(InspectionType.ToString()); } }
63+
public virtual string InspectionTypeName { get { return InspectionsUI.ResourceManager.GetString(InspectionType.ToString(), UI.Settings.Settings.Culture); } }
6464

6565
/// <summary>
6666
/// Gets a string representing the text that must be present in an

RetailCoder.VBE/Inspections/Inspector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public async Task<IEnumerable<ICodeInspectionResult>> FindIssuesAsync(Rubberduck
8181
})).ToList();
8282

8383
await Task.WhenAll(inspections);
84-
state.OnStatusMessageUpdate(RubberduckUI.ResourceManager.GetString("ParserState_" + state.Status)); // should be "Ready"
84+
state.OnStatusMessageUpdate(RubberduckUI.ResourceManager.GetString("ParserState_" + state.Status, UI.Settings.Settings.Culture)); // should be "Ready"
8585
return allIssues;
8686
}
8787

RetailCoder.VBE/Inspections/UseMeaningfulNameInspectionResult.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public UseMeaningfulNameInspectionResult(IInspection inspection, Declaration tar
2828

2929
public override string Description
3030
{
31-
get { return string.Format(InspectionsUI.UseMeaningfulNameInspectionResultFormat, RubberduckUI.ResourceManager.GetString("DeclarationType_" + Target.DeclarationType), Target.IdentifierName); }
31+
get { return string.Format(InspectionsUI.UseMeaningfulNameInspectionResultFormat, RubberduckUI.ResourceManager.GetString("DeclarationType_" + Target.DeclarationType, UI.Settings.Settings.Culture), Target.IdentifierName); }
3232
}
3333

3434
public override NavigateCodeEventArgs GetNavigationArgs()
@@ -47,7 +47,7 @@ public class RenameDeclarationQuickFix : CodeInspectionQuickFix
4747
private readonly IMessageBox _messageBox;
4848

4949
public RenameDeclarationQuickFix(ParserRuleContext context, QualifiedSelection selection, Declaration target, RubberduckParserState state, IMessageBox messageBox)
50-
: base(context, selection, string.Format(RubberduckUI.Rename_DeclarationType, RubberduckUI.ResourceManager.GetString("DeclarationType_" + target.DeclarationType, RubberduckUI.Culture)))
50+
: base(context, selection, string.Format(RubberduckUI.Rename_DeclarationType, RubberduckUI.ResourceManager.GetString("DeclarationType_" + target.DeclarationType, UI.Settings.Settings.Culture)))
5151
{
5252
_target = target;
5353
_state = state;

RetailCoder.VBE/Navigation/CodeExplorer/CodeExplorerViewModel.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Linq;
55
using System.Windows.Input;
66
using Microsoft.Vbe.Interop;
7+
using NLog;
78
using Rubberduck.Navigation.Folders;
89
using Rubberduck.Parsing.Annotations;
910
using Rubberduck.Parsing.Symbols;
@@ -30,7 +31,7 @@ public CodeExplorerViewModel(FolderHelper folderHelper, RubberduckParserState st
3031
_state.StateChanged += ParserState_StateChanged;
3132
_state.ModuleStateChanged += ParserState_ModuleStateChanged;
3233

33-
_refreshCommand = new DelegateCommand(param => _state.OnParseRequested(this),
34+
_refreshCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), param => _state.OnParseRequested(this),
3435
param => !IsBusy && _state.IsDirty());
3536

3637
_refreshComponentCommand = commands.OfType<CodeExplorer_RefreshComponentCommand>().FirstOrDefault();
@@ -54,7 +55,7 @@ public CodeExplorerViewModel(FolderHelper folderHelper, RubberduckParserState st
5455
_externalRemoveCommand = commands.OfType<CodeExplorer_RemoveCommand>().FirstOrDefault();
5556
if (_externalRemoveCommand != null)
5657
{
57-
_removeCommand = new DelegateCommand(ExecuteRemoveComand, _externalRemoveCommand.CanExecute);
58+
_removeCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRemoveComand, _externalRemoveCommand.CanExecute);
5859
}
5960

6061
_printCommand = commands.OfType<CodeExplorer_PrintCommand>().FirstOrDefault();
@@ -64,13 +65,13 @@ public CodeExplorerViewModel(FolderHelper folderHelper, RubberduckParserState st
6465

6566
_copyResultsCommand = commands.OfType<CodeExplorer_CopyResultsCommand>().FirstOrDefault();
6667

67-
_setNameSortCommand = new DelegateCommand(param =>
68+
_setNameSortCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), param =>
6869
{
6970
SortByName = (bool)param;
7071
SortBySelection = !(bool)param;
7172
});
7273

73-
_setSelectionSortCommand = new DelegateCommand(param =>
74+
_setSelectionSortCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), param =>
7475
{
7576
SortBySelection = (bool)param;
7677
SortByName = !(bool)param;

RetailCoder.VBE/Root/FatalExceptionInterceptor.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

RetailCoder.VBE/Root/RubberduckModule.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,6 @@ private void BindCommandsToMenuItems()
326326

327327
binding.When(request => whenCommandMenuItemCondition(request) || whenHooksCondition(request))
328328
.InSingletonScope();
329-
330-
binding.Intercept().With<FatalExceptionInterceptor>();
331329
}
332330
}
333331
catch (InvalidOperationException)

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@
256256
<Reference Include="PresentationCore" />
257257
<Reference Include="PresentationFramework" />
258258
<Reference Include="PresentationFramework.Aero" />
259+
<Reference Include="PresentationFramework.Aero2" />
259260
<Reference Include="ReachFramework" />
260261
<Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
261262
<EmbedInteropTypes>False</EmbedInteropTypes>
@@ -391,7 +392,6 @@
391392
<Compile Include="Refactorings\ExtractMethod\IExtractMethodProc.cs" />
392393
<Compile Include="Refactorings\ExtractMethod\IExtractMethodRule.cs" />
393394
<Compile Include="Refactorings\ExtractMethod\IExtractMethodSelectionValidation.cs" />
394-
<Compile Include="Root\FatalExceptionInterceptor.cs" />
395395
<Compile Include="Root\EnumerableCounterInterceptor.cs" />
396396
<Compile Include="Root\InterceptedException.cs" />
397397
<Compile Include="Root\InterceptorBase.cs" />
@@ -729,6 +729,7 @@
729729
<Compile Include="UI\Settings\InspectionSettingsViewModel.cs" />
730730
<Compile Include="UI\Settings\ISettingsView.cs" />
731731
<Compile Include="UI\Settings\ISettingsViewModel.cs" />
732+
<Compile Include="UI\Settings\Settings.cs" />
732733
<Compile Include="UI\Settings\SettingsControl.xaml.cs">
733734
<DependentUpon>SettingsControl.xaml</DependentUpon>
734735
</Compile>

0 commit comments

Comments
 (0)