Skip to content

Commit 9b5b755

Browse files
authored
Merge branch 'next' into contrib-guidelines
2 parents 664f361 + e240d2f commit 9b5b755

File tree

100 files changed

+1253
-155
lines changed

Some content is hidden

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

100 files changed

+1253
-155
lines changed

RetailCoder.VBE/AppMenu.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,15 @@ public void Dispose()
7070
_parser.State.StateChanged -= OnParserStateChanged;
7171
_selectionService.SelectedDeclarationChanged -= OnSelectedDeclarationChange;
7272

73-
// note: doing this wrecks the teardown process. counter-intuitive? sure. but hey it works.
74-
//foreach (var menu in _menus.Where(menu => menu.Item != null))
75-
//{
76-
// menu.RemoveChildren();
77-
// menu.Item.Delete();
78-
//}
73+
RemoveMenus();
74+
}
75+
76+
private void RemoveMenus()
77+
{
78+
foreach (var menu in _menus.Where(menu => menu.Item != null))
79+
{
80+
menu.RemoveMenu();
81+
}
7982
}
8083
}
8184
}

RetailCoder.VBE/Extension.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,16 @@ private void ShutdownAddIn()
243243
_kernel = null;
244244
}
245245

246+
Debug.WriteLine("Extension: Initiating garbage collection.");
247+
248+
GC.Collect();
249+
250+
Debug.WriteLine("Extension: Initiated garbage collection.");
251+
252+
GC.WaitForPendingFinalizers();
253+
254+
Debug.WriteLine("Extension: Finalizers have run.");
255+
246256
_isInitialized = false;
247257
}
248258

RetailCoder.VBE/Navigation/CodeExplorer/CodeExplorerViewModel.cs

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using Rubberduck.VBEditor;
1717
using Rubberduck.VBEditor.SafeComWrappers;
1818
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
19+
using System.Windows;
1920

2021
// ReSharper disable CanBeReplacedWithTryCastAndCheckForNull
2122

@@ -60,6 +61,8 @@ public CodeExplorerViewModel(FolderHelper folderHelper, RubberduckParserState st
6061

6162
ImportCommand = commands.OfType<ImportCommand>().SingleOrDefault();
6263
ExportCommand = commands.OfType<ExportCommand>().SingleOrDefault();
64+
ExportAllCommand = commands.OfType<Rubberduck.UI.Command.ExportAllCommand>().SingleOrDefault();
65+
6366
_externalRemoveCommand = commands.OfType<RemoveCommand>().SingleOrDefault();
6467
if (_externalRemoveCommand != null)
6568
{
@@ -99,8 +102,11 @@ public CodeExplorerItemViewModel SelectedItem
99102
OnPropertyChanged("CanExecuteIndenterCommand");
100103
OnPropertyChanged("CanExecuteRenameCommand");
101104
OnPropertyChanged("CanExecuteFindAllReferencesCommand");
105+
OnPropertyChanged("ExportVisibility");
106+
OnPropertyChanged("ExportAllVisibility");
102107
OnPropertyChanged("PanelTitle");
103108
OnPropertyChanged("Description");
109+
104110
// ReSharper restore ExplicitCallerInfoArgument
105111
}
106112
}
@@ -463,13 +469,15 @@ private void SwitchNodeState(CodeExplorerItemViewModel node, bool expandedState)
463469

464470
public CommandBase ImportCommand { get; }
465471
public CommandBase ExportCommand { get; }
472+
public CommandBase ExportAllCommand { get; }
473+
466474
public CommandBase RemoveCommand { get; }
467475

468476
public CommandBase PrintCommand { get; }
469477

470478
public CommandBase CommitCommand { get; }
471479
public CommandBase UndoCommand { get; }
472-
480+
473481
private readonly CommandBase _externalRemoveCommand;
474482

475483
// this is a special case--we have to reset SelectedItem to prevent a crash
@@ -482,6 +490,28 @@ private void ExecuteRemoveComand(object param)
482490
_externalRemoveCommand.Execute(param);
483491
}
484492

