Skip to content

Commit

Permalink
- Converting solution/projects to .NET 5
Browse files Browse the repository at this point in the history
- Fixes .NET 5 hanging issues
- FlyleafLib.Controls.WPF: Updating MaterialDesignThemes to 4.2.0
  • Loading branch information
SuRGeoNix committed Jul 23, 2021
1 parent 2e00236 commit 5981a5b
Show file tree
Hide file tree
Showing 74 changed files with 896 additions and 2,265 deletions.
7 changes: 5 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[*.cs]

# Default severity for analyzer diagnostics with category 'Style'
dotnet_analyzer_diagnostic.category-Style.severity = none
# CS1591: Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS1591.severity = none

# IDE0055: Fix formatting
dotnet_diagnostic.IDE0055.severity = none
10 changes: 10 additions & 0 deletions FlyleafLib.Controls.WPF/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
8 changes: 4 additions & 4 deletions FlyleafLib.Controls.WPF/Flyleaf.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<UserControl x:Class="FlyleafLib.Controls.WPF.Flyleaf"
<UserControl x:Class="FlyleafLib.Controls.WPF.Flyleaf"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Expand Down Expand Up @@ -36,7 +36,7 @@

<!--Pop Up Dialog (Settings/Set Values)-->
<materialDesign:DialogHost x:Name="PART_DialogSettings"/>

<!--Media Info-->
<TextBlock Margin="0 20 20 0" VerticalAlignment="top" HorizontalAlignment="Right" TextAlignment="Right" TextWrapping="Wrap" FontSize="16" Background="Black" Foreground="DarkOrange" FontWeight="Bold">
<TextBlock.Style>
Expand Down Expand Up @@ -69,7 +69,7 @@

<!--Subtitles-->
<TextBlock x:Name="PART_Subtitles" Margin="0 0 0 50" VerticalAlignment="Bottom" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" FontSize="33" Foreground="White" FontWeight="Bold" Text="{Binding Session.SubsText}"/>

<!--Flyleaf Bar-->
<materialDesign:Card TextElement.FontSize="14" TextElement.FontWeight="Medium" TextElement.Foreground="{DynamicResource MaterialDesignBody}" FontFamily="{materialDesign:MaterialDesignFont}" VerticalAlignment="Bottom" Focusable="False" Background="{StaticResource RadialBrush}">
<materialDesign:Card.Style>
Expand Down Expand Up @@ -387,7 +387,7 @@
</Button>

<!--Volume Slider (Decibel)-->
<Slider Grid.Column="4" Style="{StaticResource MaterialDesignDiscreteSlider}" Foreground="{DynamicResource MaterialDesignBody}" Focusable="False" Margin="0,-40,6,0" Width="100" VerticalAlignment="Center" IsMoveToPointEnabled="True" Maximum="150" Value="{Binding AudioPlayer.Volume}"/>
<Slider Grid.Column="4" Style="{StaticResource MaterialDesignDiscreteSlider}" Foreground="{DynamicResource MaterialDesignBody}" Focusable="False" Margin="0,0,6,6" Width="100" VerticalAlignment="Bottom" IsMoveToPointEnabled="True" Minimum="0" Maximum="150" Value="{Binding AudioPlayer.Volume}"/>

