1.0-dev6 (Option bar added and code cleaned)
This commit is contained in:
10
VDownload.Core/EventArgsObjects/PlaylistSearchEventArgs.cs
Normal file
10
VDownload.Core/EventArgsObjects/PlaylistSearchEventArgs.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace VDownload.Core.EventArgsObjects
|
||||||
|
{
|
||||||
|
public class PlaylistSearchEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public string Phrase { get; set; }
|
||||||
|
public int Count { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
9
VDownload.Core/EventArgsObjects/VideoSearchEventArgs.cs
Normal file
9
VDownload.Core/EventArgsObjects/VideoSearchEventArgs.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace VDownload.Core.EventArgsObjects
|
||||||
|
{
|
||||||
|
public class VideoSearchEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public string Phrase { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using VDownload.Core.Enums;
|
using VDownload.Core.Enums;
|
||||||
|
|
||||||
namespace VDownload.Core.Interfaces
|
namespace VDownload.Core.Interfaces
|
||||||
{
|
{
|
||||||
public interface IAStream
|
public interface IAStream
|
||||||
{
|
{
|
||||||
#region PARAMETERS
|
#region PROPERTIES
|
||||||
|
|
||||||
Uri Url { get; }
|
Uri Url { get; }
|
||||||
bool IsChunked { get; }
|
bool IsChunked { get; }
|
||||||
@@ -1,14 +1,10 @@
|
|||||||
using System;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace VDownload.Core.Interfaces
|
namespace VDownload.Core.Interfaces
|
||||||
{
|
{
|
||||||
internal interface IPlaylistService
|
internal interface IPlaylistService
|
||||||
{
|
{
|
||||||
#region PARAMETERS
|
#region PROPERTIES
|
||||||
|
|
||||||
string ID { get; }
|
string ID { get; }
|
||||||
string Name { get; }
|
string Name { get; }
|
||||||
@@ -5,7 +5,7 @@ namespace VDownload.Core.Interfaces
|
|||||||
{
|
{
|
||||||
public interface IVStream
|
public interface IVStream
|
||||||
{
|
{
|
||||||
#region PARAMETERS
|
#region PROPERTIES
|
||||||
|
|
||||||
Uri Url { get; }
|
Uri Url { get; }
|
||||||
bool IsChunked { get; }
|
bool IsChunked { get; }
|
||||||
@@ -3,14 +3,14 @@ using System.ComponentModel;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using VDownload.Core.Enums;
|
using VDownload.Core.Enums;
|
||||||
using VDownload.Core.Models;
|
using VDownload.Core.Objects;
|
||||||
using Windows.Storage;
|
using Windows.Storage;
|
||||||
|
|
||||||
namespace VDownload.Core.Interfaces
|
namespace VDownload.Core.Interfaces
|
||||||
{
|
{
|
||||||
public interface IVideoService
|
public interface IVideoService
|
||||||
{
|
{
|
||||||
#region PARAMETERS
|
#region PROPERTIES
|
||||||
|
|
||||||
string ID { get; }
|
string ID { get; }
|
||||||
string Title { get; }
|
string Title { get; }
|
||||||
@@ -49,15 +49,10 @@ namespace VDownload.Core.Interfaces
|
|||||||
#region EVENT HANDLERS
|
#region EVENT HANDLERS
|
||||||
|
|
||||||
event EventHandler DownloadingStarted;
|
event EventHandler DownloadingStarted;
|
||||||
|
|
||||||
event EventHandler<ProgressChangedEventArgs> DownloadingProgressChanged;
|
event EventHandler<ProgressChangedEventArgs> DownloadingProgressChanged;
|
||||||
|
|
||||||
event EventHandler DownloadingCompleted;
|
event EventHandler DownloadingCompleted;
|
||||||
|
|
||||||
event EventHandler ProcessingStarted;
|
event EventHandler ProcessingStarted;
|
||||||
|
|
||||||
event EventHandler<ProgressChangedEventArgs> ProcessingProgressChanged;
|
event EventHandler<ProgressChangedEventArgs> ProcessingProgressChanged;
|
||||||
|
|
||||||
event EventHandler ProcessingCompleted;
|
event EventHandler ProcessingCompleted;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -2,11 +2,24 @@
|
|||||||
using VDownload.Core.Enums;
|
using VDownload.Core.Enums;
|
||||||
using VDownload.Core.Interfaces;
|
using VDownload.Core.Interfaces;
|
||||||
|
|
||||||
namespace VDownload.Core.Models
|
namespace VDownload.Core.Objects
|
||||||
{
|
{
|
||||||
public class Stream : IVStream, IAStream
|
public class Stream : IVStream, IAStream
|
||||||
{
|
{
|
||||||
#region PARAMETERS
|
#region CONSTRUCTORS
|
||||||
|
|
||||||
|
public Stream(Uri url, bool isChunked, StreamType streamType)
|
||||||
|
{
|
||||||
|
Url = url;
|
||||||
|
IsChunked = isChunked;
|
||||||
|
StreamType = streamType;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
public Uri Url { get; private set; }
|
public Uri Url { get; private set; }
|
||||||
public bool IsChunked { get; private set; }
|
public bool IsChunked { get; private set; }
|
||||||
@@ -19,18 +32,5 @@ namespace VDownload.Core.Models
|
|||||||
public string AudioCodec { get; set; }
|
public string AudioCodec { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region CONSTRUCTORS
|
|
||||||
|
|
||||||
public Stream(Uri url, bool isChunked, StreamType streamType)
|
|
||||||
{
|
|
||||||
Url = url;
|
|
||||||
IsChunked = isChunked;
|
|
||||||
StreamType = streamType;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Windows.Media.Editing;
|
using Windows.Media.Editing;
|
||||||
using Windows.Storage;
|
using Windows.Storage;
|
||||||
|
|
||||||
namespace VDownload.Core.Services
|
namespace VDownload.Core.Services
|
||||||
{
|
{
|
||||||
internal class Config
|
public class Config
|
||||||
{
|
{
|
||||||
#region CONSTANTS
|
#region CONSTANTS
|
||||||
|
|
||||||
@@ -25,7 +22,8 @@ namespace VDownload.Core.Services
|
|||||||
{ "twitch_vod_downloading_chunk_retries_delay", 5000 },
|
{ "twitch_vod_downloading_chunk_retries_delay", 5000 },
|
||||||
{ "media_transcoding_use_hardware_acceleration", true },
|
{ "media_transcoding_use_hardware_acceleration", true },
|
||||||
{ "media_transcoding_use_mrfcrf444_algorithm", true },
|
{ "media_transcoding_use_mrfcrf444_algorithm", true },
|
||||||
{ "media_editing_algorithm", MediaTrimmingPreference.Fast }
|
{ "media_editing_algorithm", (int)MediaTrimmingPreference.Fast },
|
||||||
|
{ "default_max_playlist_videos", 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -15,16 +15,6 @@ namespace VDownload.Core.Services
|
|||||||
{
|
{
|
||||||
public class MediaProcessor
|
public class MediaProcessor
|
||||||
{
|
{
|
||||||
#region PARAMETERS
|
|
||||||
|
|
||||||
public StorageFile OutputFile { get; private set; }
|
|
||||||
public TimeSpan TrimStart { get; private set; }
|
|
||||||
public TimeSpan TrimEnd { get; private set; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region CONSTRUCTOR
|
#region CONSTRUCTOR
|
||||||
|
|
||||||
public MediaProcessor(StorageFile outputFile, TimeSpan trimStart, TimeSpan trimEnd)
|
public MediaProcessor(StorageFile outputFile, TimeSpan trimStart, TimeSpan trimEnd)
|
||||||
@@ -38,6 +28,16 @@ namespace VDownload.Core.Services
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
public StorageFile OutputFile { get; private set; }
|
||||||
|
public TimeSpan TrimStart { get; private set; }
|
||||||
|
public TimeSpan TrimEnd { get; private set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region STANDARD METHODS
|
#region STANDARD METHODS
|
||||||
|
|
||||||
public async Task Run(StorageFile audioVideoInputFile, MediaFileExtension extension, MediaType mediaType, CancellationToken cancellationToken = default)
|
public async Task Run(StorageFile audioVideoInputFile, MediaFileExtension extension, MediaType mediaType, CancellationToken cancellationToken = default)
|
||||||
@@ -14,7 +14,6 @@ namespace VDownload.Core.Services.Sources.Twitch
|
|||||||
{
|
{
|
||||||
public class Auth
|
public class Auth
|
||||||
{
|
{
|
||||||
|
|
||||||
#region CONSTANTS
|
#region CONSTANTS
|
||||||
|
|
||||||
// CLIENT ID
|
// CLIENT ID
|
||||||
@@ -24,7 +24,7 @@ namespace VDownload.Core.Services.Sources.Twitch
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region PARAMETERS
|
#region PROPERTIES
|
||||||
|
|
||||||
public string ID { get; private set; }
|
public string ID { get; private set; }
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
@@ -12,7 +12,7 @@ using System.Web;
|
|||||||
using VDownload.Core.Enums;
|
using VDownload.Core.Enums;
|
||||||
using VDownload.Core.Exceptions;
|
using VDownload.Core.Exceptions;
|
||||||
using VDownload.Core.Interfaces;
|
using VDownload.Core.Interfaces;
|
||||||
using VDownload.Core.Models;
|
using VDownload.Core.Objects;
|
||||||
using Windows.Storage;
|
using Windows.Storage;
|
||||||
|
|
||||||
namespace VDownload.Core.Services.Sources.Twitch
|
namespace VDownload.Core.Services.Sources.Twitch
|
||||||
@@ -38,7 +38,7 @@ namespace VDownload.Core.Services.Sources.Twitch
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region PARAMETERS
|
#region PROPERTIES
|
||||||
|
|
||||||
public string ID { get; private set; }
|
public string ID { get; private set; }
|
||||||
public string Title { get; private set; }
|
public string Title { get; private set; }
|
||||||
@@ -11,7 +11,7 @@ using System.Threading.Tasks;
|
|||||||
using VDownload.Core.Enums;
|
using VDownload.Core.Enums;
|
||||||
using VDownload.Core.Exceptions;
|
using VDownload.Core.Exceptions;
|
||||||
using VDownload.Core.Interfaces;
|
using VDownload.Core.Interfaces;
|
||||||
using VDownload.Core.Models;
|
using VDownload.Core.Objects;
|
||||||
using Windows.Storage;
|
using Windows.Storage;
|
||||||
|
|
||||||
namespace VDownload.Core.Services.Sources.Twitch
|
namespace VDownload.Core.Services.Sources.Twitch
|
||||||
@@ -49,7 +49,7 @@ namespace VDownload.Core.Services.Sources.Twitch
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region PARAMETERS
|
#region PROPERTIES
|
||||||
|
|
||||||
public string ID { get; private set; }
|
public string ID { get; private set; }
|
||||||
public string Title { get; private set; }
|
public string Title { get; private set; }
|
||||||
@@ -87,14 +87,9 @@ namespace VDownload.Core.Services.Sources.Twitch
|
|||||||
JToken response = JObject.Parse(await client.DownloadStringTaskAsync("https://api.twitch.tv/helix/videos")).GetValue("data")[0];
|
JToken response = JObject.Parse(await client.DownloadStringTaskAsync("https://api.twitch.tv/helix/videos")).GetValue("data")[0];
|
||||||
|
|
||||||
// Set parameters
|
// Set parameters
|
||||||
Title = ((string)response["title"]).Replace("\n", "");
|
GetMetadataAsync(response);
|
||||||
Author = (string)response["user_name"];
|
|
||||||
Date = Convert.ToDateTime(response["created_at"]);
|
|
||||||
Duration = TimeSpan.ParseExact((string)response["duration"], TimeFormats, null);
|
|
||||||
Views = (long)response["view_count"];
|
|
||||||
Thumbnail = (string)response["thumbnail_url"] == string.Empty ? Globals.Assets.UnknownThumbnailImage : new Uri((string)response["thumbnail_url"]);
|
|
||||||
}
|
}
|
||||||
public void GetMetadataAsync(JToken response)
|
internal void GetMetadataAsync(JToken response)
|
||||||
{
|
{
|
||||||
// Set parameters
|
// Set parameters
|
||||||
Title = ((string)response["title"]).Replace("\n", "");
|
Title = ((string)response["title"]).Replace("\n", "");
|
||||||
@@ -102,7 +97,7 @@ namespace VDownload.Core.Services.Sources.Twitch
|
|||||||
Date = Convert.ToDateTime(response["created_at"]);
|
Date = Convert.ToDateTime(response["created_at"]);
|
||||||
Duration = TimeSpan.ParseExact((string)response["duration"], TimeFormats, null);
|
Duration = TimeSpan.ParseExact((string)response["duration"], TimeFormats, null);
|
||||||
Views = (long)response["view_count"];
|
Views = (long)response["view_count"];
|
||||||
Thumbnail = (string)response["thumbnail_url"] == string.Empty ? Globals.Assets.UnknownThumbnailImage : new Uri((string)response["thumbnail_url"]);
|
Thumbnail = (string)response["thumbnail_url"] == string.Empty ? null : new Uri((string)response["thumbnail_url"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET VOD STREAMS
|
// GET VOD STREAMS
|
||||||
169
VDownload.Core/VDownload.Core.csproj
Normal file
169
VDownload.Core/VDownload.Core.csproj
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>VDownload.Core</RootNamespace>
|
||||||
|
<AssemblyName>VDownload.Core</AssemblyName>
|
||||||
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
|
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||||
|
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.22000.0</TargetPlatformVersion>
|
||||||
|
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
|
||||||
|
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<OutputPath>bin\x86\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
|
||||||
|
<PlatformTarget>ARM</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\ARM\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
|
||||||
|
<PlatformTarget>ARM</PlatformTarget>
|
||||||
|
<OutputPath>bin\ARM\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
|
||||||
|
<PlatformTarget>ARM64</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\ARM64\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
|
||||||
|
<PlatformTarget>ARM64</PlatformTarget>
|
||||||
|
<OutputPath>bin\ARM64\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<OutputPath>bin\x64\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Enums\AudioFileExtension.cs" />
|
||||||
|
<Compile Include="Enums\MediaFileExtension.cs" />
|
||||||
|
<Compile Include="Enums\MediaType.cs" />
|
||||||
|
<Compile Include="Enums\StreamType.cs" />
|
||||||
|
<Compile Include="Enums\VideoFileExtension.cs" />
|
||||||
|
<Compile Include="EventArgsObjects\VideoSearchEventArgs.cs" />
|
||||||
|
<Compile Include="EventArgsObjects\PlaylistSearchEventArgs.cs" />
|
||||||
|
<Compile Include="Exceptions\TwitchAccessTokenNotFoundException.cs" />
|
||||||
|
<Compile Include="Exceptions\TwitchAccessTokenNotValidException.cs" />
|
||||||
|
<Compile Include="Interfaces\IAStream.cs" />
|
||||||
|
<Compile Include="Interfaces\IPlaylistService.cs" />
|
||||||
|
<Compile Include="Interfaces\IVideoService.cs" />
|
||||||
|
<Compile Include="Interfaces\IVStream.cs" />
|
||||||
|
<Compile Include="Objects\Stream.cs" />
|
||||||
|
<Compile Include="Services\Config.cs" />
|
||||||
|
<Compile Include="Services\MediaProcessor.cs" />
|
||||||
|
<Compile Include="Services\Sources\Twitch\Auth.cs" />
|
||||||
|
<Compile Include="Services\Sources\Twitch\Channel.cs" />
|
||||||
|
<Compile Include="Services\Sources\Twitch\Clip.cs" />
|
||||||
|
<Compile Include="Services\Sources\Twitch\Vod.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
|
||||||
|
<Version>6.2.13</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Newtonsoft.Json">
|
||||||
|
<Version>13.0.1</Version>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="System.ValueTuple">
|
||||||
|
<Version>4.5.0</Version>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Properties\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||||
|
<VisualStudioVersion>14.0</VisualStudioVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.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>
|
||||||
@@ -10,18 +10,25 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||||||
.editorconfig = .editorconfig
|
.editorconfig = .editorconfig
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VDownload.Core", "VDownload.Core\VDownload.Core.csproj", "{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Debug|ARM = Debug|ARM
|
Debug|ARM = Debug|ARM
|
||||||
Debug|ARM64 = Debug|ARM64
|
Debug|ARM64 = Debug|ARM64
|
||||||
Debug|x64 = Debug|x64
|
Debug|x64 = Debug|x64
|
||||||
Debug|x86 = Debug|x86
|
Debug|x86 = Debug|x86
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
Release|ARM = Release|ARM
|
Release|ARM = Release|ARM
|
||||||
Release|ARM64 = Release|ARM64
|
Release|ARM64 = Release|ARM64
|
||||||
Release|x64 = Release|x64
|
Release|x64 = Release|x64
|
||||||
Release|x86 = Release|x86
|
Release|x86 = Release|x86
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||||
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|ARM.ActiveCfg = Debug|ARM
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|ARM.Build.0 = Debug|ARM
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|ARM.Deploy.0 = Debug|ARM
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||||
@@ -34,6 +41,9 @@ Global
|
|||||||
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|x86.ActiveCfg = Debug|x86
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|x86.Build.0 = Debug|x86
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|x86.Build.0 = Debug|x86
|
||||||
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|x86.Deploy.0 = Debug|x86
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|x86.Deploy.0 = Debug|x86
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||||
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|ARM.ActiveCfg = Release|ARM
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|ARM.Build.0 = Release|ARM
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|ARM.Build.0 = Release|ARM
|
||||||
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|ARM.Deploy.0 = Release|ARM
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|ARM.Deploy.0 = Release|ARM
|
||||||
@@ -46,6 +56,26 @@ Global
|
|||||||
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|x86.ActiveCfg = Release|x86
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|x86.ActiveCfg = Release|x86
|
||||||
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|x86.Build.0 = Release|x86
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|x86.Build.0 = Release|x86
|
||||||
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|x86.Deploy.0 = Release|x86
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|x86.Deploy.0 = Release|x86
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Release|ARM64.Build.0 = Release|ARM64
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Release|x64.Build.0 = Release|x64
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{65C44D96-9C6C-47AD-A1F5-86BFAF2B15B8}.Release|x86.Build.0 = Release|x86
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@@ -25,30 +25,16 @@ namespace VDownload
|
|||||||
|
|
||||||
protected override async void OnLaunched(LaunchActivatedEventArgs e)
|
protected override async void OnLaunched(LaunchActivatedEventArgs e)
|
||||||
{
|
{
|
||||||
Log.AddHeader("APP LAUNCHED");
|
|
||||||
Log.Break();
|
|
||||||
|
|
||||||
// Rebuild configuration file
|
// Rebuild configuration file
|
||||||
Log.AddHeader("REBUILDING CONFIGURATION FILE");
|
|
||||||
|
|
||||||
Config.Rebuild();
|
Config.Rebuild();
|
||||||
|
|
||||||
Log.Add("Configuration file rebuilded successfully");
|
|
||||||
Log.Break();
|
|
||||||
|
|
||||||
|
|
||||||
// Delete temp on start
|
// Delete temp on start
|
||||||
// TODO
|
|
||||||
Debug.WriteLine(Config.GetValue("delete_temp_on_start"));
|
|
||||||
if ((bool)Config.GetValue("delete_temp_on_start"))
|
if ((bool)Config.GetValue("delete_temp_on_start"))
|
||||||
{
|
{
|
||||||
Log.AddHeader("DELETING TEMPORARY FILES");
|
|
||||||
IReadOnlyList<IStorageItem> tempItems = await ApplicationData.Current.TemporaryFolder.GetItemsAsync();
|
IReadOnlyList<IStorageItem> tempItems = await ApplicationData.Current.TemporaryFolder.GetItemsAsync();
|
||||||
List<Task> tasks = new List<Task>();
|
List<Task> tasks = new List<Task>();
|
||||||
foreach (IStorageItem item in tempItems) tasks.Add(item.DeleteAsync().AsTask());
|
foreach (IStorageItem item in tempItems) tasks.Add(item.DeleteAsync().AsTask());
|
||||||
await Task.WhenAll(tasks);
|
await Task.WhenAll(tasks);
|
||||||
Log.Add("Temporary files deleted successfully");
|
|
||||||
Log.Break();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do not repeat app initialization when the Window already has content,
|
// Do not repeat app initialization when the Window already has content,
|
||||||
@@ -70,7 +56,7 @@ namespace VDownload
|
|||||||
// When the navigation stack isn't restored navigate to the first page,
|
// When the navigation stack isn't restored navigate to the first page,
|
||||||
// configuring the new page by passing required information as a navigation
|
// configuring the new page by passing required information as a navigation
|
||||||
// parameter
|
// parameter
|
||||||
rootFrame.Navigate(typeof(GUI.Views.MainPage), e.Arguments);
|
rootFrame.Navigate(typeof(Views.MainPage), e.Arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure the current window is active
|
// Ensure the current window is active
|
||||||
|
|||||||
BIN
VDownload/Assets/Icons/MainPage/About.png
Normal file
BIN
VDownload/Assets/Icons/MainPage/About.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
@@ -1,13 +1,15 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
x:Class="VDownload.GUI.Controls.SettingControl"
|
x:Class="VDownload.Controls.SettingControl"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="using:VDownload.GUI.Controls"
|
xmlns:local="using:VDownload.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="300"
|
d:DesignHeight="300"
|
||||||
d:DesignWidth="400">
|
d:DesignWidth="400">
|
||||||
|
|
||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.ThemeDictionaries>
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
@@ -15,11 +17,13 @@
|
|||||||
<SolidColorBrush x:Key="SettingControlBackgroundColor" Color="#2B2B2B"/>
|
<SolidColorBrush x:Key="SettingControlBackgroundColor" Color="#2B2B2B"/>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
<ResourceDictionary x:Key="Light">
|
<ResourceDictionary x:Key="Light">
|
||||||
<SolidColorBrush x:Key="SettingControlBackgroundColor" Color="#F5F5F5"/>
|
<SolidColorBrush x:Key="SettingControlBackgroundColor" Color="#FBFBFB"/>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</ResourceDictionary.ThemeDictionaries>
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
|
|
||||||
<Grid Padding="18" CornerRadius="{ThemeResource ControlCornerRadius}" Background="{ThemeResource SettingControlBackgroundColor}">
|
<Grid Padding="18" CornerRadius="{ThemeResource ControlCornerRadius}" Background="{ThemeResource SettingControlBackgroundColor}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
@@ -28,21 +32,21 @@
|
|||||||
<ColumnDefinition Width="18"/>
|
<ColumnDefinition Width="18"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<!-- ICON -->
|
<!-- ICON -->
|
||||||
<ContentPresenter VerticalAlignment="Center" Grid.Column="0" Width="20" Content="{x:Bind Icon, Mode=OneWay}"/>
|
<ContentPresenter Grid.Column="0" VerticalAlignment="Center" Width="20" Content="{x:Bind Icon, Mode=OneWay}"/>
|
||||||
|
|
||||||
<!-- TITLE & DECRIPTION -->
|
<!-- TITLE & DESCRIPTION -->
|
||||||
<Grid Grid.Column="2" VerticalAlignment="Center">
|
<Grid Grid.Column="2" VerticalAlignment="Center">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock Grid.Row="0" Text="{x:Bind Title, Mode=OneWay}"/>
|
<TextBlock Grid.Row="0" Text="{x:Bind Title, Mode=OneWay}"/>
|
||||||
<TextBlock Grid.Row="1" FontSize="12" Foreground="{x:Bind DescriptionColor, Mode=OneWay}" TextWrapping="Wrap" Text="{x:Bind Description, Mode=OneWay}"/>
|
<TextBlock Grid.Row="1" FontSize="12" Foreground="{ThemeResource SystemBaseMediumColor}" TextWrapping="Wrap" Text="{x:Bind Description, Mode=OneWay}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- CUSTOM CONTENT -->
|
<!-- SETTING CONTROL -->
|
||||||
<ContentPresenter Grid.Column="4" VerticalAlignment="Center" Content="{x:Bind SettingContent, Mode=OneWay}"/>
|
<ContentPresenter Grid.Column="4" VerticalAlignment="Center" Content="{x:Bind SettingContent, Mode=OneWay}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,34 +1,24 @@
|
|||||||
using System;
|
using Windows.UI;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices.WindowsRuntime;
|
|
||||||
using Windows.Foundation;
|
|
||||||
using Windows.Foundation.Collections;
|
|
||||||
using Windows.UI;
|
|
||||||
using Windows.UI.Xaml;
|
using Windows.UI.Xaml;
|
||||||
using Windows.UI.Xaml.Automation;
|
|
||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
using Windows.UI.Xaml.Controls.Primitives;
|
|
||||||
using Windows.UI.Xaml.Data;
|
|
||||||
using Windows.UI.Xaml.Input;
|
|
||||||
using Windows.UI.Xaml.Media;
|
using Windows.UI.Xaml.Media;
|
||||||
using Windows.UI.Xaml.Navigation;
|
|
||||||
|
|
||||||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
namespace VDownload.Controls
|
||||||
|
|
||||||
namespace VDownload.GUI.Controls
|
|
||||||
{
|
{
|
||||||
public sealed partial class SettingControl : UserControl
|
public sealed partial class SettingControl : UserControl
|
||||||
{
|
{
|
||||||
// INIT
|
#region CONSTRUCTORS
|
||||||
|
|
||||||
public SettingControl()
|
public SettingControl()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
// SETTING CONTENT
|
#endregion
|
||||||
public FrameworkElement SettingContent { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
// ICON
|
// ICON
|
||||||
public static readonly DependencyProperty IconProperty = DependencyProperty.Register("Icon", typeof(IconElement), typeof(SettingControl), new PropertyMetadata(null));
|
public static readonly DependencyProperty IconProperty = DependencyProperty.Register("Icon", typeof(IconElement), typeof(SettingControl), new PropertyMetadata(null));
|
||||||
@@ -54,12 +44,9 @@ namespace VDownload.GUI.Controls
|
|||||||
set => SetValue(DescriptionProperty, value);
|
set => SetValue(DescriptionProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// DESCRIPTION COLOR
|
// SETTING CONTENT
|
||||||
public static readonly DependencyProperty DescriptionColorProperty = DependencyProperty.Register("DescriptionColor", typeof(Brush), typeof(SettingControl), new PropertyMetadata(new SolidColorBrush((Color)Application.Current.Resources["SystemBaseMediumColor"])));
|
public FrameworkElement SettingContent { get; set; }
|
||||||
public Brush DescriptionColor
|
|
||||||
{
|
#endregion
|
||||||
get => (Brush)GetValue(DescriptionColorProperty);
|
|
||||||
set => SetValue(DescriptionColorProperty, value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
namespace VDownload.Core.Enums
|
|
||||||
{
|
|
||||||
public enum LogMessageType
|
|
||||||
{
|
|
||||||
Header,
|
|
||||||
Normal,
|
|
||||||
Break,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace VDownload.Core.Globals
|
|
||||||
{
|
|
||||||
public static class Assets
|
|
||||||
{
|
|
||||||
public static readonly Uri UnknownThumbnailImage = new Uri("ms-appx:///Assets/Other/UnknownThumbnail.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using VDownload.Core.Enums;
|
|
||||||
|
|
||||||
namespace VDownload.Core.Services
|
|
||||||
{
|
|
||||||
public class Log
|
|
||||||
{
|
|
||||||
private static List<(DateTime? Time, string Message, LogMessageType MessageType)> MessageList = new List<(DateTime? Time, string Message, LogMessageType MessageType)>();
|
|
||||||
|
|
||||||
public static void AddHeader(string message)
|
|
||||||
{
|
|
||||||
MessageList.Add((DateTime.Now, message, LogMessageType.Header));
|
|
||||||
Debug.WriteLine(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Add(string message)
|
|
||||||
{
|
|
||||||
MessageList.Add((DateTime.Now, message, LogMessageType.Normal));
|
|
||||||
Debug.WriteLine(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Break()
|
|
||||||
{
|
|
||||||
MessageList.Add((null, string.Empty, LogMessageType.Break));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void Clear()
|
|
||||||
{
|
|
||||||
MessageList.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<UserControl
|
|
||||||
x:Class="VDownload.GUI.Controls.MainPageLayoutControl"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:local="using:VDownload.GUI.Controls"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="300"
|
|
||||||
d:DesignWidth="400">
|
|
||||||
|
|
||||||
<Grid Padding="20">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="20"/>
|
|
||||||
<RowDefinition/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Grid.Row="0" FontSize="28" FontWeight="SemiBold" Text="{x:Bind Title, Mode=OneWay}"/>
|
|
||||||
<ContentPresenter Grid.Row="2" Content="{x:Bind PageContent, Mode=OneWay}"/>
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices.WindowsRuntime;
|
|
||||||
using Windows.Foundation;
|
|
||||||
using Windows.Foundation.Collections;
|
|
||||||
using Windows.UI.Xaml;
|
|
||||||
using Windows.UI.Xaml.Controls;
|
|
||||||
using Windows.UI.Xaml.Controls.Primitives;
|
|
||||||
using Windows.UI.Xaml.Data;
|
|
||||||
using Windows.UI.Xaml.Input;
|
|
||||||
using Windows.UI.Xaml.Media;
|
|
||||||
using Windows.UI.Xaml.Navigation;
|
|
||||||
|
|
||||||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
|
||||||
|
|
||||||
namespace VDownload.GUI.Controls
|
|
||||||
{
|
|
||||||
public sealed partial class MainPageLayoutControl : UserControl
|
|
||||||
{
|
|
||||||
// INIT
|
|
||||||
public MainPageLayoutControl()
|
|
||||||
{
|
|
||||||
this.InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
// PAGE CONTENT
|
|
||||||
public FrameworkElement PageContent { get; set; }
|
|
||||||
|
|
||||||
// TITLE
|
|
||||||
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register("Title", typeof(string), typeof(MainPageLayoutControl), new PropertyMetadata(string.Empty));
|
|
||||||
public string Title
|
|
||||||
{
|
|
||||||
get => (string)GetValue(TitleProperty);
|
|
||||||
set => SetValue(TitleProperty, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices.WindowsRuntime;
|
|
||||||
using VDownload.Core.Enums;
|
|
||||||
using VDownload.Core.Interfaces;
|
|
||||||
using Windows.Foundation;
|
|
||||||
using Windows.Foundation.Collections;
|
|
||||||
using Windows.Storage;
|
|
||||||
using Windows.UI.Xaml;
|
|
||||||
using Windows.UI.Xaml.Controls;
|
|
||||||
using Windows.UI.Xaml.Controls.Primitives;
|
|
||||||
using Windows.UI.Xaml.Data;
|
|
||||||
using Windows.UI.Xaml.Input;
|
|
||||||
using Windows.UI.Xaml.Media;
|
|
||||||
using Windows.UI.Xaml.Navigation;
|
|
||||||
|
|
||||||
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
|
||||||
|
|
||||||
namespace VDownload.GUI.Views.Home
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
|
||||||
/// </summary>
|
|
||||||
public sealed partial class HomeMain : Page
|
|
||||||
{
|
|
||||||
public HomeMain()
|
|
||||||
{
|
|
||||||
this.InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void Button_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
IPlaylistService videoServices = new Core.Services.Sources.Twitch.Channel("jacexdowozwideo");
|
|
||||||
await videoServices.GetMetadataAsync();
|
|
||||||
Stopwatch sw = Stopwatch.StartNew();
|
|
||||||
await videoServices.GetVideosAsync(500);
|
|
||||||
sw.Stop();
|
|
||||||
Debug.WriteLine(((Core.Services.Sources.Twitch.Channel)videoServices).Videos.Length);
|
|
||||||
Debug.WriteLine(sw.Elapsed.TotalSeconds);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
<Page
|
|
||||||
x:Class="VDownload.GUI.Views.Sources.SourcesMain"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:local="using:VDownload.GUI.Views.Sources"
|
|
||||||
xmlns:cc="using:VDownload.GUI.Controls"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
|
||||||
|
|
||||||
<cc:MainPageLayoutControl x:Uid="SourcesMainPage" Title="Sources">
|
|
||||||
<cc:MainPageLayoutControl.PageContent>
|
|
||||||
<Grid RowSpacing="10">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<cc:SettingControl x:Name="SourcesMainTwitchSettingControl" x:Uid="SourcesMainTwitchSettingControl" Grid.Row="0" Title="Twitch">
|
|
||||||
<cc:SettingControl.Icon>
|
|
||||||
<BitmapIcon UriSource="ms-appx:///Assets/Icons/Sources/Twitch.png" ShowAsMonochrome="False"/>
|
|
||||||
</cc:SettingControl.Icon>
|
|
||||||
<cc:SettingControl.SettingContent>
|
|
||||||
<Button x:Name="SourcesMainTwitchLoginButton" Click="SourcesMainTwitchLoginButton_Click"/>
|
|
||||||
</cc:SettingControl.SettingContent>
|
|
||||||
</cc:SettingControl>
|
|
||||||
</Grid>
|
|
||||||
</cc:MainPageLayoutControl.PageContent>
|
|
||||||
</cc:MainPageLayoutControl>
|
|
||||||
</Page>
|
|
||||||
@@ -117,6 +117,58 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<data name="HomeOptionsBarAddPlaylistButton.Label" xml:space="preserve">
|
||||||
|
<value>Add playlist</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarAddPlaylistButton.Width" xml:space="preserve">
|
||||||
|
<value>85</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarAddPlaylistControlInfoBox.Subtitle" xml:space="preserve">
|
||||||
|
<value>- Twitch (Channel)
|
||||||
|
|
||||||
|
Number of videos got from playlist
|
||||||
|
The number in the numberbox indicades how many videos will be got from playlist. 0 = all.
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarAddPlaylistControlInfoBox.Title" xml:space="preserve">
|
||||||
|
<value>Supported sources</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarAddPlaylistControlSearchButton.Content" xml:space="preserve">
|
||||||
|
<value>Search</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarAddPlaylistControlUrlTextBox.PlaceholderText" xml:space="preserve">
|
||||||
|
<value>Playlist URL</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarAddVideoButton.Label" xml:space="preserve">
|
||||||
|
<value>Add video</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarAddVideoButton.Width" xml:space="preserve">
|
||||||
|
<value>75</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarAddVideoControlInfoBox.Subtitle" xml:space="preserve">
|
||||||
|
<value>- Twitch (VODs, Clips)</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarAddVideoControlInfoBox.Title" xml:space="preserve">
|
||||||
|
<value>Supported sources</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarAddVideoControlSearchButton.Content" xml:space="preserve">
|
||||||
|
<value>Search</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarAddVideoControlUrlTextBox.PlaceholderText" xml:space="preserve">
|
||||||
|
<value>Video URL</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarDownloadAllButton.Label" xml:space="preserve">
|
||||||
|
<value>Download all</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarDownloadAllButton.Width" xml:space="preserve">
|
||||||
|
<value>90</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarLoadSubscripionsButton.Label" xml:space="preserve">
|
||||||
|
<value>Load subscription</value>
|
||||||
|
</data>
|
||||||
|
<data name="HomeOptionsBarLoadSubscripionsButton.Width" xml:space="preserve">
|
||||||
|
<value>120</value>
|
||||||
|
</data>
|
||||||
<data name="MainPageNavigationPanelHomeItem.Content" xml:space="preserve">
|
<data name="MainPageNavigationPanelHomeItem.Content" xml:space="preserve">
|
||||||
<value>Home</value>
|
<value>Home</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -126,34 +178,34 @@
|
|||||||
<data name="MainPageNavigationPanelSubscriptionsItem.Content" xml:space="preserve">
|
<data name="MainPageNavigationPanelSubscriptionsItem.Content" xml:space="preserve">
|
||||||
<value>Subscriptions</value>
|
<value>Subscriptions</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SourcesMainPage.Title" xml:space="preserve">
|
<data name="SourcesMainPageHeaderText.Text" xml:space="preserve">
|
||||||
<value>Sources</value>
|
<value>Sources</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SourcesMainTwitchLoginButtonTextLoading" xml:space="preserve">
|
<data name="SourcesTwitchLoginButton.Content" xml:space="preserve">
|
||||||
<value>Loading...</value>
|
<value>Loading...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SourcesMainTwitchLoginButtonTextLoggedIn" xml:space="preserve">
|
<data name="SourcesTwitchLoginButtonTextLoggedIn" xml:space="preserve">
|
||||||
<value>Log out</value>
|
<value>Log out</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SourcesMainTwitchLoginButtonTextNotLoggedIn" xml:space="preserve">
|
<data name="SourcesTwitchLoginButtonTextNotLoggedIn" xml:space="preserve">
|
||||||
<value>Sign in</value>
|
<value>Sign in</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SourcesMainTwitchLoginErrorDialogDescriptionUnknown" xml:space="preserve">
|
<data name="SourcesTwitchLoginErrorDialogDescriptionUnknown" xml:space="preserve">
|
||||||
<value>Unknown error</value>
|
<value>Unknown error</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SourcesMainTwitchLoginErrorDialogTitle" xml:space="preserve">
|
<data name="SourcesTwitchLoginErrorDialogTitle" xml:space="preserve">
|
||||||
<value>Login to Twitch failed</value>
|
<value>Login to Twitch failed</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SourcesMainTwitchSettingControl.Title" xml:space="preserve">
|
<data name="SourcesTwitchSettingControl.Description" xml:space="preserve">
|
||||||
<value>Twitch</value>
|
|
||||||
</data>
|
|
||||||
<data name="SourcesMainTwitchSettingControlDescriptionLoading" xml:space="preserve">
|
|
||||||
<value>Loading...</value>
|
<value>Loading...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SourcesMainTwitchSettingControlDescriptionLoggedIn" xml:space="preserve">
|
<data name="SourcesTwitchSettingControl.Title" xml:space="preserve">
|
||||||
|
<value>Twitch</value>
|
||||||
|
</data>
|
||||||
|
<data name="SourcesTwitchSettingControlDescriptionLoggedIn" xml:space="preserve">
|
||||||
<value>Logged in as</value>
|
<value>Logged in as</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SourcesMainTwitchSettingControlDescriptionNotLoggedIn" xml:space="preserve">
|
<data name="SourcesTwitchSettingControlDescriptionNotLoggedIn" xml:space="preserve">
|
||||||
<value>Not logged in. Twitch authentication is required to download videos.</value>
|
<value>Not logged in. Twitch authentication is required to download videos.</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<AssemblyName>VDownload</AssemblyName>
|
<AssemblyName>VDownload</AssemblyName>
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||||
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.19041.0</TargetPlatformVersion>
|
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.22000.0</TargetPlatformVersion>
|
||||||
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
|
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
|
||||||
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
@@ -119,47 +119,31 @@
|
|||||||
<Compile Include="App.xaml.cs">
|
<Compile Include="App.xaml.cs">
|
||||||
<DependentUpon>App.xaml</DependentUpon>
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Core\Enums\AudioFileExtension.cs" />
|
<Compile Include="Views\About\AboutMain.xaml.cs">
|
||||||
<Compile Include="Core\Enums\LogMessageType.cs" />
|
<DependentUpon>AboutMain.xaml</DependentUpon>
|
||||||
<Compile Include="Core\Enums\MediaFileExtension.cs" />
|
|
||||||
<Compile Include="Core\Enums\MediaType.cs" />
|
|
||||||
<Compile Include="Core\Enums\StreamType.cs" />
|
|
||||||
<Compile Include="Core\Enums\VideoFileExtension.cs" />
|
|
||||||
<Compile Include="Core\Exceptions\TwitchAccessTokenNotFoundException.cs" />
|
|
||||||
<Compile Include="Core\Exceptions\TwitchAccessTokenNotValidException.cs" />
|
|
||||||
<Compile Include="Core\Globals\Assets.cs" />
|
|
||||||
<Compile Include="Core\Interfaces\IAStream.cs" />
|
|
||||||
<Compile Include="Core\Interfaces\IPlaylistService.cs" />
|
|
||||||
<Compile Include="Core\Interfaces\IVideoService.cs" />
|
|
||||||
<Compile Include="Core\Interfaces\IVStream.cs" />
|
|
||||||
<Compile Include="Core\Models\Stream.cs" />
|
|
||||||
<Compile Include="Core\Services\Config.cs" />
|
|
||||||
<Compile Include="Core\Services\Log.cs" />
|
|
||||||
<Compile Include="Core\Services\MediaProcessor.cs" />
|
|
||||||
<Compile Include="Core\Services\Sources\Twitch\Auth.cs" />
|
|
||||||
<Compile Include="Core\Services\Sources\Twitch\Channel.cs" />
|
|
||||||
<Compile Include="Core\Services\Sources\Twitch\Clip.cs" />
|
|
||||||
<Compile Include="Core\Services\Sources\Twitch\Vod.cs" />
|
|
||||||
<Compile Include="GUI\Controls\MainPageLayoutControl.xaml.cs">
|
|
||||||
<DependentUpon>MainPageLayoutControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="GUI\Controls\SettingControl.xaml.cs">
|
<Compile Include="Views\Home\HomeOptionsBarAddPlaylistControl.xaml.cs">
|
||||||
|
<DependentUpon>HomeOptionsBarAddPlaylistControl.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Views\Home\HomeOptionsBarAddVideoControl.xaml.cs">
|
||||||
|
<DependentUpon>HomeOptionsBarAddVideoControl.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Controls\SettingControl.xaml.cs">
|
||||||
<DependentUpon>SettingControl.xaml</DependentUpon>
|
<DependentUpon>SettingControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="GUI\Views\Home\HomeMain.xaml.cs">
|
<Compile Include="Views\Home\HomeMain.xaml.cs">
|
||||||
<DependentUpon>HomeMain.xaml</DependentUpon>
|
<DependentUpon>HomeMain.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="GUI\Views\MainPage.xaml.cs">
|
<Compile Include="Views\MainPage.xaml.cs">
|
||||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Views\Sources\SourcesMain.xaml.cs">
|
||||||
<Compile Include="GUI\Views\Sources\SourcesMain.xaml.cs">
|
|
||||||
<DependentUpon>SourcesMain.xaml</DependentUpon>
|
<DependentUpon>SourcesMain.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="GUI\Views\Settings\SettingsMain.xaml.cs">
|
<Compile Include="Views\Settings\SettingsMain.xaml.cs">
|
||||||
<DependentUpon>SettingsMain.xaml</DependentUpon>
|
<DependentUpon>SettingsMain.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="GUI\Views\Subscriptions\SubscriptionsMain.xaml.cs">
|
<Compile Include="Views\Subscriptions\SubscriptionsMain.xaml.cs">
|
||||||
<DependentUpon>SubscriptionsMain.xaml</DependentUpon>
|
<DependentUpon>SubscriptionsMain.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@@ -172,6 +156,7 @@
|
|||||||
<Content Include="Assets\Icons\Add\NotFound.png" />
|
<Content Include="Assets\Icons\Add\NotFound.png" />
|
||||||
<Content Include="Assets\Icons\Add\Start.png" />
|
<Content Include="Assets\Icons\Add\Start.png" />
|
||||||
<Content Include="Assets\Icons\Error.png" />
|
<Content Include="Assets\Icons\Error.png" />
|
||||||
|
<Content Include="Assets\Icons\MainPage\About.png" />
|
||||||
<Content Include="Assets\Icons\MainPage\Sources.png" />
|
<Content Include="Assets\Icons\MainPage\Sources.png" />
|
||||||
<Content Include="Assets\Icons\Sources\Twitch.png" />
|
<Content Include="Assets\Icons\Sources\Twitch.png" />
|
||||||
<Content Include="Assets\Icons\Sources\Unknown.png" />
|
<Content Include="Assets\Icons\Sources\Unknown.png" />
|
||||||
@@ -260,38 +245,45 @@
|
|||||||
<Content Include="Assets\Logo\Wide310x150Logo.scale-200.png" />
|
<Content Include="Assets\Logo\Wide310x150Logo.scale-200.png" />
|
||||||
<Content Include="Assets\Logo\Wide310x150Logo.scale-400.png" />
|
<Content Include="Assets\Logo\Wide310x150Logo.scale-400.png" />
|
||||||
<Content Include="Assets\Other\UnknownThumbnail.png" />
|
<Content Include="Assets\Other\UnknownThumbnail.png" />
|
||||||
<Content Include="Properties\Default.rd.xml" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ApplicationDefinition Include="App.xaml">
|
<ApplicationDefinition Include="App.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Page Include="GUI\Controls\MainPageLayoutControl.xaml">
|
<Page Include="Views\About\AboutMain.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="GUI\Controls\SettingControl.xaml">
|
<Page Include="Views\Home\HomeOptionsBarAddPlaylistControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="GUI\Views\Home\HomeMain.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="GUI\Views\MainPage.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="GUI\Views\Sources\SourcesMain.xaml">
|
<Page Include="Views\Home\HomeOptionsBarAddVideoControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="GUI\Views\Settings\SettingsMain.xaml">
|
<Page Include="Controls\SettingControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="GUI\Views\Subscriptions\SubscriptionsMain.xaml">
|
<Page Include="Views\Home\HomeMain.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Views\MainPage.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Views\Sources\SourcesMain.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Views\Settings\SettingsMain.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Views\Subscriptions\SubscriptionsMain.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
@@ -306,20 +298,28 @@
|
|||||||
<PackageReference Include="Microsoft.UI.Xaml">
|
<PackageReference Include="Microsoft.UI.Xaml">
|
||||||
<Version>2.8.0-prerelease.220118001</Version>
|
<Version>2.8.0-prerelease.220118001</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Newtonsoft.Json">
|
|
||||||
<Version>13.0.1</Version>
|
|
||||||
</PackageReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PRIResource Include="Strings\en-US\ResourcesOld.resw" />
|
<PRIResource Include="Strings\en-US\ResourcesOld.resw" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PRIResource Include="Strings\en-US\Resources.resw" />
|
<PRIResource Include="Strings\en-US\Resources.resw" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\VDownload.Core\VDownload.Core.csproj">
|
||||||
|
<Project>{65c44d96-9c6c-47ad-a1f5-86bfaf2b15b8}</Project>
|
||||||
|
<Name>VDownload.Core</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Properties\" />
|
||||||
|
</ItemGroup>
|
||||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||||
<VisualStudioVersion>14.0</VisualStudioVersion>
|
<VisualStudioVersion>14.0</VisualStudioVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||||
|
<OutputPath>..\..\..\..\..\bin\Debug\</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- 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.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
<Page
|
<Page
|
||||||
x:Class="VDownload.GUI.Views.Home.HomeMain"
|
x:Class="VDownload.Views.About.AboutMain"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="using:VDownload.GUI.Views.Home"
|
xmlns:local="using:VDownload.Views.About"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Button Content="aaaaa" Click="Button_Click"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Page>
|
</Page>
|
||||||
30
VDownload/Views/About/AboutMain.xaml.cs
Normal file
30
VDownload/Views/About/AboutMain.xaml.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
using Windows.UI.Xaml;
|
||||||
|
using Windows.UI.Xaml.Controls;
|
||||||
|
using Windows.UI.Xaml.Controls.Primitives;
|
||||||
|
using Windows.UI.Xaml.Data;
|
||||||
|
using Windows.UI.Xaml.Input;
|
||||||
|
using Windows.UI.Xaml.Media;
|
||||||
|
using Windows.UI.Xaml.Navigation;
|
||||||
|
|
||||||
|
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
||||||
|
|
||||||
|
namespace VDownload.Views.About
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||||
|
/// </summary>
|
||||||
|
public sealed partial class AboutMain : Page
|
||||||
|
{
|
||||||
|
public AboutMain()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
92
VDownload/Views/Home/HomeMain.xaml
Normal file
92
VDownload/Views/Home/HomeMain.xaml
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
<Page
|
||||||
|
x:Class="VDownload.Views.Home.HomeMain"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="using:VDownload.Views.Home"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||||
|
xmlns:cc="using:VDownload.Controls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Background="Transparent">
|
||||||
|
|
||||||
|
|
||||||
|
<Page.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
|
<ResourceDictionary x:Key="Dark">
|
||||||
|
<SolidColorBrush x:Key="HomeMainOptionBarBackgroundColor" Color="#202020"/>
|
||||||
|
</ResourceDictionary>
|
||||||
|
<ResourceDictionary x:Key="Light">
|
||||||
|
<SolidColorBrush x:Key="HomeMainOptionBarBackgroundColor" Color="#F5F5F5"/>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</Page.Resources>
|
||||||
|
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<VisualStateManager.VisualStateGroups>
|
||||||
|
<VisualStateGroup>
|
||||||
|
<VisualState x:Name="Compact">
|
||||||
|
<VisualState.StateTriggers>
|
||||||
|
<AdaptiveTrigger MinWindowWidth="0"/>
|
||||||
|
</VisualState.StateTriggers>
|
||||||
|
<VisualState.Setters>
|
||||||
|
<Setter Target="HomeOptionBarButtonsStackPanel.(Grid.ColumnSpan)" Value="3"/>
|
||||||
|
<Setter Target="HomeOptionBarButtonsStackPanel.(Grid.Column)" Value="0"/>
|
||||||
|
<Setter Target="HomeOptionsBarAddingControl.(Grid.Row)" Value="0"/>
|
||||||
|
<Setter Target="HomeOptionsBarAddingControl.(Grid.ColumnSpan)" Value="3"/>
|
||||||
|
</VisualState.Setters>
|
||||||
|
</VisualState>
|
||||||
|
<VisualState x:Name="Normal">
|
||||||
|
<VisualState.StateTriggers>
|
||||||
|
<AdaptiveTrigger x:Name="HomeNormalStateAdaptiveTrigger" MinWindowWidth="800"/>
|
||||||
|
</VisualState.StateTriggers>
|
||||||
|
<VisualState.Setters>
|
||||||
|
<Setter Target="HomeOptionBarButtonsStackPanel.(Grid.ColumnSpan)" Value="1"/>
|
||||||
|
<Setter Target="HomeOptionBarButtonsStackPanel.(Grid.Column)" Value="2"/>
|
||||||
|
<Setter Target="HomeOptionsBarAddingControl.(Grid.Row)" Value="1"/>
|
||||||
|
<Setter Target="HomeOptionsBarAddingControl.(Grid.ColumnSpan)" Value="1"/>
|
||||||
|
</VisualState.Setters>
|
||||||
|
</VisualState>
|
||||||
|
</VisualStateGroup>
|
||||||
|
</VisualStateManager.VisualStateGroups>
|
||||||
|
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!-- VIDEOS LIST -->
|
||||||
|
<StackPanel/>
|
||||||
|
|
||||||
|
<!-- OPTIONS BAR AND ADDING PANEL -->
|
||||||
|
<Grid Grid.Row="1" CornerRadius="{ThemeResource ControlCornerRadius}" Background="{ThemeResource HomeMainOptionBarBackgroundColor}">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid x:Name="HomeOptionsBar" Grid.Row="1"> <!-- Options Bar -->
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
<ColumnDefinition Width="50"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<ContentPresenter x:Name="HomeOptionsBarAddingControl" Grid.Row="1" Grid.Column="0"/>
|
||||||
|
<StackPanel x:Name="HomeOptionBarButtonsStackPanel" Grid.Row="1" Grid.Column="2" Margin="3,0,3,0" HorizontalAlignment="Center" Orientation="Horizontal">
|
||||||
|
<AppBarButton x:Name="HomeOptionsBarLoadSubscripionsButton" x:Uid="HomeOptionsBarLoadSubscripionsButton" Icon="Favorite" Label="Load subscriptions" Width="120"/>
|
||||||
|
<AppBarSeparator VerticalAlignment="Center" Height="50"/>
|
||||||
|
<AppBarToggleButton x:Name="HomeOptionsBarAddPlaylistButton" x:Uid="HomeOptionsBarAddPlaylistButton" Icon="List" Label="Add playlist" Width="85" Checked="HomeOptionsBarAddPlaylistButton_Checked" Unchecked="HomeOptionsBarAddingButtons_Unchecked"/>
|
||||||
|
<AppBarToggleButton x:Name="HomeOptionsBarAddVideoButton" x:Uid="HomeOptionsBarAddVideoButton" Icon="Video" Label="Add video" Width="75" Checked="HomeOptionsBarAddVideoButton_Checked" Unchecked="HomeOptionsBarAddingButtons_Unchecked"/>
|
||||||
|
<AppBarSeparator VerticalAlignment="Center" Height="50"/>
|
||||||
|
<AppBarButton x:Name="HomeOptionsBarDownloadAllButton" x:Uid="HomeOptionsBarDownloadAllButton" Icon="Download" Label="Download All" Width="90"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Page>
|
||||||
69
VDownload/Views/Home/HomeMain.xaml.cs
Normal file
69
VDownload/Views/Home/HomeMain.xaml.cs
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
using System;
|
||||||
|
using VDownload.Core.EventArgsObjects;
|
||||||
|
using Windows.UI.Xaml;
|
||||||
|
using Windows.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
namespace VDownload.Views.Home
|
||||||
|
{
|
||||||
|
public sealed partial class HomeMain : Page
|
||||||
|
{
|
||||||
|
#region CONSTRUCTORS
|
||||||
|
|
||||||
|
public HomeMain()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region BUTTONS EVENTS
|
||||||
|
|
||||||
|
// ADD VIDEO BUTTON CHECKED
|
||||||
|
private void HomeOptionsBarAddVideoButton_Checked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Uncheck playlist button
|
||||||
|
HomeOptionsBarAddPlaylistButton.IsChecked = false;
|
||||||
|
|
||||||
|
// Create video adding control
|
||||||
|
HomeOptionsBarAddVideoControl homeOptionsBarAddVideoControl = new HomeOptionsBarAddVideoControl();
|
||||||
|
homeOptionsBarAddVideoControl.SearchButtonClicked += HomeOptionsBarAddVideoControl_SearchButtonClicked;
|
||||||
|
HomeOptionsBarAddingControl.Content = homeOptionsBarAddVideoControl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ADD VIDEO SEARCH BUTTON CLICKED
|
||||||
|
private void HomeOptionsBarAddVideoControl_SearchButtonClicked(object sender, VideoSearchEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ADD PLAYLIST BUTTON CHECKED
|
||||||
|
private void HomeOptionsBarAddPlaylistButton_Checked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Uncheck video button
|
||||||
|
HomeOptionsBarAddVideoButton.IsChecked = false;
|
||||||
|
|
||||||
|
// Create playlist adding control
|
||||||
|
HomeOptionsBarAddPlaylistControl homeOptionsBarAddPlaylistControl = new HomeOptionsBarAddPlaylistControl();
|
||||||
|
homeOptionsBarAddPlaylistControl.SearchButtonClicked += HomeOptionsBarAddPlaylistControl_SearchButtonClicked;
|
||||||
|
HomeOptionsBarAddingControl.Content = homeOptionsBarAddPlaylistControl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ADD PLAYLIST SEARCH BUTTON CLICKED
|
||||||
|
private void HomeOptionsBarAddPlaylistControl_SearchButtonClicked(object sender, PlaylistSearchEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ADDING BUTTONS UNCHECKED
|
||||||
|
private void HomeOptionsBarAddingButtons_Unchecked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
HomeOptionsBarAddingControl.Content = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
38
VDownload/Views/Home/HomeOptionsBarAddPlaylistControl.xaml
Normal file
38
VDownload/Views/Home/HomeOptionsBarAddPlaylistControl.xaml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="VDownload.Views.Home.HomeOptionsBarAddPlaylistControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="using:VDownload.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="100"
|
||||||
|
d:DesignWidth="400">
|
||||||
|
|
||||||
|
|
||||||
|
<Grid x:Name="HomeOptionsBarAddPlaylistControlGrid" Margin="10" ColumnSpacing="10">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<!-- URL TEXTBOX -->
|
||||||
|
<TextBox x:Name="HomeOptionsBarAddPlaylistControlUrlTextBox" x:Uid="HomeOptionsBarAddPlaylistControlUrlTextBox" Grid.Column="0" VerticalAlignment="Center"/>
|
||||||
|
|
||||||
|
<!-- MAX VIDEOS NUMBERBOX -->
|
||||||
|
<muxc:NumberBox x:Name="HomeOptionsBarAddPlaylistControlMaxVideosNumberBox" Grid.Column="1" VerticalAlignment="Center" SpinButtonPlacementMode="Compact" Minimum="0" Value="{x:Bind DefaultMaxPlaylistVideos}"/>
|
||||||
|
|
||||||
|
<!-- SEARCH BUTTON-->
|
||||||
|
<Button x:Name="HomeOptionsBarAddPlaylistControlSearchButton" x:Uid="HomeOptionsBarAddPlaylistControlSearchButton" Grid.Column="2" Click="HomeOptionsBarAddPlaylistControlSearchButton_Click"/>
|
||||||
|
|
||||||
|
<!-- HELP BUTTON -->
|
||||||
|
<Button x:Name="HomeOptionsBarAddPlaylistControlHelpButton" Grid.Column="3" Content="?" Click="HomeOptionsBarAddPlaylistControlHelpButton_Click">
|
||||||
|
<Button.Resources>
|
||||||
|
<muxc:TeachingTip x:Name="HomeOptionsBarAddPlaylistControlInfoBox" x:Uid="HomeOptionsBarAddPlaylistControlInfoBox" Target="{x:Bind HomeOptionsBarAddPlaylistControlGrid}"/>
|
||||||
|
</Button.Resources>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
using System;
|
||||||
|
using VDownload.Core.EventArgsObjects;
|
||||||
|
using VDownload.Core.Services;
|
||||||
|
using Windows.UI.Xaml;
|
||||||
|
using Windows.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
namespace VDownload.Views.Home
|
||||||
|
{
|
||||||
|
public sealed partial class HomeOptionsBarAddPlaylistControl : UserControl
|
||||||
|
{
|
||||||
|
#region CONSTRUCTORS
|
||||||
|
|
||||||
|
public HomeOptionsBarAddPlaylistControl()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
// MAX VIDEOS NUMBERBOX DEFAULT VALUE
|
||||||
|
public int DefaultMaxPlaylistVideos = (int)Config.GetValue("default_max_playlist_videos");
|
||||||
|
|
||||||
|
// SEARCH BUTTON EVENT HANDLER
|
||||||
|
public event EventHandler<PlaylistSearchEventArgs> SearchButtonClicked;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region EVENT HANDLERS
|
||||||
|
|
||||||
|
// SEARCH BUTTON CLICKED
|
||||||
|
private void HomeOptionsBarAddPlaylistControlSearchButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Close info box
|
||||||
|
HomeOptionsBarAddPlaylistControlInfoBox.IsOpen = false;
|
||||||
|
|
||||||
|
// Invoke search button event handlers
|
||||||
|
PlaylistSearchEventArgs args = new PlaylistSearchEventArgs
|
||||||
|
{
|
||||||
|
Phrase = HomeOptionsBarAddPlaylistControlUrlTextBox.Text,
|
||||||
|
Count = int.Parse(HomeOptionsBarAddPlaylistControlMaxVideosNumberBox.Text),
|
||||||
|
};
|
||||||
|
SearchButtonClicked?.Invoke(this, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
// HELP BUTTON CLICKED
|
||||||
|
private void HomeOptionsBarAddPlaylistControlHelpButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Switch info box
|
||||||
|
HomeOptionsBarAddPlaylistControlInfoBox.IsOpen = !HomeOptionsBarAddPlaylistControlInfoBox.IsOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
34
VDownload/Views/Home/HomeOptionsBarAddVideoControl.xaml
Normal file
34
VDownload/Views/Home/HomeOptionsBarAddVideoControl.xaml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="VDownload.Views.Home.HomeOptionsBarAddVideoControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="using:VDownload.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="100"
|
||||||
|
d:DesignWidth="400">
|
||||||
|
|
||||||
|
|
||||||
|
<Grid x:Name="HomeOptionsBarAddVideoControlGrid" Margin="10" ColumnSpacing="10">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<!-- URL TEXTBOX -->
|
||||||
|
<TextBox x:Name="HomeOptionsBarAddVideoControlUrlTextBox" x:Uid="HomeOptionsBarAddVideoControlUrlTextBox" Grid.Column="0" VerticalAlignment="Center"/>
|
||||||
|
|
||||||
|
<!-- SEARCH BUTTON -->
|
||||||
|
<Button x:Name="HomeOptionsBarAddVideoControlSearchButton" x:Uid="HomeOptionsBarAddVideoControlSearchButton" Grid.Column="1" Click="HomeOptionsBarAddVideoControlSearchButton_Click"/>
|
||||||
|
|
||||||
|
<!-- INFO BUTTON -->
|
||||||
|
<Button x:Name="HomeOptionsBarAddVideoControlHelpButton" x:Uid="HomeOptionsBarAddVideoControlHelpButton" Grid.Column="2" Content="?" Click="HomeOptionsBarAddVideoControlHelpButton_Click">
|
||||||
|
<Button.Resources>
|
||||||
|
<muxc:TeachingTip x:Name="HomeOptionsBarAddVideoControlInfoBox" x:Uid="HomeOptionsBarAddVideoControlInfoBox" Target="{x:Bind HomeOptionsBarAddVideoControlGrid}"/>
|
||||||
|
</Button.Resources>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
55
VDownload/Views/Home/HomeOptionsBarAddVideoControl.xaml.cs
Normal file
55
VDownload/Views/Home/HomeOptionsBarAddVideoControl.xaml.cs
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
using System;
|
||||||
|
using VDownload.Core.EventArgsObjects;
|
||||||
|
using Windows.UI.Xaml;
|
||||||
|
using Windows.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
namespace VDownload.Views.Home
|
||||||
|
{
|
||||||
|
public sealed partial class HomeOptionsBarAddVideoControl : UserControl
|
||||||
|
{
|
||||||
|
#region CONSTRUCTORS
|
||||||
|
|
||||||
|
public HomeOptionsBarAddVideoControl()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
// SEARCH BUTTON EVENT HANDLER
|
||||||
|
public event EventHandler<VideoSearchEventArgs> SearchButtonClicked;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region EVENT HANDLERS
|
||||||
|
|
||||||
|
// SEARCH BUTTON CLICKED
|
||||||
|
private void HomeOptionsBarAddVideoControlSearchButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Close info box
|
||||||
|
HomeOptionsBarAddVideoControlInfoBox.IsOpen = false;
|
||||||
|
|
||||||
|
// Invoke search button event handlers
|
||||||
|
VideoSearchEventArgs args = new VideoSearchEventArgs
|
||||||
|
{
|
||||||
|
Phrase = HomeOptionsBarAddVideoControlUrlTextBox.Text
|
||||||
|
};
|
||||||
|
SearchButtonClicked?.Invoke(this, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
// HELP BUTTON CLICKED
|
||||||
|
private void HomeOptionsBarAddVideoControlHelpButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Switch info box
|
||||||
|
HomeOptionsBarAddVideoControlInfoBox.IsOpen = !HomeOptionsBarAddVideoControlInfoBox.IsOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<Page
|
<Page
|
||||||
x:Class="VDownload.GUI.Views.MainPage"
|
x:Class="VDownload.Views.MainPage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
@@ -7,13 +7,17 @@
|
|||||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
muxc:BackdropMaterial.ApplyToRootOrPageBackground="True">
|
muxc:BackdropMaterial.ApplyToRootOrPageBackground="True">
|
||||||
|
|
||||||
|
|
||||||
<Page.Resources>
|
<Page.Resources>
|
||||||
<Thickness x:Key="NavigationViewContentMargin">0,48,0,0</Thickness>
|
<Thickness x:Key="NavigationViewContentMargin">0,48,0,0</Thickness>
|
||||||
<Thickness x:Key="NavigationViewContentGridBorderThickness">0</Thickness>
|
<Thickness x:Key="NavigationViewContentGridBorderThickness">0</Thickness>
|
||||||
<SolidColorBrush x:Key="NavigationViewContentBackground" Color="Transparent"></SolidColorBrush>
|
<SolidColorBrush x:Key="NavigationViewContentBackground" Color="Transparent"></SolidColorBrush>
|
||||||
</Page.Resources>
|
</Page.Resources>
|
||||||
|
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<!-- PROGRAM NAME -->
|
<!-- TITLE BAR -->
|
||||||
<Border x:Name="AppTitleBar"
|
<Border x:Name="AppTitleBar"
|
||||||
IsHitTestVisible="True"
|
IsHitTestVisible="True"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
@@ -36,7 +40,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- NAVIGATION AND CONTENT -->
|
<!-- NAVIGATION PANEL AND CONTENT -->
|
||||||
<muxc:NavigationView x:Name="MainPageNavigationPanel" Background="Transparent" IsTitleBarAutoPaddingEnabled="False" IsBackButtonVisible="Collapsed" PaneDisplayMode="LeftCompact" Canvas.ZIndex="0" ItemInvoked="MainPageNavigationPanel_ItemInvoked">
|
<muxc:NavigationView x:Name="MainPageNavigationPanel" Background="Transparent" IsTitleBarAutoPaddingEnabled="False" IsBackButtonVisible="Collapsed" PaneDisplayMode="LeftCompact" Canvas.ZIndex="0" ItemInvoked="MainPageNavigationPanel_ItemInvoked">
|
||||||
<muxc:NavigationView.MenuItems>
|
<muxc:NavigationView.MenuItems>
|
||||||
<muxc:NavigationViewItem x:Uid="MainPageNavigationPanelHomeItem" Tag="home" Icon="Video" Content="Home"/>
|
<muxc:NavigationViewItem x:Uid="MainPageNavigationPanelHomeItem" Tag="home" Icon="Video" Content="Home"/>
|
||||||
@@ -44,6 +48,11 @@
|
|||||||
<muxc:NavigationViewItem x:Uid="MainPageNavigationPanelSubscriptionsItem" Tag="subscriptions" Icon="Favorite" Content="Subscriptions"/>
|
<muxc:NavigationViewItem x:Uid="MainPageNavigationPanelSubscriptionsItem" Tag="subscriptions" Icon="Favorite" Content="Subscriptions"/>
|
||||||
</muxc:NavigationView.MenuItems>
|
</muxc:NavigationView.MenuItems>
|
||||||
<muxc:NavigationView.FooterMenuItems>
|
<muxc:NavigationView.FooterMenuItems>
|
||||||
|
<muxc:NavigationViewItem x:Uid="MainPageNavigationPanelAboutItem" Tag="about" Content="About">
|
||||||
|
<muxc:NavigationViewItem.Icon>
|
||||||
|
<BitmapIcon UriSource="ms-appx:///Assets/Icons/MainPage/About.png"/>
|
||||||
|
</muxc:NavigationViewItem.Icon>
|
||||||
|
</muxc:NavigationViewItem>
|
||||||
<muxc:NavigationViewItem x:Uid="MainPageNavigationPanelSourcesItem" Tag="sources" Content="Sources">
|
<muxc:NavigationViewItem x:Uid="MainPageNavigationPanelSourcesItem" Tag="sources" Content="Sources">
|
||||||
<muxc:NavigationViewItem.Icon>
|
<muxc:NavigationViewItem.Icon>
|
||||||
<BitmapIcon UriSource="ms-appx:///Assets/Icons/MainPage/Sources.png"/>
|
<BitmapIcon UriSource="ms-appx:///Assets/Icons/MainPage/Sources.png"/>
|
||||||
@@ -1,28 +1,20 @@
|
|||||||
// Internal
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
// System
|
|
||||||
using System;
|
|
||||||
using Windows.ApplicationModel.Core;
|
using Windows.ApplicationModel.Core;
|
||||||
using Windows.UI;
|
|
||||||
using Windows.UI.ViewManagement;
|
|
||||||
using Windows.UI.Xaml;
|
using Windows.UI.Xaml;
|
||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
using Windows.Foundation;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace VDownload.GUI.Views
|
namespace VDownload.Views
|
||||||
{
|
{
|
||||||
public sealed partial class MainPage : Page
|
public sealed partial class MainPage : Page
|
||||||
{
|
{
|
||||||
#region INIT
|
#region CONSTRUCTORS
|
||||||
|
|
||||||
// CONSTRUCTOR
|
|
||||||
public MainPage()
|
public MainPage()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
this.InitializeComponent();
|
||||||
|
|
||||||
// Hide default title bar.
|
// Hide default title bar.
|
||||||
ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
|
|
||||||
CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
|
CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
|
||||||
coreTitleBar.ExtendViewIntoTitleBar = true;
|
coreTitleBar.ExtendViewIntoTitleBar = true;
|
||||||
Window.Current.SetTitleBar(AppTitleBar);
|
Window.Current.SetTitleBar(AppTitleBar);
|
||||||
@@ -39,12 +31,13 @@ namespace VDownload.GUI.Views
|
|||||||
#region NAVIGATION PANEL
|
#region NAVIGATION PANEL
|
||||||
|
|
||||||
// PAGES DICTIONARY
|
// PAGES DICTIONARY
|
||||||
private Dictionary<string, Type> Pages = new Dictionary<string, Type>()
|
private readonly Dictionary<string, Type> Pages = new Dictionary<string, Type>()
|
||||||
{
|
{
|
||||||
{"home", typeof(Home.HomeMain)},
|
{"home", typeof(Home.HomeMain)},
|
||||||
{"subscriptions", typeof(Subscriptions.SubscriptionsMain)},
|
{"subscriptions", typeof(Subscriptions.SubscriptionsMain)},
|
||||||
|
{"about", typeof(About.AboutMain)},
|
||||||
{"sources", typeof(Sources.SourcesMain)},
|
{"sources", typeof(Sources.SourcesMain)},
|
||||||
{"settings", typeof(Settings.SettingsMain)}
|
{"settings", typeof(Settings.SettingsMain)},
|
||||||
};
|
};
|
||||||
|
|
||||||
// ON ITEM INVOKED
|
// ON ITEM INVOKED
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<Page
|
<Page
|
||||||
x:Class="VDownload.GUI.Views.Settings.SettingsMain"
|
x:Class="VDownload.Views.Settings.SettingsMain"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="using:VDownload.Views.Settings"
|
xmlns:local="using:VDownload.Views.Settings"
|
||||||
@@ -15,7 +15,7 @@ using Windows.UI.Xaml.Navigation;
|
|||||||
|
|
||||||
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
||||||
|
|
||||||
namespace VDownload.GUI.Views.Settings
|
namespace VDownload.Views.Settings
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||||
35
VDownload/Views/Sources/SourcesMain.xaml
Normal file
35
VDownload/Views/Sources/SourcesMain.xaml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<Page
|
||||||
|
x:Class="VDownload.Views.Sources.SourcesMain"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="using:VDownload.Views.Sources"
|
||||||
|
xmlns:cc="using:VDownload.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||||
|
|
||||||
|
|
||||||
|
<Grid Padding="20">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="20"/>
|
||||||
|
<RowDefinition/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!-- HEADER TEXT -->
|
||||||
|
<TextBlock x:Name="SourcesMainPageHeaderText" x:Uid="SourcesMainPageHeaderText" Grid.Row="0" FontSize="28" FontWeight="SemiBold"/>
|
||||||
|
|
||||||
|
<!-- CONTENT -->
|
||||||
|
<StackPanel Grid.Row="2" Spacing="10">
|
||||||
|
<cc:SettingControl x:Name="SourcesTwitchSettingControl" x:Uid="SourcesTwitchSettingControl" Grid.Row="0" Title="Twitch"> <!-- Twitch -->
|
||||||
|
<cc:SettingControl.Icon>
|
||||||
|
<BitmapIcon UriSource="ms-appx:///Assets/Icons/Sources/Twitch.png" ShowAsMonochrome="False"/>
|
||||||
|
</cc:SettingControl.Icon>
|
||||||
|
<cc:SettingControl.SettingContent>
|
||||||
|
<Button x:Name="SourcesTwitchLoginButton" Click="SourcesTwitchLoginButton_Click"/>
|
||||||
|
</cc:SettingControl.SettingContent>
|
||||||
|
</cc:SettingControl>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Page>
|
||||||
@@ -22,7 +22,7 @@ using Windows.UI.Xaml.Input;
|
|||||||
using Windows.UI.Xaml.Media;
|
using Windows.UI.Xaml.Media;
|
||||||
using Windows.UI.Xaml.Navigation;
|
using Windows.UI.Xaml.Navigation;
|
||||||
|
|
||||||
namespace VDownload.GUI.Views.Sources
|
namespace VDownload.Views.Sources
|
||||||
{
|
{
|
||||||
public sealed partial class SourcesMain : Page
|
public sealed partial class SourcesMain : Page
|
||||||
{
|
{
|
||||||
@@ -31,19 +31,15 @@ namespace VDownload.GUI.Views.Sources
|
|||||||
public SourcesMain()
|
public SourcesMain()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
// Twitch loading
|
|
||||||
SourcesMainTwitchSettingControl.Description = ResourceLoader.GetForCurrentView().GetString("SourcesMainTwitchSettingControlDescriptionLoading");
|
|
||||||
SourcesMainTwitchLoginButton.Content = ResourceLoader.GetForCurrentView().GetString("SourcesMainTwitchLoginButtonTextLoading");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region MAIN
|
#region EVENT HANDLERS
|
||||||
|
|
||||||
// ONNAVIGATEDTO EVENT (CHECK SOURCES AUTHENTICATION)
|
// NAVIGATED TO THIS PAGE (Check all services)
|
||||||
protected override async void OnNavigatedTo(NavigationEventArgs e)
|
protected override async void OnNavigatedTo(NavigationEventArgs e)
|
||||||
{
|
{
|
||||||
// Check Twitch
|
// Check Twitch
|
||||||
@@ -53,8 +49,8 @@ namespace VDownload.GUI.Views.Sources
|
|||||||
{
|
{
|
||||||
Debug.WriteLine("Twitch authentication status: LOGGED_IN");
|
Debug.WriteLine("Twitch authentication status: LOGGED_IN");
|
||||||
Debug.WriteLine(twitchAccessTokenValidation.ExpirationDate.Value.ToString("dd.MM.yyyy"));
|
Debug.WriteLine(twitchAccessTokenValidation.ExpirationDate.Value.ToString("dd.MM.yyyy"));
|
||||||
SourcesMainTwitchSettingControl.Description = $"{ResourceLoader.GetForCurrentView().GetString("SourcesMainTwitchSettingControlDescriptionLoggedIn")} {twitchAccessTokenValidation.Login}";
|
SourcesTwitchSettingControl.Description = $"{ResourceLoader.GetForCurrentView().GetString("SourcesTwitchSettingControlDescriptionLoggedIn")} {twitchAccessTokenValidation.Login}";
|
||||||
SourcesMainTwitchLoginButton.Content = ResourceLoader.GetForCurrentView().GetString("SourcesMainTwitchLoginButtonTextLoggedIn");
|
SourcesTwitchLoginButton.Content = ResourceLoader.GetForCurrentView().GetString("SourcesTwitchLoginButtonTextLoggedIn");
|
||||||
}
|
}
|
||||||
else if (twitchAccessToken == null || !twitchAccessTokenValidation.IsValid)
|
else if (twitchAccessToken == null || !twitchAccessTokenValidation.IsValid)
|
||||||
{
|
{
|
||||||
@@ -67,20 +63,13 @@ namespace VDownload.GUI.Views.Sources
|
|||||||
{
|
{
|
||||||
Debug.WriteLine("Twitch authentication status: ACCESS_TOKEN_NOT_FOUND");
|
Debug.WriteLine("Twitch authentication status: ACCESS_TOKEN_NOT_FOUND");
|
||||||
}
|
}
|
||||||
SourcesMainTwitchSettingControl.Description = ResourceLoader.GetForCurrentView().GetString("SourcesMainTwitchSettingControlDescriptionNotLoggedIn");
|
SourcesTwitchSettingControl.Description = ResourceLoader.GetForCurrentView().GetString("SourcesTwitchSettingControlDescriptionNotLoggedIn");
|
||||||
SourcesMainTwitchSettingControl.DescriptionColor = new SolidColorBrush(Color.FromArgb(255, 225, 0, 0));
|
SourcesTwitchLoginButton.Content = ResourceLoader.GetForCurrentView().GetString("SourcesTwitchLoginButtonTextNotLoggedIn");
|
||||||
SourcesMainTwitchLoginButton.Content = ResourceLoader.GetForCurrentView().GetString("SourcesMainTwitchLoginButtonTextNotLoggedIn");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
// TWITCH LOGIN BUTTON CLICKED
|
||||||
|
private async void SourcesTwitchLoginButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
|
||||||
|
|
||||||
#region LOGIN BUTTONS
|
|
||||||
|
|
||||||
// TWITCH LOGIN
|
|
||||||
private async void SourcesMainTwitchLoginButton_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
{
|
||||||
string accessToken = await Core.Services.Sources.Twitch.Auth.ReadAccessTokenAsync();
|
string accessToken = await Core.Services.Sources.Twitch.Auth.ReadAccessTokenAsync();
|
||||||
var accessTokenValidation = await Core.Services.Sources.Twitch.Auth.ValidateAccessTokenAsync(accessToken);
|
var accessTokenValidation = await Core.Services.Sources.Twitch.Auth.ValidateAccessTokenAsync(accessToken);
|
||||||
@@ -98,9 +87,8 @@ namespace VDownload.GUI.Views.Sources
|
|||||||
|
|
||||||
// Update Twitch SettingControl
|
// Update Twitch SettingControl
|
||||||
Debug.WriteLine("Twitch authentication status: ACCESS_TOKEN_NOT_FOUND");
|
Debug.WriteLine("Twitch authentication status: ACCESS_TOKEN_NOT_FOUND");
|
||||||
SourcesMainTwitchSettingControl.Description = ResourceLoader.GetForCurrentView().GetString("SourcesMainTwitchSettingControlDescriptionNotLoggedIn");
|
SourcesTwitchSettingControl.Description = ResourceLoader.GetForCurrentView().GetString("SourcesTwitchSettingControlDescriptionNotLoggedIn");
|
||||||
SourcesMainTwitchSettingControl.DescriptionColor = new SolidColorBrush(Color.FromArgb(255, 225, 0, 0));
|
SourcesTwitchLoginButton.Content = ResourceLoader.GetForCurrentView().GetString("SourcesTwitchLoginButtonTextNotLoggedIn");
|
||||||
SourcesMainTwitchLoginButton.Content = ResourceLoader.GetForCurrentView().GetString("SourcesMainTwitchLoginButtonTextNotLoggedIn");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -145,9 +133,8 @@ namespace VDownload.GUI.Views.Sources
|
|||||||
|
|
||||||
// Update Twitch SettingControl
|
// Update Twitch SettingControl
|
||||||
Debug.WriteLine("Twitch authentication status: LOGGED_IN");
|
Debug.WriteLine("Twitch authentication status: LOGGED_IN");
|
||||||
SourcesMainTwitchSettingControl.Description = $"{ResourceLoader.GetForCurrentView().GetString("SourcesMainTwitchSettingControlDescriptionLoggedIn")} {accessTokenValidation.Login}";
|
SourcesTwitchSettingControl.Description = $"{ResourceLoader.GetForCurrentView().GetString("SourcesTwitchSettingControlDescriptionLoggedIn")} {accessTokenValidation.Login}";
|
||||||
SourcesMainTwitchSettingControl.DescriptionColor = new SolidColorBrush((Color)Application.Current.Resources["SystemBaseMediumColor"]);
|
SourcesTwitchLoginButton.Content = ResourceLoader.GetForCurrentView().GetString("SourcesTwitchLoginButtonTextLoggedIn");
|
||||||
SourcesMainTwitchLoginButton.Content = ResourceLoader.GetForCurrentView().GetString("SourcesMainTwitchLoginButtonTextLoggedIn");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -170,8 +157,8 @@ namespace VDownload.GUI.Views.Sources
|
|||||||
// Error
|
// Error
|
||||||
ContentDialog loginErrorDialog = new ContentDialog
|
ContentDialog loginErrorDialog = new ContentDialog
|
||||||
{
|
{
|
||||||
Title = ResourceLoader.GetForCurrentView().GetString("SourcesMainTwitchLoginErrorDialogTitle"),
|
Title = ResourceLoader.GetForCurrentView().GetString("SourcesTwitchLoginErrorDialogTitle"),
|
||||||
Content = errorsTranslation.Keys.Contains(errorInfo) ? errorsTranslation[errorInfo] : $"{ResourceLoader.GetForCurrentView().GetString("SourcesMainTwitchLoginErrorDialogDescriptionUnknown")} ({errorInfo})",
|
Content = errorsTranslation.Keys.Contains(errorInfo) ? errorsTranslation[errorInfo] : $"{ResourceLoader.GetForCurrentView().GetString("SourcesTwitchLoginErrorDialogDescriptionUnknown")} ({errorInfo})",
|
||||||
CloseButtonText = "OK",
|
CloseButtonText = "OK",
|
||||||
};
|
};
|
||||||
await loginErrorDialog.ShowAsync();
|
await loginErrorDialog.ShowAsync();
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<Page
|
<Page
|
||||||
x:Class="VDownload.GUI.Views.Subscriptions.SubscriptionsMain"
|
x:Class="VDownload.Views.Subscriptions.SubscriptionsMain"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="using:VDownload.Views.Subscriptions"
|
xmlns:local="using:VDownload.Views.Subscriptions"
|
||||||
@@ -15,7 +15,7 @@ using Windows.UI.Xaml.Navigation;
|
|||||||
|
|
||||||
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
||||||
|
|
||||||
namespace VDownload.GUI.Views.Subscriptions
|
namespace VDownload.Views.Subscriptions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||||
Reference in New Issue
Block a user