Skip to content

Commit 9175fd2

Browse files
committed
4.5.1 (2019-03-15)
* Upgrade to .NET 4.7.2, built with Visual Studio 2017 * Version number is now aligned with the changelog
1 parent dadaf28 commit 9175fd2

20 files changed

+137
-177
lines changed

Source/Launchbar.sln

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.24720.0
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.28307.489
5+
MinimumVisualStudioVersion = 10.0.40219.1
56
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Launchbar", "Launchbar\Launchbar.csproj", "{D057789D-742A-4738-A96A-954C84D2478E}"
67
EndProject
78
Global
@@ -18,4 +19,7 @@ Global
1819
GlobalSection(SolutionProperties) = preSolution
1920
HideSolutionNode = FALSE
2021
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {C53CD7C1-6ECD-4648-BEC9-B2106234D6B9}
24+
EndGlobalSection
2125
EndGlobal

Source/Launchbar/App.xaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:lb="clr-namespace:Launchbar"
6-
xmlns:Shapes="clr-namespace:Launchbar.Shapes"
7-
xmlns:Properties="clr-namespace:Launchbar.Properties">
6+
xmlns:shapes="clr-namespace:Launchbar.Shapes"
7+
xmlns:p="clr-namespace:Launchbar.Properties">
88

99
<Application.Resources>
1010
<ResourceDictionary>
@@ -13,7 +13,7 @@
1313
<ResourceDictionary Source="Resources\Images.xaml"/>
1414
</ResourceDictionary.MergedDictionaries>
1515

16-
<SolidColorBrush x:Key="BarBrush" Color="Red" Opacity="{Binding Source={x:Static Properties:Settings.Default}, Path=BarOpacity, Mode=OneWay}"/>
16+
<SolidColorBrush x:Key="BarBrush" Color="Red" Opacity="{Binding Source={x:Static p:Settings.Default}, Path=BarOpacity, Mode=OneWay}"/>
1717

1818
<Style x:Key="StyleIcon" TargetType="{x:Type FrameworkElement}">
1919
<Setter Property="Width" Value="24"/>
@@ -23,18 +23,18 @@
2323

2424
<!--MenuItem templates-->
2525
<DataTemplate x:Key="dataTemplateSubmenuIcon">
26-
<Shapes:ShapeFolder Style="{StaticResource StyleIcon}"
26+
<shapes:ShapeFolder Style="{StaticResource StyleIcon}"
2727
IsOpen="{Binding Path=(MenuItem.IsSubmenuOpen), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type MenuItem}}}"
2828
/>
2929
</DataTemplate>
3030
<DataTemplate x:Key="dataTemplateCustomIcon" DataType="{x:Type lb:MenuEntryAdvanced}">
3131
<Image Source="{Binding Path=Icon}" Style="{StaticResource StyleIcon}"/>
3232
</DataTemplate>
3333
<DataTemplate x:Key="dataTemplateWarningIcon">
34-
<Shapes:ShapeWarning Style="{StaticResource StyleIcon}"/>
34+
<shapes:ShapeWarning Style="{StaticResource StyleIcon}"/>
3535
</DataTemplate>
3636
<DataTemplate x:Key="dataTemplateFolderGoToIcon">
37-
<Shapes:ShapeFolderGoTo Style="{StaticResource StyleIcon}"/>
37+
<shapes:ShapeFolderGoTo Style="{StaticResource StyleIcon}"/>
3838
</DataTemplate>
3939
<DataTemplate x:Key="dataTemplateSettingsIcon">
4040
<Image Source="{StaticResource imageSettings}" Style="{StaticResource StyleIcon}"/>
@@ -123,12 +123,12 @@
123123

