Added download form

Started Launcher
This commit is contained in:
Serraniel 2017-03-09 20:56:48 +01:00
parent 1ac96b3966
commit ffea67dd12
11 changed files with 713 additions and 6 deletions

View file

@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Discord Media Loader.Application")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Serraniel")]
[assembly: AssemblyProduct("Discord Media Loader.Application")]
[assembly: AssemblyCopyright("Copyright © 2017 by Serraniel")]
[assembly: AssemblyTrademark("")]

View file

@ -33,9 +33,13 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Serraniel-Logo4-ABGERUNDET.ico</ApplicationIcon>
<ApplicationIcon>Serraniel-64x64.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Octokit, Version=0.24.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Octokit.0.24.1-alpha0001\lib\net45\Octokit.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@ -49,8 +53,19 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FrmDownload.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmDownload.Designer.cs">
<DependentUpon>FrmDownload.cs</DependentUpon>
</Compile>
<Compile Include="Helper\TaskBarProgress.cs" />
<Compile Include="Helper\VersionHelper.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FrmDownload.resx">
<DependentUpon>FrmDownload.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@ -60,6 +75,7 @@
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -74,6 +90,7 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Serraniel-64x64.ico" />
<Content Include="Serraniel-Logo4-ABGERUNDET.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View file

@ -0,0 +1,77 @@
namespace Discord_Media_Loader
{
partial class FrmDownload
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmDownload));
this.pgbProgress = new System.Windows.Forms.ProgressBar();
this.lbStatus = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// pgbProgress
//
this.pgbProgress.Location = new System.Drawing.Point(12, 12);
this.pgbProgress.Name = "pgbProgress";
this.pgbProgress.Size = new System.Drawing.Size(351, 23);
this.pgbProgress.TabIndex = 0;
//
// lbStatus
//
this.lbStatus.AutoSize = true;
this.lbStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbStatus.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
this.lbStatus.Location = new System.Drawing.Point(12, 47);
this.lbStatus.Name = "lbStatus";
this.lbStatus.Size = new System.Drawing.Size(37, 13);
this.lbStatus.TabIndex = 1;
this.lbStatus.Text = "Status";
//
// FrmDownload
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(375, 70);
this.ControlBox = false;
this.Controls.Add(this.lbStatus);
this.Controls.Add(this.pgbProgress);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmDownload";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Discord Media Loader";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ProgressBar pgbProgress;
private System.Windows.Forms.Label lbStatus;
}
}

View file

@ -0,0 +1,115 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Discord_Media_Loader
{
internal partial class FrmDownload : Form
{
private string FileName { get; }
private string Source { get; }
private bool Finished { get; set; } = false;
internal FrmDownload(string fileName, string source)
{
InitializeComponent();
FileName = fileName;
Source = source;
}
internal void StartDownload()
{
Task.Run(() =>
{
var wc = new WebClient
{
CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore)
};
SetStatus($"Downloading {FileName}...");
SetProgress(0, 100);
wc.DownloadProgressChanged += Wc_DownloadProgressChanged;
wc.DownloadFileCompleted += Wc_DownloadFileCompleted;
wc.DownloadFileAsync(new Uri(Source), FileName);
while (!Finished)
{
// wait for download
}
RequestClose();
});
}
private void Wc_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
SetStatus(LocUtils.Remember("Download finished"));
Finished = true;
}
private void Wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
var bytesIn = double.Parse(e.BytesReceived.ToString(CultureInfo.InvariantCulture));
var totalBytes = double.Parse(e.TotalBytesToReceive.ToString(CultureInfo.InvariantCulture));
var percentage = bytesIn / totalBytes * 100;
SetProgress(percentage, 100);
}
delegate void SetStatusCallback(String status);
private void SetStatus(String status)
{
if (InvokeRequired)
{
var callback = new SetStatusCallback(SetStatus);
Invoke(callback, status);
}
else
{
lbStatus.Text = status;
}
}
delegate void SetProgressCallback(double current, int max);
private void SetProgress(double current, int max)
{
if (InvokeRequired)
{
var callback = new SetProgressCallback(SetProgress);
Invoke(callback, current, max);
}
else
{
pgbProgress.Maximum = max;
pgbProgress.Value = (int)current;
Helper.TaskBarProgress.SetState(Handle, Helper.TaskBarProgress.TaskbarStates.Normal);
Helper.TaskBarProgress.SetValue(Handle, (int)current, max);
}
}
delegate void RequestCloseCallback();
private void RequestClose()
{
if (InvokeRequired)
{
var callback = new RequestCloseCallback(RequestClose);
Invoke(callback, new object[] { });
}
else
{
Close();
}
}
}
}