<!--Open Settings Button-->
<Button Grid.Column="5" Style="{StaticResource IconButton}" Content="{materialDesign:PackIcon Kind=SettingsOutline}" Command="{Binding OpenSettings}"/>
Expand Down
14 changes: 9 additions & 5 deletions FlyleafLib.Controls.WPF/Flyleaf.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -123,7 +123,7 @@ public void Dispose()
{
if (disposed) return;

//Console.WriteLine("Flyleaf_WPF_Dispose");
//System.Diagnostics.Debug.WriteLine("Flyleaf_WPF_Dispose");
WindowFront?.Close();
Player?.Dispose();

Expand All @@ -134,7 +134,7 @@ public void Dispose()
Content = null;
DataContext = null;
disposed = true;
//Console.WriteLine("Flyleaf_WPF_Disposed");
//System.Diagnostics.Debug.WriteLine("Flyleaf_WPF_Disposed");


}
Expand Down Expand Up @@ -673,11 +673,15 @@ private void Flyleaf_KeyDown(object sender, KeyEventArgs e)
switch (e.Key)
{
case Key.Up:
AudioPlayer.Volume += 5;
if (AudioPlayer.Volume == 150) return;
AudioPlayer.Volume += AudioPlayer.Volume + 5 > 150 ? 0 : 5;

break;

case Key.Down:
AudioPlayer.Volume -= 5;
if (AudioPlayer.Volume == 0) return;
AudioPlayer.Volume -= AudioPlayer.Volume - 5 < 0 ? 0 : 5;

break;

case Key.Right:
Expand Down
160 changes: 31 additions & 129 deletions FlyleafLib.Controls.WPF/FlyleafLib.Controls.WPF.csproj
Original file line number Diff line number Diff line change
@@ -1,137 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<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')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6FD09EC0-AECE-4534-911B-8457633A9CEB}</ProjectGuid>
<OutputType>library</OutputType>
<RootNamespace>FlyleafLib.Controls.WPF</RootNamespace>
<AssemblyName>FlyleafLib.Controls.WPF</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworks>net5.0-windows;net472</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<Version>1.1.3</Version>
<Authors>SuRGeoNix</Authors>
<Copyright>SuRGeoNix © 2021</Copyright>
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/SuRGeoNix/Flyleaf</PackageProjectUrl>
<PackageIcon>Flyleaf.png</PackageIcon>
<PackageIconUrl />
<PackageTags>flyleaf flyleaflib video media player element control</PackageTags>
<Description>WPF Video Player Control/Element (based on FlyleafLib)</Description>
<PackageReleaseNotes>Adding .NET 5 support
Updating MaterialDesignThemes to 4.2.0
</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Dragablz, Version=0.0.3.223, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Dragablz.0.0.3.223\lib\net45\Dragablz.dll</HintPath>
</Reference>
<Reference Include="MaterialDesignColors, Version=2.0.0.2422, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignColors.2.0.0\lib\net452\MaterialDesignColors.dll</HintPath>
</Reference>
<Reference Include="MaterialDesignThemes.Wpf, Version=4.0.0.2422, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignThemes.4.0.0\lib\net452\MaterialDesignThemes.Wpf.dll</HintPath>
</Reference>
<Reference Include="NAudio.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=e279aa5131008a41, processorArchitecture=MSIL">
<HintPath>..\packages\NAudio.Core.2.0.0\lib\netstandard2.0\NAudio.Core.dll</HintPath>
</Reference>
<Reference Include="NAudio.Wasapi, Version=2.0.0.0, Culture=neutral, PublicKeyToken=e279aa5131008a41, processorArchitecture=MSIL">
<HintPath>..\packages\NAudio.Wasapi.2.0.0\lib\netstandard2.0\NAudio.Wasapi.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WindowsFormsIntegration" />
<Reference Include="WpfColorFontDialog, Version=1.0.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\WpfColorFontDialog.1.0.8\lib\net40\WpfColorFontDialog.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<Compile Include="Converters.cs" />
<Compile Include="Flyleaf.xaml.cs">
<DependentUpon>Flyleaf.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="RelayCommand.cs" />
<Compile Include="Settings.xaml.cs">
<DependentUpon>Settings.xaml</DependentUpon>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<PackageReference Include="Dragablz" Version="0.0.3.223" />
<PackageReference Include="MaterialDesignColors" Version="2.0.2-ci2657" />
<PackageReference Include="MaterialDesignThemes" Version="4.2.0-ci2657" />
<PackageReference Include="WpfColorFontDialog" Version="1.0.8" />
</ItemGroup>

<ItemGroup>
<Page Include="Flyleaf.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainDictionary.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="PopUpMenu.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Settings.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<ProjectReference Include="..\FlyleafLib\FlyleafLib.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\FlyleafLib\FlyleafLib.csproj">
<Project>{31c6cbf5-1e30-475d-bc57-028eff3f0c91}</Project>
<Name>FlyleafLib</Name>
</ProjectReference>
<None Include="..\Images\Flyleaf.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets" Condition="Exists('..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets'))" />
</Target>
</Project>

</Project>
23 changes: 10 additions & 13 deletions FlyleafLib.Controls.WPF/MainDictionary.xaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:local="clr-namespace:FlyleafLib.Controls.WPF"
xmlns:flconv="clr-namespace:FlyleafLib.Controls.WPF;assembly=FlyleafLib"
>
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:fl="clr-namespace:FlyleafLib.Controls.WPF;assembly=FlyleafLib" xmlns:flwpf="clr-namespace:FlyleafLib.Controls.WPF">

<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />

<!-- primary color -->
<ResourceDictionary>

<!-- include your primary palette -->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/MaterialDesignColor.Orange.xaml" />
Expand Down Expand Up @@ -71,11 +67,12 @@
<SolidColorBrush x:Key="SecondaryAccentForegroundBrush" Color="{StaticResource Accent200Foreground}"/>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>

<flconv:StringToRationalConverter x:Key="StringToRational"/>
<flconv:TicksToTimeConverter x:Key="TicksToTime"/>
<flconv:TicksToSecondsConverter x:Key="TicksToSeconds" />
<flconv:TicksToMilliSecondsConverter x:Key="TicksToMilliSeconds"/>
<local:VolumeToLevelsConverter x:Key="VolumeToLevels"/>
<local:QualityToLevelsConverter x:Key="QualityToLevels"/>

<fl:StringToRationalConverter x:Key="StringToRational"/>
<fl:TicksToTimeConverter x:Key="TicksToTime"/>
<fl:TicksToSecondsConverter x:Key="TicksToSeconds" />
<fl:TicksToMilliSecondsConverter x:Key="TicksToMilliSeconds"/>
<flwpf:VolumeToLevelsConverter x:Key="VolumeToLevels"/>
<flwpf:QualityToLevelsConverter x:Key="QualityToLevels"/>

</ResourceDictionary>
55 changes: 0 additions & 55 deletions FlyleafLib.Controls.WPF/Properties/AssemblyInfo.cs

This file was deleted.

0 comments on commit 5981a5b

Please sign in to comment.