124124
<!--This template is used programmatically.-->
125125
<ContextMenu x:Key="contextMenuTemplate" KeyDown="contextMenuKeyDown" Margin="1"
126-
ItemsSource="{Binding Source={x:Static Properties:Settings.Default}, Path=Menu.Entries}"
126+
ItemsSource="{Binding Source={x:Static p:Settings.Default}, Path=Menu.Entries}"
127127
MinWidth="125" MinHeight="25"
128128
ItemContainerStyleSelector="{DynamicResource MenuItemStyleSelector}">
129129
<ContextMenu.LayoutTransform>
130-
<ScaleTransform ScaleX="{Binding Source={x:Static Properties:Settings.Default}, Path=ContextMenuScale}"
131-
ScaleY="{Binding Source={x:Static Properties:Settings.Default}, Path=ContextMenuScale}"/>
130+
<ScaleTransform ScaleX="{Binding Source={x:Static p:Settings.Default}, Path=ContextMenuScale}"
131+
ScaleY="{Binding Source={x:Static p:Settings.Default}, Path=ContextMenuScale}"/>
132132
</ContextMenu.LayoutTransform>
133133
</ContextMenu>
134134

Source/Launchbar/App.xaml.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.ComponentModel;
3-
using System.Diagnostics;
43
using System.Diagnostics.CodeAnalysis;
54
using System.Drawing;
65
using System.Security;
@@ -81,8 +80,7 @@ public App()
8180

8281
#region Make sure that only one instance of the application is running at any given time.
8382