View file

@ -0,0 +1,408 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAQEAAAAEAIAAoQgAAFgAAACgAAABAAAAAgAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8b////VP///3////+m////zP//
/+T////1//////////r////u////3f///8z///+m////f////1T///8b////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////M////5D////b////////
////////////////////////////////////////////////////////////////////////////////
/9v///+Q////M////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///w3///90////1v//
////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////W////dP///w3///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A2K4AANiuAADYrgAA2K4AANiuAADfswAA////EP//
/4D////t////////////////////////////////////////////////9/zq/7XiQ/+340n/w+ho/9Pu
kf/m9b//+Pzt///////////////////////////////////////////////////////////t////gf//
/xCa2AAAmtgAAJrYAACa2AAAmtgAAJrYAAD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////ANiuAADYrgAA2K4AANiu
AAD///8B////Yf///+v//////////////////////////////////////////////////////////+z4
z/+a2AD/mtgA/5rYAP+a2AD/mtgA/6TcGf+65VL/3fKo//n98P//////////////////////////////
///////////////////////r////Yf///wGa2AAAmtgAAJrYAACa2AAA////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wDYrgAA2K4AANiuAAD///8k////xP//////////////////////////////////////////////////
///////////////////h87P/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+n3SD/zOt+//X7
5v/////////////////////////////////////////////////////E////I5rYAACa2AAAmtgAAP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A2K4AANiuAAD///9V////8f//////////////////////////////////
////////////////////////////////////////0+6Q/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rY
AP+a2AD/mtgA/5rYAP+k3Bn/0e2K//v+9v//////////////////////////////////////////////
//H///9VmtgAAJrYAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wH///+M////////////////////////
/////////////////////////////////////////////////////////////8bpbv+a2AD/mtgA/5rY
AP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+u4DP/5/bD////////////////////
/////////////////////////////////4z///8B////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wb///+l////////
////////////////////////////////////////////////////////////////////////////////
//+55E//mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5zZ
Bv/P7Ib/////////////////////////////////////////////////////pf///wb///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wb///+3////////////////////////////////////////////////////////////////////////
///////////////////+//3/rd8x/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rY
AP+a2AD/mtgA/5rYAP+a2AD/mtgA/7zlV//5/fH/////////////////////////////////////////
//////+3////Bv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wH///+k////////////////////////////////////////////////////////
////////////////////////////////////////+f3v/6PcF/+a2AD/mtgA/5rYAP+a2AD/mtgA/5rY
AP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/seE7//X75v//////////////
/////////////////////////////////6T///8B////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///+K////////////////////////////////////////
/////////////////////////////////////////////////////////////+751f+a2AD/mtgA/5rY
AP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rY
AP+s3y7/9Pvi////////////////////////////////////////////////i////wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///9V////////////////////////
////////////////////////////////////////////////////////////////////////////////
///s+M//rd8w/6XcHf+c2Qb/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rY
AP+a2AD/mtgA/5rYAP+a2AD/mtgA/6zfLv/1++f/////////////////////////////////////////
//////9V////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8j////8P//
////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////v/6/fL/8PnZ/97yrP/E6Gv/qd4l/5rYAP+a2AD/mtgA/5rY
AP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/suE8//v99P//////////////
////////////////////////////8P///yP///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8B////xP//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////v9
9f/e8qz/s+JA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rY
AP/A51/////////////////////////////////////////////////E////Af///wD///8A////AP//
/wD///8A////AP///wD///8A////Yf//////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////f867/rN8t/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rY
AP+a2AD/mtgA/5rYAP+a2AD/mtgA/9jwnP//////////////////////////////////////////////
/2H///8A////AP///wD///8A////AP///wD///8A////EP///+r/////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////r98//I6nX/mtgA/5rY
AP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+h2xL/8/rh////////////////////
///////////////////////q////Ev///wD///8A////AP///wD///8A////AP///3//////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/////////////9/yrf+h2xL/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/8Dn
X////////////////////////////////////////////////4D///8A////AP///wD///8A////AP//
/w3////u////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////7PjQ/6reKP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rY
AP+a2AD/mtgA/5rYAP+c2QX/7vjT///////////////////////////////////////////u////Df//
/wD///8A////AP///wD///90////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////0++L/qd4n/5rY
AP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/8PoaP//////////////////////////////
/////////////////3T///8A////AP///wD///8B////2///////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/////////////+360P+k4g3/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP+j2xb/+Pzu////
///////////////////////////////////////b////Af///wD///8A////O///////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////wNCY/53dAP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rY
AP+a2AD/mtgA/9/zr////////////////////////////////////////////////zv///8A////AP//
/5D/////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////f39/+Puin/n+AA/5rY
AP+a2AD/mtgA/5rYAP+a2AD/mtgA/5rYAP/F6W3/////////////////////////////////////////
//////+Q////AP///wD////Y////////////////////////////////////////////////////////
/////////////////////////////+3t7f+3t7f/jIyM/3Nzc/9oaGj/a2tr/35+fv+dnZ3/xsbG//Hx
8f//////////////////////////////////////////////////////////////////////////////
////////iZNy/5zbAP+b2QD/mtgA/5rYAP+a2AD/mtgA/5rYAP+a2AD/s+JA////////////////////
////////////////////////////2f///wD///8d////////////////////////////////////////
////////////////////////////////////////9fTx/46Pk/9BQUH/Li4u/y4uLv8uLi7/Li4u/y4u
Lv8uLi7/Li4u/y4uLv9ERET/fn5+/8rKyv//////////////////////////////////////////////
/////////////////////////////4iHjP98qA3/n+AA/5rYAP+a2AD/mtgA/5rYAP+a2AD/mtgA/6ne
J/////////////////////////////////////////////////////8e////Vv//////////////////
////////////////////////////////////////////////////////+fDL/45/Qv8kJjH/Li4u/y4u
Lv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Xl5e/7e3t//+/v7/////////
//////////////////////////////////////////////////9vbXX/T2Ig/57fAP+a2QD/mtgA/5rY
AP+a2AD/mtgA/5rYAP+l3Bz/////////////////////////////////////////////////////Vv//
/4T/////////////////////////////////////////////////////////////////////8+ax/+O5
D/92ZBv/JCYx/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4u
Lv8uLi7/YGBg/8jIyP/////////////////////////////////////////////////09PT/QkJE/zEz
Lf+Mwgb/nd0A/5rYAP+a2AD/mtgA/5rYAP+a2AD/pdwb////////////////////////////////////
/////////////////4T///+t////////////////////////////////////////////////////////
////////8+ez/9mwB//htQD/dWMb/yQnMf8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4u
Lv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/dHR0/97e3v//////////////////////////////
////////r6+v/y4uLv8nIzH/bZET/6HiAP+a2AD/mtgA/5rYAP+a2AD/mtgA/6neJv//////////////
//////////////////////////////////////+t////zP//////////////////////////////////
////////////////////////+PHS/9qyDv/YrgD/4rUA/3lmGf8kJjH/Li4u/y4uLv8uLi7/Li4u/y4u
Lv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Ozs7/1ZWVv90dHT/jo6O/5mZmf/Hx8f//v7+////
////////////////////////7+/v/0dHR/8uLi7/KCUw/1BkH/+f4AD/mtgA/5rYAP+a2AD/mtgA/5rY
AP+z4T7/////////////////////////////////////////////////////zP///+X/////////////
/////////////////////////////////////////v35/+C/N//YrgD/2K4A/+O2AP+Dbhf/IyYx/y4u
Lv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/1VVVf+QkJD/xsbG/+rq6v//////////////
////////////////////////////////////////+vr6/2tra/8uLi7/Li4u/yspL/86Qij/ltEC/5va
AP+a2AD/mtgA/5rYAP+a2AD/x+ly////////////////////////////////////////////////////
/+D////y//////////////////////////////////////////////////////Dfm//YrgD/2K4A/9iu
AP/itQD/k3oT/yUnMf8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/cHBw/8bGxv/8/Pz/////////
////////////////////////////////////////////////////////7+/v/3BwcP8uLi7/Li4u/y4u
Lv8tLC7/Ly8u/4e7CP+e3gD/mtgA/5rYAP+a2AD/mtgA/+X1vf//////////////////////////////
///////////////////////s//////////////////////////////////////////////////////79
+f/euyr/2K4A/9iuAP/YrgD/4LQA/6iKDf8oKTD/Li4u/y4uLv8uLi7/Li4u/y4uLv9QUFD/xMTE////
////////////////////////////////////////////////////////////////////////w8PD/1BQ
UP8uLi7/Li4u/y4uLv8uLi7/Li4u/yknMP95pA7/n+EA/5rYAP+a2AD/mtgA/6neJ//8/vj/////////
////////////////////////////////////////////+f//////////////////////////////////
///////////////////168D/2K4A/9iuAP/YrgD/2K4A/92yAP+/mwf/MTAt/ywtLv8uLi7/Li4u/y4u
Lv9wcHD/8PDw//////////////////////////////////////////////////////////////////r6
+v/ExMT/bm5u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8oJDH/a44U/6HiAP+a2AD/mtgA/5rY
AP/W75j///////////////////////////////////////////////////////////n////y////////
////////////////////////////////////////6tR3/9iuAP/YrgD/2K4A/9iuAP/arwD/06oB/0VA
J/8pKi//Li4u/y4uLv9ra2v/+vr6//////////////////////////////////////////////////39
/f/n5+f/wsLC/4yMjP9SUlL/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/JyMx/2F+
GP+h4wD/mtgA/5rYAP+v4DX//P74////////////////////////////////////////////////////
///////s////5f///////////////////////////////////////////////+LDQv/YrgD/2K4A/9iu
AP/YrgD/2K4A/+C0AP9oWh7/JCcx/y4uLv9GRkb/7u7u/////////////////////////////v7+/8fH
x/+VlZX/iYmJ/3BwcP9TU1P/OTk5/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4u
Lv8uLi7/Li4u/ygkMf9bdRv/oOEA/5rYAP+g2g7/7fjR////////////////////////////////////
////////////////////////////4P///8z/////////////////////////////////////////////
///euyj/2K4A/9iuAP/YrgD/2K4A/9iuAP/itQD/ln0S/yQnMf8uLi7/ra2t////////////////////
///////////////////i4uL/e3t7/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4u
Lv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8oJDH/WXEc/6DhAP+d2Qf/4fOy////////////////////
/////////////////////////////////////////////////8z///+t////////////////////////
////////////////////////3Lcc/9iuAP/YrgD/2K4A/9iuAP/YrgD/3LEA/8agBf82NCz/Pj9C//T0
9P/////////////////////////////////////////////////Ozs7/ZmZm/y4uLv8uLi7/Li4u/y4u
Lv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/KCQx/1pzHP+m4w//4POx////
//////////////////////////////////////////////////////////////////////+t////hP//
/////////////////////////////////////////////9y3Hf/YrgD/2K4A/9iuAP/YrgD/2K4A/9iu
AP/gtAD/Z1ke/2lrcv//////////////////////////////////////////////////////////////
//++vr7/ZGRk/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/y4uLv8uLi7/Li4u/ygk
Mf93i0X/7PnL////////////////////////////////////////////////////////////////////
////////////hP///1T////////////////////////////////////////////////euyr/2K4A/9iu
AP/YrgD/2K4A/9iuAP/YrgD/4LQA/66OC/+Dg4b/////////////////////////////////////////
///////////////////////////////////Pz8//hISE/0hISP8uLi7/Li4u/y4uLv8uLi7/Li4u/y4u
Lv8uLi7/Li4u/0JCQv+RkJX/9PXy////////////////////////////////////////////////////
/////////////////////////////////1b///8c////////////////////////////////////////
////////48RG/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9mvAP/dsgD/kopq////////////////////
///////////////////////////////////////////////////////////////////09PT/y8vL/6Ki
ov+Dg4P/cXFx/21tbf94eHj/kJCQ/7q6uv/v7+//////////////////////////////////////////
//////////////////////////////////////////////////////8d////AP///9f/////////////
/////////////////////////////+rTdP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/4LQA/72f
Iv/09PT/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////Y////AP//
/wD///+P///////////////////////////////////////////06Lb/2K4A/9iuAP/YrgD/2K4A/9iu
AP/YrgD/2K4A/9iuAP/esgD/zsKO////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////kP///wD///8A////Ov///////////////////////////////////////////fvx/9y2
Gv/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/+G3Cf/578j/////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////zr///8A////AP///wH////a////////////////////////
///////////////////p0nD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/3bgh//r0
3P//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////9v///8B////AP///wD///8A////dP//
////////////////////////////////////////+fPZ/9mxCP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iu
AP/YrgD/2K4A/9iuAP/duCH/9+7I////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////90////AP//
/wD///8A////AP///wz////t///////////////////////////////////////////oz2n/2K4A/9iu
AP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9qyDf/x4qT/////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
///////t////Df///wD///8A////AP///wD///8A////f///////////////////////////////////
////////+/fm/9u1Fv/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/+nQ
bP/8+u7/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////f////wD///8A////AP///wD///8A////AP///xD////q////////
///////////////////////////////////x4qX/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iu
AP/YrgD/2K4A/9iuAP/YrgD/3ron//Hipf///v3/////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////6v///xD///8A////AP///wD///8A////AP//
/wD///8A////YP///////////////////////////////////////////////+jPaf/YrgD/2K4A/9iu
AP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/4cA5//HipP/9+/H/////////
////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////2H///8A////AP//
/wD///8A////AP///wD///8A////AP///wH////D////////////////////////////////////////
///+/fj/4sRE/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iu
AP/YrgD/3bgf/+fNY//x4qX/+PHT//367//+/vv////+////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/8P///8B////AP///wD///8A////AP///wD///8A////AP///wD///8A////Iv////D/////////////
//////////////////////////////z57f/gvzX/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iu
AP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9ivA//cthj/37wr//fuyv//////////////
////////////////////////////////////////////////////////////////////////////////
//////////////////D///8i////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///9U////////////////////////////////////////////////+/jo/+C/Nf/YrgD/2K4A/9iu
AP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iu
AP/48NH/////////////////////////////////////////////////////////////////////////
//////////////////////////////////////9V////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///4j/////////////////////////////////////////////
///8+ev/4sND/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iu
AP/YrgD/2K4A/9iuAP/btBP//Pns////////////////////////////////////////////////////
//////////////////////////////////////////////////////+J////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8B////pP//////////////////
//////////////////////////////789v/nzGD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iu
AP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/37wt///+/P//////////////////////////////
//////////////////////////////////////////////////////////////////////+k////Af//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wb///+3/////////////////////////////////////////////////////+7bj//asQr/2K4A/9iu
AP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/+PGSv//////////////
////////////////////////////////////////////////////////////////////////////////
//////+3////Bv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////Bv///6X/////////////////////////////////////////////
////////9+7K/+HBO//YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A/9iu
AP/oz2n/////////////////////////////////////////////////////////////////////////
//////////////////////+l////Bv///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8B////jP//////////////////
///////////////////////////////////+/fr/7t2T/924Hv/YrgD/2K4A/9iuAP/YrgD/2K4A/9iu
AP/YrgD/2K4A/9iuAP/YrgD/7dqL////////////////////////////////////////////////////
//////////////////////////////////////+M////Af///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A2K4AANiu
AAD///9V////8f/////////////////////////////////////////////////////8+ev/7dmH/966
Jv/YrgD/2K4A/9iuAP/YrgD/2K4A/9iuAP/YrgD/2K4A//Plrv//////////////////////////////
//////////////////////////////////////////////////H///9VmtgAAJrYAAD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////ANiuAADYrgAA2K4AAP///yT////E////////////////////////////////////////
///////////////////9/PT/8+av/+bLWv/duB7/2K4A/9iuAP/YrgD/2K4A/9iuAP/37sv/////////
/////////////////////////////////////////////////////////////////8T///8jmtgAAJrY
AACa2AAA////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wDYrgAA2K4AANiuAADYrgAA////Af///2D////r////////
/////////////////////////////////////////////////////////fvx//btxv/v3pf/6dJw/+TH
T//jxEX/+/jo////////////////////////////////////////////////////////////////6///
/2D///8BmtgAAJrYAACa2AAAmtgAAP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////EP///3/////t////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
///////t////f////xD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////Df///3T////V////////////////////////
////////////////////////////////////////////////////////////////////////////////
/////////////////9X///90////Df///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/zP///+N////1///////////////////////////////////////////////////////////////////
///////////////////////X////jf///zP///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8b////VP///33///+l////y////+P////y////////
///////y////4////8v///+l////ff///1T///8b////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////4Af///////wAAD//////8AAAD/////+AAAAB/////wAAAAD////8AAAAAD////gAAAAA
H///4AAAAAAH///AAAAAAAP//4AAAAAAAf//AAAAAAAA//4AAAAAAAB//gAAAAAAAH/8AAAAAAAAP/gA
AAAAAAAf+AAAAAAAAB/wAAAAAAAAD/AAAAAAAAAH4AAAAAAAAAfgAAAAAAAAB8AAAAAAAAADwAAAAAAA
AAOAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAGAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAIAAAAAAAAABgAAAAAAAAAGAAAAAAAAAAYAAAAAAAAABwAAAAAAAAAPAAAAAAAAAA+AA
AAAAAAAH4AAAAAAAAAfwAAAAAAAAD/AAAAAAAAAP+AAAAAAAAB/4AAAAAAAAH/wAAAAAAAA//gAAAAAA
AH/+AAAAAAAAf/8AAAAAAAD//4AAAAAAAf//wAAAAAAD///gAAAAAAf///gAAAAAH////AAAAAA/////
AAAAAP/////AAAAD//////AAAA///////AAAP///////4Af///8=
</value>
</data>
</root>

