Skip to content

Commit

Permalink
4.5.1 (2019-03-15)
Browse files Browse the repository at this point in the history
* Upgrade to .NET 4.7.2, built with Visual Studio 2017
* Version number is now aligned with the changelog
  • Loading branch information
Mertsch committed Mar 15, 2019
1 parent dadaf28 commit 9175fd2
Show file tree
Hide file tree
Showing 20 changed files with 137 additions and 177 deletions.
8 changes: 6 additions & 2 deletions Source/Launchbar.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
# Visual Studio 15
VisualStudioVersion = 15.0.28307.489
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Launchbar", "Launchbar\Launchbar.csproj", "{D057789D-742A-4738-A96A-954C84D2478E}"
EndProject
Global
Expand All @@ -18,4 +19,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C53CD7C1-6ECD-4648-BEC9-B2106234D6B9}
EndGlobalSection
EndGlobal
18 changes: 9 additions & 9 deletions Source/Launchbar/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lb="clr-namespace:Launchbar"
xmlns:Shapes="clr-namespace:Launchbar.Shapes"
xmlns:Properties="clr-namespace:Launchbar.Properties">
xmlns:shapes="clr-namespace:Launchbar.Shapes"
xmlns:p="clr-namespace:Launchbar.Properties">

<Application.Resources>
<ResourceDictionary>
Expand All @@ -13,7 +13,7 @@
<ResourceDictionary Source="Resources\Images.xaml"/>
</ResourceDictionary.MergedDictionaries>

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

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

<!--MenuItem templates-->
<DataTemplate x:Key="dataTemplateSubmenuIcon">
<Shapes:ShapeFolder Style="{StaticResource StyleIcon}"
<shapes:ShapeFolder Style="{StaticResource StyleIcon}"
IsOpen="{Binding Path=(MenuItem.IsSubmenuOpen), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type MenuItem}}}"
/>
</DataTemplate>
<DataTemplate x:Key="dataTemplateCustomIcon" DataType="{x:Type lb:MenuEntryAdvanced}">
<Image Source="{Binding Path=Icon}" Style="{StaticResource StyleIcon}"/>
</DataTemplate>
<DataTemplate x:Key="dataTemplateWarningIcon">
<Shapes:ShapeWarning Style="{StaticResource StyleIcon}"/>
<shapes:ShapeWarning Style="{StaticResource StyleIcon}"/>
</DataTemplate>
<DataTemplate x:Key="dataTemplateFolderGoToIcon">
<Shapes:ShapeFolderGoTo Style="{StaticResource StyleIcon}"/>
<shapes:ShapeFolderGoTo Style="{StaticResource StyleIcon}"/>
</DataTemplate>
<DataTemplate x:Key="dataTemplateSettingsIcon">
<Image Source="{StaticResource imageSettings}" Style="{StaticResource StyleIcon}"/>
Expand Down Expand Up @@ -123,12 +123,12 @@

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

Expand Down
8 changes: 3 additions & 5 deletions Source/Launchbar/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Security;
Expand Down Expand Up @@ -81,8 +80,7 @@ public App()

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

bool instantiated;
instanceMutex = new Mutex(false, MutexName, out instantiated);
instanceMutex = new Mutex(false, MutexName, out bool instantiated);
if (!instantiated)
{
MessageBox.Show(Launchbar.Properties.Resources.SingleInstanceWarning,
Expand All @@ -92,7 +90,7 @@ public App()
{
splashScreen.Close(TimeSpan.Zero);
}
catch (Win32Exception) {}
catch (Win32Exception) { }
this.Shutdown();
return;
}
Expand All @@ -116,7 +114,7 @@ public App()
{
SystemEvents.DisplaySettingsChanged += this.displaySettingsChanged;
}
catch (SecurityException) {}
catch (SecurityException) { }
this.displaySettingsChanged(null, null); // Do primary initialization.

setting.PropertyChanged += this.settingsPropertyChanged;
Expand Down
4 changes: 1 addition & 3 deletions Source/Launchbar/ElementCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ public sealed class ElementCreator : IValueConverter
/// <returns>Objects described by the template.</returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
ControlTemplate ct = parameter as ControlTemplate;
if (ct == null)
if (!(parameter is ControlTemplate ct))
{
throw new ArgumentException("You must specify a ControlTemplate.", nameof(parameter));
}
return new Control { Template = ct };
//return ct.LoadContent();
}