84-
bool instantiated;
85-
instanceMutex = new Mutex(false, MutexName, out instantiated);
83+
instanceMutex = new Mutex(false, MutexName, out bool instantiated);
8684
if (!instantiated)
8785
{
8886
MessageBox.Show(Launchbar.Properties.Resources.SingleInstanceWarning,
@@ -92,7 +90,7 @@ public App()
9290
{
9391
splashScreen.Close(TimeSpan.Zero);
9492
}
95-
catch (Win32Exception) {}
93+
catch (Win32Exception) { }
9694
this.Shutdown();
9795
return;
9896
}
@@ -116,7 +114,7 @@ public App()
116114
{
117115
SystemEvents.DisplaySettingsChanged += this.displaySettingsChanged;
118116
}
119-
catch (SecurityException) {}
117+
catch (SecurityException) { }
120118
this.displaySettingsChanged(null, null); // Do primary initialization.
121119

122120
setting.PropertyChanged += this.settingsPropertyChanged;

Source/Launchbar/ElementCreator.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ public sealed class ElementCreator : IValueConverter
2020
/// <returns>Objects described by the template.</returns>
2121
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
2222
{
23-
ControlTemplate ct = parameter as ControlTemplate;
24-
if (ct == null)
23+
if (!(parameter is ControlTemplate ct))
2524
{
2625
throw new ArgumentException("You must specify a ControlTemplate.", nameof(parameter));
2726
}
2827
return new Control { Template = ct };
29-
//return ct.LoadContent();
3028
}
3129

3230
/// <summary>

Source/Launchbar/Launchbar.csproj

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
34
<PropertyGroup>
4-
<SchemaVersion>2.0</SchemaVersion>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
57
<ProjectGuid>{D057789D-742A-4738-A96A-954C84D2478E}</ProjectGuid>
68
<OutputType>WinExe</OutputType>
7-
<AppDesignerFolder>Properties</AppDesignerFolder>
89
<RootNamespace>Launchbar</RootNamespace>
910
<AssemblyName>Launchbar</AssemblyName>
10-
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
11+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12+
<TargetFrameworkProfile />
1113
<FileAlignment>512</FileAlignment>
1214
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1315
<WarningLevel>4</WarningLevel>
16+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
17+
<Deterministic>true</Deterministic>
1418
<SccProjectName>SAK</SccProjectName>
1519
<SccLocalPath>SAK</SccLocalPath>
1620
<SccAuxPath>SAK</SccAuxPath>
1721
<SccProvider>SAK</SccProvider>
1822
</PropertyGroup>
1923
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
24+
<PlatformTarget>AnyCPU</PlatformTarget>
2025
<DebugSymbols>true</DebugSymbols>
2126
<DebugType>full</DebugType>
2227
<Optimize>false</Optimize>
@@ -27,6 +32,7 @@
2732
<Prefer32Bit>false</Prefer32Bit>
2833
</PropertyGroup>
2934
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
35+
<PlatformTarget>AnyCPU</PlatformTarget>
3036
<DebugType>pdbonly</DebugType>
3137
<Optimize>true</Optimize>
3238
<OutputPath>bin\Release\</OutputPath>
@@ -41,10 +47,6 @@
4147
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
4248
</PropertyGroup>
4349
<ItemGroup>
44-
<Reference Include="JetBrains.Annotations, Version=11.0.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
45-
<HintPath>..\packages\JetBrains.Annotations.11.0.0\lib\net20\JetBrains.Annotations.dll</HintPath>
46-
<Private>True</Private>
47-
</Reference>
4850
<Reference Include="PresentationFramework.Aero" />
4951
<Reference Include="System" />
5052
<Reference Include="System.Core" />
@@ -56,6 +58,11 @@
5658
<Reference Include="PresentationCore" />
5759
<Reference Include="PresentationFramework" />
5860
</ItemGroup>
61+
<ItemGroup>
62+
<PackageReference Include="JetBrains.Annotations">
63+
<Version>2018.3.0</Version>
64+
</PackageReference>
65+
</ItemGroup>
5966
<ItemGroup>
6067
<ApplicationDefinition Include="App.xaml">
6168
<Generator>MSBuild:Compile</Generator>
@@ -136,17 +143,14 @@
136143
<EmbeddedResource Include="Properties\Resources.resx">
137144
<Generator>PublicResXFileCodeGenerator</Generator>
138145
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
139-
<SubType>Designer</SubType>
140146
</EmbeddedResource>
141147
<None Include="app.config">
142148
<SubType>Designer</SubType>
143149
</None>
144150
<None Include="key.snk" />
145-
<None Include="packages.config" />
146151
<None Include="Properties\Settings.settings">
147152
<Generator>PublicSettingsSingleFileGenerator</Generator>
148153
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
149-
<SubType>Designer</SubType>
150154
</None>
151155
<AppDesigner Include="Properties\" />
152156
</ItemGroup>
@@ -210,11 +214,4 @@
210214
</Page>
211215
</ItemGroup>
212216
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
213-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
214-
Other similar extension points exist, see Microsoft.Common.targets.
215-
<Target Name="BeforeBuild">
216-
</Target>
217-
<Target Name="AfterBuild">
218-
</Target>
219-
-->
220217
</Project>

Source/Launchbar/MenuEntryAdvanced.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ public void ChooseIcon()
180180
}
181181
else
182182
{
183-
Program p = this as Program;
184-
if (p != null && p.IsValidFile) // When the program path is valid, use that path as default.
183+
if (this is Program p && p.IsValidFile) // When the program path is valid, use that path as default.
185184
{
186185
path = p.Path;
187186
}
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
using System;
22
using System.Windows;
33
using System.Windows.Controls;
4+
using JetBrains.Annotations;
45

56
namespace Launchbar
67
{
7-
public class MenuItemStyleSelector : StyleSelector
8+
public sealed class MenuItemStyleSelector : StyleSelector
89
{
10+
[CanBeNull]
911
public Style ProgramStyle { get; set; }
1012

13+
[CanBeNull]
1114
public Style SubmenuStyle { get; set; }
1215

16+
[CanBeNull]
1317
public Style SeparatorStyle { get; set; }
1418

19+
[CanBeNull]
1520
public Style SettingsStyle { get; set; }
1621

22+
[CanBeNull]
1723
public Style ExitStyle { get; set; }
1824

19-
public override Style SelectStyle(object item, DependencyObject container)
25+
[CanBeNull, MustUseReturnValue]
26+
public override Style SelectStyle([CanBeNull] object item, [CanBeNull] DependencyObject container)
2027
{
21-
if (item is Program)
28+
switch (item)
2229
{
23-
return this.ProgramStyle;
30+
case Program _:
31+
return this.ProgramStyle;
32+
case Submenu _:
33+
return this.SubmenuStyle;
34+
case Separator _:
35+
return this.SeparatorStyle;
36+
case MenuEntrySettings _:
37+
return this.SettingsStyle;
38+
case MenuEntryExit _:
39+
return this.ExitStyle;
40+
default:
41+
return null;
2442
}
25-
if (item is Submenu)
26-
{
27-
return this.SubmenuStyle;
28-
}
29-
if (item is Separator)
30-
{
31-
return this.SeparatorStyle;
32-
}
33-
if (item is MenuEntrySettings)
34-
{
35-
return this.SettingsStyle;
36-
}
37-
if (item is MenuEntryExit)
38-
{
39-
return this.ExitStyle;
40-
}
41-
42-
return null;
4343
}
4444
}
4545
}

Source/Launchbar/MetaData.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ namespace Launchbar
77
public static class MetaData
88
{
99
[NotNull]
10-
public static Version Version => Assembly.GetExecutingAssembly().GetName().Version;
10+
private static readonly Lazy<string> version = new Lazy<string>(() =>
11+
Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion);
12+
13+
[NotNull]
14+
public static string Version => version.Value;
1115
}
1216
}