View file

@ -0,0 +1,65 @@
using System;
using System.Runtime.InteropServices;
namespace Discord_Media_Loader.Helper
{
internal static class TaskBarProgress
{
internal enum TaskbarStates
{
NoProgress = 0,
Indeterminate = 0x1,
Normal = 0x2,
Error = 0x4,
Paused = 0x8
}
[ComImport]
[Guid("ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
private interface ITaskbarList3
{
// ITaskbarList
[PreserveSig]
void HrInit();
[PreserveSig]
void AddTab(IntPtr hwnd);
[PreserveSig]
void DeleteTab(IntPtr hwnd);
[PreserveSig]
void ActivateTab(IntPtr hwnd);
[PreserveSig]
void SetActiveAlt(IntPtr hwnd);
// ITaskbarList2
[PreserveSig]
void MarkFullscreenWindow(IntPtr hwnd, [MarshalAs(UnmanagedType.Bool)] bool fFullscreen);
// ITaskbarList3
[PreserveSig]
void SetProgressValue(IntPtr hwnd, UInt64 ullCompleted, UInt64 ullTotal);
[PreserveSig]
void SetProgressState(IntPtr hwnd, TaskbarStates state);
}
[Guid("56FDF344-FD6D-11d0-958A-006097C9A090")]
[ClassInterface(ClassInterfaceType.None)]
[ComImport]
private class TaskbarInstance
{
}
private static ITaskbarList3 taskbarInstance = (ITaskbarList3)new TaskbarInstance();
private static bool taskbarSupported = Environment.OSVersion.Version >= new Version(6, 1);
internal static void SetState(IntPtr windowHandle, TaskbarStates taskbarState)
{
if (taskbarSupported) taskbarInstance.SetProgressState(windowHandle, taskbarState);
}
internal static void SetValue(IntPtr windowHandle, double progressValue, double progressMax)
{
if (taskbarSupported) taskbarInstance.SetProgressValue(windowHandle, (ulong)progressValue, (ulong)progressMax);
}
}
}

View file

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace Discord_Media_Loader.Helper
{
internal class VersionHelper
{
internal static Version CurrentVersion => Assembly.GetExecutingAssembly().GetName().Version;
}
}

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime;
using System.Threading.Tasks;
using System.Windows.Forms;
@ -16,7 +17,11 @@ namespace Discord_Media_Loader
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1());
ProfileOptimization.SetProfileRoot(Application.UserAppDataPath);
ProfileOptimization.StartProfile("profile.opt");
//Application.Run(new FrmDownload());
}
}
}

View file

@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Discord Media Loader")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Serraniel")]
[assembly: AssemblyProduct("Discord Media Loader")]
[assembly: AssemblyCopyright("Copyright © 2017 by Serraniel")]
[assembly: AssemblyTrademark("")]
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyVersion("0.1.2.0")]
[assembly: AssemblyFileVersion("0.1.2.0")]

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Octokit" version="0.24.1-alpha0001" targetFramework="net461" />
</packages>