/// <summary>
Expand Down
33 changes: 15 additions & 18 deletions Source/Launchbar/Launchbar.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D057789D-742A-4738-A96A-954C84D2478E}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Launchbar</RootNamespace>
<AssemblyName>Launchbar</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
Expand All @@ -27,6 +32,7 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
Expand All @@ -41,10 +47,6 @@
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="JetBrains.Annotations, Version=11.0.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.11.0.0\lib\net20\JetBrains.Annotations.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PresentationFramework.Aero" />
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -56,6 +58,11 @@
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations">
<Version>2018.3.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -136,17 +143,14 @@
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<None Include="key.snk" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>PublicSettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
Expand Down Expand Up @@ -210,11 +214,4 @@
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
3 changes: 1 addition & 2 deletions Source/Launchbar/MenuEntryAdvanced.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ public void ChooseIcon()
}
else
{
Program p = this as Program;
if (p != null && p.IsValidFile) // When the program path is valid, use that path as default.
if (this is Program p && p.IsValidFile) // When the program path is valid, use that path as default.
{
path = p.Path;
}
Expand Down
44 changes: 22 additions & 22 deletions Source/Launchbar/MenuItemStyleSelector.cs
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
using System;
using System.Windows;
using System.Windows.Controls;
using JetBrains.Annotations;

namespace Launchbar
{
public class MenuItemStyleSelector : StyleSelector
public sealed class MenuItemStyleSelector : StyleSelector
{
[CanBeNull]
public Style ProgramStyle { get; set; }

[CanBeNull]
public Style SubmenuStyle { get; set; }

[CanBeNull]
public Style SeparatorStyle { get; set; }

[CanBeNull]
public Style SettingsStyle { get; set; }

[CanBeNull]
public Style ExitStyle { get; set; }

public override Style SelectStyle(object item, DependencyObject container)
[CanBeNull, MustUseReturnValue]
public override Style SelectStyle([CanBeNull] object item, [CanBeNull] DependencyObject container)
{
if (item is Program)
switch (item)
{
return this.ProgramStyle;
case Program _:
return this.ProgramStyle;
case Submenu _:
return this.SubmenuStyle;
case Separator _:
return this.SeparatorStyle;
case MenuEntrySettings _:
return this.SettingsStyle;
case MenuEntryExit _:
return this.ExitStyle;
default:
return null;
}
if (item is Submenu)
{
return this.SubmenuStyle;
}
if (item is Separator)
{
return this.SeparatorStyle;
}
if (item is MenuEntrySettings)
{
return this.SettingsStyle;
}
if (item is MenuEntryExit)
{
return this.ExitStyle;
}

return null;
}
}
}
6 changes: 5 additions & 1 deletion Source/Launchbar/MetaData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ namespace Launchbar
public static class MetaData
{
[NotNull]
public static Version Version => Assembly.GetExecutingAssembly().GetName().Version;
private static readonly Lazy<string> version = new Lazy<string>(() =>
Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion);

[NotNull]
public static string Version => version.Value;
}
}
43 changes: 3 additions & 40 deletions Source/Launchbar/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public string Path
/// <summary>
/// Arguments to pass when starting the file.
/// </summary>
public String Arguments
public string Arguments
{
get { return this.arguments; }
set
Expand All @@ -86,43 +86,6 @@ public String Arguments
}
}

#region Reserved for future use

///// <summary>
///// Get or set a working directory to be used when starting the program.
///// </summary>
//public string UserWorkingDir { get; set; }

///// <summary>
///// Has the user chosen a
///// </summary>
//public bool HasUserWorkingDir
//{
// get { return !string.IsNullOrEmpty(this.UserWorkingDir); }
//}

///// <summary>
///// Directory to start in.
///// </summary>
//public String WorkingDir
//{
// get
// {
// if (!string.IsNullOrEmpty(this.UserWorkingDir))
// {
// return this.UserWorkingDir;
// }
// try
// {
// return System.IO.Path.GetDirectoryName(this.Path);
// }
// catch (ArgumentException) {}
// return null;
// }
//}

#endregion

/// <summary>
/// Priority to start the program with.
/// </summary>
Expand All @@ -143,12 +106,12 @@ public ProcessPriorityClass Priority
/// <summary>
/// Does the specified path point to an existing file?
/// </summary>
public Boolean IsValidFile => File.Exists(this.pathAbsolute);
public bool IsValidFile => File.Exists(this.pathAbsolute);

/// <summary>
/// Does the specified path point to an existing directory?
/// </summary>
public Boolean IsValidPath => Directory.Exists(this.pathAbsolute);
public bool IsValidPath => Directory.Exists(this.pathAbsolute);

#endregion

Expand Down
7 changes: 4 additions & 3 deletions Source/Launchbar/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Launchbar")]
[assembly: AssemblyCopyright("Copyright © Mertsch 2016")]
[assembly: AssemblyCopyright("Copyright © Mertsch 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
[assembly: NeutralResourcesLanguage("en")]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("4.5.0.0")]
[assembly: AssemblyFileVersion("4.5.0.0")]
[assembly: AssemblyVersion /* */("4.5.1.0")]
[assembly: AssemblyFileVersion /* */("4.5.1.0")]
[assembly: AssemblyInformationalVersion /**/("4.5.1")]
Loading

0 comments on commit 9175fd2

Please sign in to comment.