493+
private bool CanExecuteExportAllCommand => ExportAllCommand.CanExecute(SelectedItem);
494+
495+
public Visibility ExportVisibility
496+
{
497+
get
498+
{
499+
if (CanExecuteExportAllCommand == false)
500+
{ return Visibility.Visible; }
501+
else { return Visibility.Collapsed; }
502+
}
503+
}
504+
505+
public Visibility ExportAllVisibility
506+
{
507+
get
508+
{
509+
if (CanExecuteExportAllCommand == true)
510+
{ return Visibility.Visible; }
511+
else { return Visibility.Collapsed; }
512+
}
513+
}
514+
485515
public void Dispose()
486516
{
487517
if (_state != null)

RetailCoder.VBE/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("2.1.0.*")]
35-
[assembly: AssemblyFileVersion("2.1.0.0")]
34+
[assembly: AssemblyVersion("2.1.*")]
35+
//[assembly: AssemblyFileVersion("2.1.0.0")]

RetailCoder.VBE/Root/RubberduckModule.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,8 @@ private IMenuItem GetToolsParentMenu()
596596
var items = new List<IMenuItem> ()
597597
{
598598
KernelInstance.Get<RegexAssistantCommandMenuItem>(),
599-
KernelInstance.Get<ToDoExplorerCommandMenuItem>()
599+
KernelInstance.Get<ToDoExplorerCommandMenuItem>(),
600+
KernelInstance.Get<ExportAllCommandMenuItem>()
600601
};
601602

602603

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@
250250
<SpecificVersion>False</SpecificVersion>
251251
<HintPath>..\packages\LibGit2Sharp.0.22.0-pre20150516171636\lib\net40\LibGit2Sharp.dll</HintPath>
252252
</Reference>
253+
<Reference Include="Microsoft.Expression.Interactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
254+
<HintPath>..\packages\System.Windows.Interactivity.WPF.2.0.20525\lib\net40\Microsoft.Expression.Interactions.dll</HintPath>
255+
</Reference>
253256
<Reference Include="Microsoft.VB6.Interop.VBIDE">
254257
<HintPath>..\libs\Microsoft.VB6.Interop.VBIDE.dll</HintPath>
255258
<EmbedInteropTypes>False</EmbedInteropTypes>
@@ -294,7 +297,9 @@
294297
<Reference Include="System.Runtime.Remoting" />
295298
<Reference Include="System.Runtime.Serialization" />
296299
<Reference Include="System.Windows.Forms" />
297-
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
300+
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
301+
<HintPath>..\packages\System.Windows.Interactivity.WPF.2.0.20525\lib\net40\System.Windows.Interactivity.dll</HintPath>
302+
</Reference>
298303
<Reference Include="System.Xaml" />
299304
<Reference Include="Microsoft.CSharp" />
300305
<Reference Include="System.Xml" />
@@ -391,6 +396,7 @@
391396
<Compile Include="UI\CodeExplorer\Commands\CommitCommand.cs" />
392397
<Compile Include="UI\CodeExplorer\Commands\AddUserFormCommand.cs" />
393398
<Compile Include="UI\CodeExplorer\Commands\CopyResultsCommand.cs" />
399+
<Compile Include="UI\Command\ExportAllCommand.cs" />
394400
<Compile Include="UI\CodeExplorer\Commands\OpenProjectPropertiesCommand.cs" />
395401
<Compile Include="UI\CodeExplorer\Commands\RenameCommand.cs" />
396402
<Compile Include="UI\CodeExplorer\Commands\FindAllReferencesCommand.cs" />
@@ -409,6 +415,7 @@
409415
<Compile Include="UI\Command\IndentCurrentProjectCommand.cs" />
410416
<Compile Include="UI\Command\MenuItems\CommandBars\ContextDescriptionLabelMenuItem.cs" />
411417
<Compile Include="UI\Command\MenuItems\IndentCurrentProjectCommandMenuItem.cs" />
418+
<Compile Include="UI\Command\MenuItems\ExportAllCommandMenuItem.cs" />
412419
<Compile Include="UI\EnvironmentProvider.cs" />
413420
<Compile Include="UI\Inspections\AggregateInspectionResult.cs" />
414421
<Compile Include="UI\ModernFolderBrowser.cs" />

RetailCoder.VBE/Settings/HotkeySettings.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public interface IHotkeySettings
1212