Source/Launchbar/Program.cs

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public string Path
6868
/// <summary>
6969
/// Arguments to pass when starting the file.
7070
/// </summary>
71-
public String Arguments
71+
public string Arguments
7272
{
7373
get { return this.arguments; }
7474
set
@@ -86,43 +86,6 @@ public String Arguments
8686
}
8787
}
8888

89-
#region Reserved for future use
90-
91-
///// <summary>
92-
///// Get or set a working directory to be used when starting the program.
93-
///// </summary>
94-
//public string UserWorkingDir { get; set; }
95-
96-
///// <summary>
97-
///// Has the user chosen a
98-
///// </summary>
99-
//public bool HasUserWorkingDir
100-
//{
101-
// get { return !string.IsNullOrEmpty(this.UserWorkingDir); }
102-
//}
103-
104-
///// <summary>
105-
///// Directory to start in.
106-
///// </summary>
107-
//public String WorkingDir
108-
//{
109-
// get
110-
// {
111-
// if (!string.IsNullOrEmpty(this.UserWorkingDir))
112-
// {
113-
// return this.UserWorkingDir;
114-
// }
115-
// try
116-
// {
117-
// return System.IO.Path.GetDirectoryName(this.Path);
118-
// }
119-
// catch (ArgumentException) {}
120-
// return null;
121-
// }
122-
//}
123-
124-
#endregion
125-
12689
/// <summary>
12790
/// Priority to start the program with.
12891
/// </summary>
@@ -143,12 +106,12 @@ public ProcessPriorityClass Priority
143106
/// <summary>
144107
/// Does the specified path point to an existing file?
145108
/// </summary>
146-
public Boolean IsValidFile => File.Exists(this.pathAbsolute);
109+
public bool IsValidFile => File.Exists(this.pathAbsolute);
147110

148111
/// <summary>
149112
/// Does the specified path point to an existing directory?
150113
/// </summary>
151-
public Boolean IsValidPath => Directory.Exists(this.pathAbsolute);
114+
public bool IsValidPath => Directory.Exists(this.pathAbsolute);
152115

153116
#endregion
154117

Source/Launchbar/Properties/AssemblyInfo.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
[assembly: AssemblyConfiguration("")]
1010
[assembly: AssemblyCompany("")]
1111
[assembly: AssemblyProduct("Launchbar")]
12-
[assembly: AssemblyCopyright("Copyright © Mertsch 2016")]
12+
[assembly: AssemblyCopyright("Copyright © Mertsch 2019")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515
[assembly: ComVisible(false)]
1616
[assembly: CLSCompliant(true)]
1717
[assembly: NeutralResourcesLanguage("en")]
1818
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
19-
[assembly: AssemblyVersion("4.5.0.0")]
20-
[assembly: AssemblyFileVersion("4.5.0.0")]
19+
[assembly: AssemblyVersion /* */("4.5.1.0")]
20+
[assembly: AssemblyFileVersion /* */("4.5.1.0")]
21+
[assembly: AssemblyInformationalVersion /**/("4.5.1")]

0 commit comments

Comments
 (0)