Drop net35 and net40 targets in favor of net461

This commit is contained in:
Yoshi Askharoun
2023-05-04 00:18:30 -05:00
parent 6efd1529b8
commit 8d6f505336
18 changed files with 157 additions and 397 deletions
+14 -50
View File
@@ -3,63 +3,27 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
<ApplicationVersion>4.9.0.0</ApplicationVersion>
<AssemblyVersion>$(ApplicationVersion)</AssemblyVersion>
<FileVersion>$(ApplicationVersion)</FileVersion>
<ApplicationVersion>5.0.0.0</ApplicationVersion>
<AssemblyVersion>$(ApplicationVersion)</AssemblyVersion>
<FileVersion>$(ApplicationVersion)</FileVersion>
<LangVersion>latest</LangVersion>
<TargetFrameworks>netstandard2.0;net35;net40;net6.0;net6.0-windows</TargetFrameworks>
<DefineConstants>$(DefineConstants);OPENZUNE</DefineConstants>
<TargetFrameworks>netstandard2.0;net461;net6.0;net6.0-windows</TargetFrameworks>
<Platforms>x64;x86</Platforms>
<SignAssembly>False</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)\libs\MicrosoftIris\36MSApp1024.snk</AssemblyOriginatorKeyFile>
<DelaySign>True</DelaySign>
<UseOpenZune>False</UseOpenZune>
</PropertyGroup>
<ItemGroup>
<None Include="**\*.lg.cs" Exclude="bin\**\*.lg.cs;obj\**\*.lg.cs" />
<Compile Remove="**\*.lg.cs" Condition="$(UseOpenZune)" />
<Compile Include="**\*.lg.cs"
Exclude="bin\**\*.lg.cs;obj\**\*.lg.cs"
Condition="!$(UseOpenZune)" />
<None Include="**\*.oz.cs" Exclude="bin\**\*.oz.cs;obj\**\*.oz.cs" />
<Compile Remove="**\*.oz.cs" Condition="!$(UseOpenZune)" />
<Compile Include="**\*.oz.cs"
Exclude="bin\**\*.oz.cs;obj\**\*.oz.cs"
Condition="$(UseOpenZune)" />
</ItemGroup>
<Choose>
<When Condition=" $(TargetFramework.StartsWith('net6.0-windows')) ">
<PropertyGroup>
<UseOpenZune>True</UseOpenZune>
<DefineConstants Condition="$(TargetFramework.StartsWith('net6.0-windows10'))">$(DefineConstants);WINDOWS10</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net6.0-windows8'))">$(DefineConstants);WINDOWS8</DefineConstants>
</PropertyGroup>
</When>
<When Condition=" $(TargetFramework.StartsWith('net6.0')) ">
<PropertyGroup>
<UseOpenZune>True</UseOpenZune>
</PropertyGroup>
</When>
<!--
.NET Core 3.1 is only used to target Windows 8/8.1
-->
<When Condition=" $(TargetFramework.StartsWith('netcoreapp')) ">
<PropertyGroup>
<UseOpenZune>True</UseOpenZune>
</PropertyGroup>
</When>
</Choose>
<PropertyGroup Condition="$(UseOpenZune)">
<ApplicationVersion>5.0.0.0</ApplicationVersion>
<DefineConstants>$(DefineConstants);OPENZUNE</DefineConstants>
</PropertyGroup>
<Choose>
<When Condition=" $(TargetFramework.StartsWith('net6.0-windows')) ">
<PropertyGroup>
<DefineConstants Condition="$(TargetFramework.StartsWith('net6.0-windows10'))">$(DefineConstants);WINDOWS10</DefineConstants>
<DefineConstants Condition="$(TargetFramework.StartsWith('net6.0-windows8'))">$(DefineConstants);WINDOWS8</DefineConstants>
</PropertyGroup>
</When>
</Choose>
</Project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
</configuration>
-2
View File
@@ -64,9 +64,7 @@ namespace ZuneHost.Wpf
Directory.Delete(decompResultDir, true);
Directory.CreateDirectory(decompResultDir);
IrisApp.DebugSettings.DecompileResults.CollectionChanged += DecompileResults_CollectionChanged;
#if NET6_0_OR_GREATER || NETCOREAPP3_1_OR_GREATER
IrisApp.DebugSettings.Bridge.InterpreterStep += Bridge_InterpreterStep;
#endif
}
IrisApp.DebugSettings.GenerateDataMappingModels = false;
+2 -1
View File
@@ -2,10 +2,11 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net6.0-windows10.0.22000;net40</TargetFrameworks>
<TargetFrameworks>net461;net6.0-windows10.0.22000</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<UseWPF>true</UseWPF>
<ApplicationIcon>Assets\ZuneFluentGem.ico</ApplicationIcon>
<AppConfig>App.config</AppConfig>
</PropertyGroup>
<ItemGroup>
-1
View File
@@ -2,7 +2,6 @@
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
namespace ZuneHost
{
+2 -1
View File
@@ -2,9 +2,10 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net40;net6.0-windows10.0.22000;net6.0;</TargetFrameworks>
<TargetFrameworks>net461;net6.0-windows10.0.22000;net6.0;</TargetFrameworks>
<Platforms>AnyCPU;x64;x86;ARM32</Platforms>
<LangVersion>11.0</LangVersion>
<AppConfig>App.config</AppConfig>
</PropertyGroup>
<ItemGroup>
@@ -99,14 +99,24 @@ namespace Microsoft.Zune.Playback
System.Net.Http.HttpClient client = new();
var httpStream = await client.GetStreamAsync(uri, cancellationToken);
var httpStream = await client.GetStreamAsync(uri
#if NET5_0_OR_GREATER
, cancellationToken);
#else
);
#endif
cancellationToken.ThrowIfCancellationRequested();
// NAudio requires some fancy stuff to stream from the web. This is
// a relatively simple workaround that downloads the entire file
// into memory before playing.
stream = new System.IO.MemoryStream();
await httpStream.CopyToAsync(stream, cancellationToken);
await httpStream.CopyToAsync(stream
#if NET5_0_OR_GREATER
, cancellationToken);
#else
);
#endif
cancellationToken.ThrowIfCancellationRequested();
reader = new StreamMediaFoundationReader(stream);
+55 -2
View File
@@ -1,15 +1,19 @@
using System.Globalization;
using System.IO;
using System.Net.Http;
using System.Reflection;
using System.Threading.Tasks;
using System.Xml.Serialization;
using Zune.Xml.Commerce;
using ZuneUI;
namespace Microsoft.Zune.Service
{
internal static partial class CommunityCommerce
{
static readonly XmlSerializer _signInRequestSerializer = new XmlSerializer(typeof(SignInRequest));
static readonly XmlSerializer _signInResponseSerializer = new XmlSerializer(typeof(SignInResponse));
static readonly XmlSerializer _signInRequestSerializer = new(typeof(SignInRequest));
static readonly XmlSerializer _signInResponseSerializer = new(typeof(SignInResponse));
static readonly HttpClient _client = Escargot._client;
static SignInResponse _memberInfo;
public static SignInResponse MemberInfo
@@ -29,6 +33,55 @@ namespace Microsoft.Zune.Service
public static void SignOut() => MemberInfo = null;
public static HRESULT TrySignIn()
{
if (!Escargot.HasToken)
return HRESULT._NS_E_SUBSCRIPTIONSERVICE_LOGIN_FAILED;
try
{
string url = Service2.Instance.GetEndPointUri(EServiceEndpointId.SEID_Commerce) + $"/account/signin";
HttpRequestMessage request = new(HttpMethod.Post, url);
request.Headers.UserAgent.ParseAdd(CommunityService.AppUserAgent);
var contentStream = GetSignInRequestBody();
request.Content = new StreamContent(contentStream);
request.Content.Headers.ContentType = new(Atom.Constants.ATOM_MIMETYPE);
request.Content.Headers.ContentLength = contentStream.Length;
Escargot.AuthenticateRequest(request);
var response =
#if NET5_0_OR_GREATER
_client.Send(request);
#else
Task.Run(() => _client.SendAsync(request)).Result;
#endif
response.EnsureSuccessStatusCode();
System.IO.Stream responseStream =
#if NET5_0_OR_GREATER
response.Content.ReadAsStream();
#else
Task.Run(response.Content.ReadAsStreamAsync).Result;
#endif
var responseObj = ReadSignInResponse(responseStream);
uint? errorCode = responseObj?.AccountState?.SignInErrorCode;
if (errorCode != 0)
return new HRESULT(unchecked((int)errorCode));
MemberInfo = responseObj;
return HRESULT._S_OK;
}
catch
{
return HRESULT._NS_E_SUBSCRIPTIONSERVICE_LOGIN_FAILED;
}
}
private static Stream GetSignInRequestBody()
{
var requestObj = new SignInRequest
-46
View File
@@ -1,46 +0,0 @@
using System.Net.Http;
using ZuneUI;
namespace Microsoft.Zune.Service
{
partial class CommunityCommerce
{
private static readonly HttpClient _client = Escargot._client;
public static HRESULT TrySignIn()
{
if (!Escargot.HasToken)
return HRESULT._NS_E_SUBSCRIPTIONSERVICE_LOGIN_FAILED;
try
{
string url = Service2.Instance.GetEndPointUri(EServiceEndpointId.SEID_Commerce) + $"/account/signin";
HttpRequestMessage request = new(HttpMethod.Post, url);
request.Headers.UserAgent.ParseAdd(CommunityService.AppUserAgent);
var contentStream = GetSignInRequestBody();
request.Content = new StreamContent(contentStream);
request.Content.Headers.ContentType = new(Atom.Constants.ATOM_MIMETYPE);
request.Content.Headers.ContentLength = contentStream.Length;
Escargot.AuthenticateRequest(request);
var response = _client.Send(request);
response.EnsureSuccessStatusCode();
var responseObj = ReadSignInResponse(response.Content.ReadAsStream());
uint? errorCode = responseObj?.AccountState?.SignInErrorCode;
if (errorCode != 0)
return new HRESULT(unchecked((int)errorCode));
MemberInfo = responseObj;
return HRESULT._S_OK;
}
catch
{
return HRESULT._NS_E_SUBSCRIPTIONSERVICE_LOGIN_FAILED;
}
}
}
}
-2
View File
@@ -470,9 +470,7 @@ namespace Microsoft.Zune.Service
if (hr.IsSuccess)
{
#if OPENZUNE
hr = CommunityCommerce.TrySignIn();
#endif
if (hr.IsSuccess)
{
+36
View File
@@ -1,5 +1,8 @@
using Meziantou.Framework.Win32;
using System.Linq;
using System.Net.Http;
using System.Reflection;
using System.Threading.Tasks;
namespace Microsoft.Zune.Service
{
@@ -10,6 +13,7 @@ namespace Microsoft.Zune.Service
const string HEADER_X_PASS = "X-Password";
const string HEADER_X_TOKEN = "X-Token";
internal static readonly HttpClient _client = new();
private static string _token;
/// <summary>
@@ -51,6 +55,38 @@ namespace Microsoft.Zune.Service
Username = null;
}
public static bool TrySignIn(string username, string password)
{
HttpRequestMessage request = new(HttpMethod.Post, ESCARGOT_NOTRST_URL);
request.Headers.TryAddWithoutValidation(HEADER_X_USER, username);
request.Headers.TryAddWithoutValidation(HEADER_X_PASS, password);
try
{
var response =
#if NET5_0_OR_GREATER
_client.Send(request);
#else
Task.Run(() => _client.SendAsync(request)).Result;
#endif
response.EnsureSuccessStatusCode();
string token = response.Headers.GetValues(HEADER_X_TOKEN).FirstOrDefault();
return TrySetCredentials(token, username);
}
catch
{
return false;
}
}
public static void AuthenticateRequest(HttpRequestMessage request)
{
request.Headers.Authorization = new("Bearer", _token);
}
private static bool TrySetCredentials(string token, string username)
{
if (token == null)
-27
View File
@@ -1,27 +0,0 @@
using System.Net;
namespace Microsoft.Zune.Service
{
partial class Escargot
{
public static bool TrySignIn(string username, string password)
{
var request = WebRequest.Create(ESCARGOT_NOTRST_URL);
request.Headers.Add(HEADER_X_USER, username);
request.Headers.Add(HEADER_X_PASS, password);
request.Method = "POST";
try
{
var response = request.GetResponse();
string token = response.Headers[HEADER_X_TOKEN];
return TrySetCredentials(token, username);
}
catch
{
return false;
}
}
}
}
-36
View File
@@ -1,36 +0,0 @@
using System.Linq;
using System.Net.Http;
namespace Microsoft.Zune.Service
{
partial class Escargot
{
internal static readonly HttpClient _client = new();
public static bool TrySignIn(string username, string password)
{
HttpRequestMessage request = new(HttpMethod.Post, ESCARGOT_NOTRST_URL);
request.Headers.TryAddWithoutValidation(HEADER_X_USER, username);
request.Headers.TryAddWithoutValidation(HEADER_X_PASS, password);
try
{
var response = _client.Send(request);
response.EnsureSuccessStatusCode();
string token = response.Headers.GetValues(HEADER_X_TOKEN).FirstOrDefault();
return TrySetCredentials(token, username);
}
catch
{
return false;
}
}
public static void AuthenticateRequest(HttpRequestMessage request)
{
request.Headers.Authorization = new("Bearer", _token);
}
}
}
+5 -28
View File
@@ -14,37 +14,14 @@
<!-- This is the last version of NAudio to support net35 and net6.0 -->
<PackageReference Include="NAudio" Version="1.10.0" />
<PackageReference Include="Zune.Xml" Version="0.1.0" />
<PackageReference Include="StrixMusic.Sdk" Version="0.1.0-alpha" />
<PackageReference Include="LibVLCSharp" Version="3.6.6" />
<PackageReference Include="Meziantou.Framework.Win32.CredentialManager" Version="1.4.2" />
<ProjectReference Include="..\libs\MicrosoftIris\UIX\UIX.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="**\*.lg.cs" Exclude="bin\**\*.lg.cs;obj\**\*.lg.cs" />
<Compile Remove="**\*.lg.cs" />
<Compile Include="**\*.lg.cs"
Exclude="bin\**\*.lg.cs;obj\**\*.lg.cs"
Condition="!$(UseOpenZune)" />
<None Include="**\*.oz.cs" Exclude="bin\**\*.oz.cs;obj\**\*.oz.cs" />
<Compile Remove="**\*.oz.cs" />
<Compile Include="**\*.oz.cs"
Exclude="bin\**\*.oz.cs;obj\**\*.oz.cs"
Condition="$(UseOpenZune)" />
<ProjectReference Include="..\libs\MicrosoftIris\UIX\UIX.csproj" />
</ItemGroup>
<ItemGroup Condition="$(UseOpenZune)">
<PackageReference Include="StrixMusic.Sdk" Version="0.1.0-alpha" />
<PackageReference Include="LibVLCSharp" Version="3.6.6" />
<PackageReference Include="Meziantou.Framework.Win32.CredentialManager" Version="1.4.2" />
</ItemGroup>
<ItemGroup Condition="!$(UseOpenZune)">
<ProjectReference Include="..\libs\Meziantou.Framework.Win32.CredentialManager\Meziantou.Framework.Win32.CredentialManager.csproj" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('net6.0-windows')) ">
<ItemGroup Condition=" $(TargetFramework.StartsWith('net6.0-windows')) Or $(TargetFramework.StartsWith('net4')) ">
<PackageReference Include="VideoLAN.LibVLC.Windows" Version="3.0.17.4" PrivateAssets="analyzers;build" />
</ItemGroup>
-5
View File
@@ -11,13 +11,8 @@ using System.Security.Permissions;
//[assembly: AssemblyDelaySign(true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
#if OPENZUNE
[assembly: AssemblyFileVersion("5.0.0.0")]
[assembly: AssemblyVersion("5.0.0.0")]
#else
[assembly: AssemblyFileVersion("4.8.2345.0")]
[assembly: AssemblyVersion("4.7.0.0")]
#endif
// Workaround for CA1416
#if WINDOWS10
@@ -8,26 +8,11 @@ using Microsoft.Iris;
using Microsoft.Win32;
using Microsoft.Zune.Configuration;
using Microsoft.Zune.Messaging;
using Microsoft.Zune.Playback;
using Microsoft.Zune.Service;
using Microsoft.Zune.Subscription;
using Microsoft.Zune.Util;
using MicrosoftZuneLibrary;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using System.Threading;
using UIXControls;
using ZuneUI;
using ZuneXml;
using System.Linq;
#if OPENZUNE
using Microsoft.Zune.Playback;
using OwlCore.ComponentModel;
using StrixMusic.Sdk.AdapterModels;
using StrixMusic.Sdk.AppModels;
@@ -35,7 +20,19 @@ using StrixMusic.Sdk.CoreModels;
using StrixMusic.Sdk.MediaPlayback;
using StrixMusic.Sdk.PluginModels;
using StrixMusic.Sdk.Plugins.PlaybackHandler;
#endif
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using UIXControls;
using ZuneUI;
using ZuneXml;
namespace Microsoft.Zune.Shell
{
@@ -71,29 +68,12 @@ namespace Microsoft.Zune.Shell
public static Service.Service Service => Zune.Service.Service.Instance;
public static IService Service2 => Zune.Service.Service2.Instance;
public static bool IsStrixCompatible
{
get
{
#if OPENZUNE
return true;
#else
return false;
#endif
}
}
public static bool IsStrixCompatible => true;
public static Version StrixSdkVersion =>
#if OPENZUNE
typeof(ICore).Assembly.GetName().Version;
#else
null;
#endif
public static Version StrixSdkVersion => typeof(ICore).Assembly.GetName().Version;
#if OPENZUNE
public static IStrixDataRoot DataRoot { get; private set; }
public static IPlaybackHandlerService PlaybackHandler { get; private set; }
#endif
public static event EventHandler Closing;
@@ -160,7 +140,6 @@ namespace Microsoft.Zune.Shell
FeaturesChanged.Instance.StartUp();
CultureHelper.CheckValidRegionAndLanguage();
#if OPENZUNE
DirectoryInfo cacheFolderPath = new(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Microsoft\Zune\OpenZune\LocalCoreCache"));
cacheFolderPath.Create();
OwlCore.Storage.SystemIO.SystemFolder cacheFolder = new(cacheFolderPath);
@@ -202,13 +181,11 @@ namespace Microsoft.Zune.Shell
await DataRoot.Library.PlayTrackCollectionAsync();
});
#endif
((ZuneUI.Shell)ZuneShell.DefaultInstance).ApplicationInitializationIsComplete = true;
}
}
#if OPENZUNE
private static async void LibraryTracksChanged(object sender,
IReadOnlyList<CollectionChangedItem<ITrack>> addedItems,
IReadOnlyList<CollectionChangedItem<ITrack>> removedItems)
@@ -235,7 +212,6 @@ namespace Microsoft.Zune.Shell
await firstTrack.PlayArtistCollectionAsync();
}
}
#endif
private static void Phase2InitializationUIStage(object arg)
{
@@ -461,11 +437,8 @@ namespace Microsoft.Zune.Shell
DialogHelper.DialogNo = ZuneUI.Shell.LoadString(StringId.IDS_DIALOG_NO);
DialogHelper.DialogOk = ZuneUI.Shell.LoadString(StringId.IDS_DIALOG_OK);
XmlDataProviders.Register();
#if false//OPENZUNE
Library.StrixLibraryDataProvider.Register();
#else
//Library.StrixLibraryDataProvider.Register();
LibraryDataProvider.Register();
#endif
SubscriptionDataProvider.Register();
StaticLibraryDataProvider.Register();
AggregateDataProviderQuery.Register();
+8 -40
View File
@@ -6,7 +6,7 @@
<OutputType>Library</OutputType>
<AssemblyName>ZuneShell</AssemblyName>
<TargetFrameworks>net6.0;net6.0-windows10.0.22000;net35;net40</TargetFrameworks>
<TargetFrameworks>net6.0;net6.0-windows10.0.22000;net461</TargetFrameworks>
<Platforms>x64;x86</Platforms>
<FileAlignment>512</FileAlignment>
@@ -30,43 +30,8 @@
<Reference Include="ZuneDBApi">
<HintPath>C:\Program Files\Zune\ZuneDBApi.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="**\*.lg.cs" Exclude="bin\**\*.lg.cs;obj\**\*.lg.cs" />
<Compile Remove="**\*.lg.cs" />
<Compile Include="**\*.lg.cs"
Exclude="bin\**\*.lg.cs;obj\**\*.lg.cs"
Condition="!$(UseOpenZune)" />
<None Include="**\*.oz.cs" Exclude="bin\**\*.oz.cs;obj\**\*.oz.cs" />
<Compile Remove="**\*.oz.cs" />
<Compile Include="**\*.oz.cs"
Exclude="bin\**\*.oz.cs;obj\**\*.oz.cs"
Condition="$(UseOpenZune)" />
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net35' ">
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<OldToolsVersion>3.5</OldToolsVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
<Reference Include="Accessibility" />
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="Accessibility" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('netcoreapp')) ">
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.22621.1" />
</ItemGroup>
<ItemGroup Condition=" $(UseOpenZune) ">
<PackageReference Include="StrixMusic.Sdk" Version="0.1.0-alpha" />
<PackageReference Include="StrixMusic.Sdk" Version="0.1.0-alpha" />
<Reference Include="StrixMusic.Cores.Storage">
<HintPath>..\libs\nuget\StrixMusic.Cores.Storage\StrixMusic.Cores.Storage.dll</HintPath>
</Reference>
@@ -75,8 +40,11 @@
</Reference>
</ItemGroup>
<ItemGroup Condition=" !$(UseOpenZune) ">
<Folder Remove="\StrixMusic\**" />
<Compile Remove="\StrixMusic\**" />
<ItemGroup Condition=" '$(TargetFramework)' == 'net4' ">
<Reference Include="Accessibility" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('netcoreapp')) ">
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.22621.1" />
</ItemGroup>
</Project>
@@ -1,110 +0,0 @@
using Microsoft.Zune.Util;
using MicrosoftZunePlayback;
using System;
namespace ZuneUI
{
partial class TransportControls
{
private void OnInit() { }
private void OnUninit() { }
private void OnPlayClicked(object sender, EventArgs e)
{
if (!this._play.Available)
return;
SQMLog.Log(SQMDataId.PlayClicks, 1);
if (this.Playing || this._playlistCurrent == null)
return;
if (this._lastKnownPlayerState != MCPlayerState.Closed)
{
this.SetPlayerState(PlayerState.Playing);
this._playbackWrapper.Play();
if (!this.PlayingVideo || this._playlistCurrent.PlayNavigationOptions != PlayNavigationOptions.NavigateVideosToNowPlaying)
return;
NowPlayingLand.NavigateToLand();
}
else
{
if (this._playlistPending != null)
this._playlistPending.Dispose();
this._playlistPending = this._playlistCurrent;
this.PlayPendingList();
}
}
private void OnPauseClicked(object sender, EventArgs e)
{
if (!this._pause.Available)
return;
SQMLog.Log(SQMDataId.PauseClicks, 1);
if (!this.Playing)
return;
this.SetPlayerState(PlayerState.Paused);
this._playbackWrapper.Pause();
}
private void OnStopClicked(object sender, EventArgs e)
{
if (!this._stop.Available)
return;
SQMLog.Log(SQMDataId.StopClicks, 1);
if (this._playlistPending != null)
this._playlistPending.Dispose();
this._playlistPending = null;
if (this._playlistCurrent != null)
this._playlistCurrent.Dispose();
this._playlistCurrent = null;
if (this._playerState != PlayerState.Stopped)
{
this.SetPlayerState(PlayerState.Stopped);
this._playbackWrapper.Stop();
}
else
this.UpdatePropertiesAndCommands();
}
private void OnBackClicked(object sender, EventArgs e)
{
if (!this._back.Available || this._playlistCurrent == null)
return;
SQMLog.Log(SQMDataId.SkipBackwardClicks, 1);
if (this._lastKnownPosition > 50000000L || !this._playlistCurrent.CanRetreat)
{
this._playbackWrapper.SeekToAbsolutePosition(0L);
}
else
{
this._playlistCurrent.Retreat();
this.SetUriOnPlayer();
}
}
private void OnForwardClicked(object sender, EventArgs e)
{
if (!this._forward.Available || this._playlistCurrent == null)
return;
SQMLog.Log(SQMDataId.SkipForwardClicks, 1);
if (this._currentTrack != null && this._currentTrack.IsVideo)
return;
if (this._lastKnownPlaybackTrack != null)
this._lastKnownPlaybackTrack.OnSkip();
if (this._playlistCurrent.CanAdvance)
{
this._playlistCurrent.Advance();
this.SetUriOnPlayer();
}
else
{
this.SetPlayerState(PlayerState.Stopped);
this._playbackWrapper.Stop();
}
}
}
}