1313
public class HotkeySettings : IHotkeySettings, IEquatable<HotkeySettings>
1414
{
15-
private static readonly HotkeySetting[] Defaults =
15+
private static readonly HotkeySetting[] Defaults =
1616
{
1717
new HotkeySetting{Name=RubberduckHotkey.ParseAll.ToString(), IsEnabled=true, HasCtrlModifier = true, Key1="`" },
1818
new HotkeySetting{Name=RubberduckHotkey.IndentProcedure.ToString(), IsEnabled=true, HasCtrlModifier = true, Key1="P" },
@@ -25,7 +25,8 @@ public class HotkeySettings : IHotkeySettings, IEquatable<HotkeySettings>
2525
new HotkeySetting{Name=RubberduckHotkey.RefactorRename.ToString(), IsEnabled=true, HasCtrlModifier = true, HasShiftModifier = true, Key1="R" },
2626
new HotkeySetting{Name=RubberduckHotkey.RefactorExtractMethod.ToString(), IsEnabled=true, HasCtrlModifier = true, HasShiftModifier = true, Key1="M" },
2727
new HotkeySetting{Name=RubberduckHotkey.SourceControl.ToString(), IsEnabled=true, HasCtrlModifier = true, HasShiftModifier = true, Key1="D6" },
28-
new HotkeySetting{Name=RubberduckHotkey.RefactorEncapsulateField.ToString(), IsEnabled=true, HasCtrlModifier = true, HasShiftModifier = true, Key1="E" }
28+
new HotkeySetting{Name=RubberduckHotkey.RefactorEncapsulateField.ToString(), IsEnabled=true, HasCtrlModifier = true, HasShiftModifier = true, Key1="F" },
29+
new HotkeySetting{Name=RubberduckHotkey.ExportActiveProject.ToString(), IsEnabled = true, HasCtrlModifier = true, HasShiftModifier = true, Key1="E" }
2930
};
3031

3132
private HashSet<HotkeySetting> _settings;

RetailCoder.VBE/Settings/RubberduckHotkey.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public enum RubberduckHotkey
1414
RefactorRename,
1515
RefactorExtractMethod,
1616
RefactorEncapsulateField,
17-
SourceControl
17+
SourceControl,
18+
ExportActiveProject
1819
}
1920
}

RetailCoder.VBE/UI/About/AboutControl.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<Hyperlink Name="GoFundMeHyperlink"
5050
NavigateUri="http://gofundme.com/rubberduckvba/"
5151
Command="{Binding UriCommand}"
52-
CommandParameter="{Binding ElementName=WebpageHyperlink, Path=NavigateUri}">gofundme.com/rubberduckvba</Hyperlink>
52+
CommandParameter="{Binding ElementName=GoFundMeHyperlink, Path=NavigateUri}">gofundme.com/rubberduckvba</Hyperlink>
5353
</TextBlock>
5454
</StackPanel>
5555
<StackPanel Grid.Column="1"

RetailCoder.VBE/UI/CodeExplorer/CodeExplorerControl.xaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@
274274
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
275275
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
276276
<Setter Property="HorizontalAlignment" Value="Left" />
277-
<EventSetter Event="PreviewMouseRightButtonDown" Handler="OnPreviewMouseRightButtonDown" />
278277
<EventSetter Event="MouseDoubleClick" Handler="TreeView_OnMouseDoubleClick" />
278+
<EventSetter Event="MouseRightButtonDown" Handler="TreeView_OnMouseRightButtonDown" />
279279
<Style.Triggers>
280280
<Trigger Property="IsSelected" Value="True">
281281
<Setter Property="BorderBrush" Value="#adc6e5"/>
@@ -425,7 +425,12 @@
425425
CommandParameter="{Binding SelectedItem}" />
426426
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeExplorer_Export}"
427427
Command="{Binding ExportCommand}"
428-
CommandParameter="{Binding SelectedItem}" />
428+
CommandParameter="{Binding SelectedItem}"
429+
Visibility="{Binding ExportVisibility}" />
430+
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeExplorer_ExportAll}"
431+
Command="{Binding ExportAllCommand}"
432+
CommandParameter="{Binding SelectedItem}"
433+
Visibility="{Binding ExportAllVisibility}" />
429434
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeExplorer_Remove}"
430435
Command="{Binding RemoveCommand}"
431436
CommandParameter="{Binding SelectedItem}" />

0 commit comments

Comments
 (0)