├── version.txt
├── images
├── 1.PNG
└── 2.PNG
├── Torrentia
├── torrentia.ico
├── HtmlAgilityPack.dll
├── Newtonsoft.Json.dll
├── Enums.cs
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── packages.config
├── App.config
├── RssItem.cs
├── TorrentzResult.cs
├── Program.cs
├── EmbeddedAssembly.cs
├── OptionsForm.cs
├── RssForm.cs
├── ListViewColumnSorter.cs
├── DetailsForm.cs
├── AboutForm.cs
├── DetailsForm.resx
├── OptionsForm.resx
├── Options.cs
├── Torrentia.csproj
├── RssForm.Designer.cs
├── AboutForm.designer.cs
├── AboutForm.resx
├── OptionsForm.designer.cs
├── MainForm.cs
├── DetailsForm.Designer.cs
├── TorrentzScraper.cs
├── MainForm.Designer.cs
├── MainForm.resx
└── RssForm.resx
├── IMAGES.md
├── README.md
├── Torrentia.sln
├── CHANGELOG.md
├── .gitattributes
└── .gitignore
/version.txt:
--------------------------------------------------------------------------------
1 | 2.7
--------------------------------------------------------------------------------
/images/1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hellzerg/torrentia/HEAD/images/1.PNG
--------------------------------------------------------------------------------
/images/2.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hellzerg/torrentia/HEAD/images/2.PNG
--------------------------------------------------------------------------------
/Torrentia/torrentia.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hellzerg/torrentia/HEAD/Torrentia/torrentia.ico
--------------------------------------------------------------------------------
/Torrentia/HtmlAgilityPack.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hellzerg/torrentia/HEAD/Torrentia/HtmlAgilityPack.dll
--------------------------------------------------------------------------------
/Torrentia/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hellzerg/torrentia/HEAD/Torrentia/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/IMAGES.md:
--------------------------------------------------------------------------------
1 | 
2 | 
--------------------------------------------------------------------------------
/Torrentia/Enums.cs:
--------------------------------------------------------------------------------
1 | namespace Torrentia
2 | {
3 | public enum Theme
4 | {
5 | Zerg,
6 | Ocean,
7 | Caramel,
8 | Magma,
9 | Lime,
10 | Minimal
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Torrentia/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Torrentia/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Torrentia/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Torrentia/RssItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Torrentia
8 | {
9 | public class RssItem
10 | {
11 | public string Release { get; set; }
12 | public string Link { get; set; }
13 |
14 | public RssItem(string release, string link)
15 | {
16 | Release = release;
17 | Link = link;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Torrentia/TorrentzResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Torrentia
8 | {
9 | public class TorrentzResult
10 | {
11 | public string Title { get; set; }
12 | public string InfoHash { get; set; }
13 | public string Age { get; set; }
14 | public string Contents { get; set; }
15 | public string Verified { get; set; }
16 | public string Seeders { get; set; }
17 | public string Leechers { get; set; }
18 | public string Size { get; set; }
19 | public List Dates { get; set; }
20 | public List Links { get; set; }
21 | public List Trackers { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Summary: ##
2 |
3 | Simple torrentz2.eu scraper
4 |
5 | ## Features: ##
6 |
7 | * Search torrents
8 | * Verified torrents only filter
9 | * Hide adult torrents filter
10 | * Get trackers list and torrent contents by double-clicking
11 | * Download available
12 | * Track scene releases realtime (RSS)
13 |
14 | ## Downloads: ##
15 | https://github.com/hellzerg/torrentia/releases
16 |
17 | ## Screenshots: ##
18 | https://github.com/hellzerg/torrentia/blob/master/IMAGES.md
19 |
20 | ## Compatibility: ##
21 |
22 | .NET Framework 4.5.2
23 |
24 | Compatible with Windows 7, 8, 8.1, 10
25 |
26 | Also compatible with Windows Server 2008, 2012, 2016
27 |
28 | Does not work with Windows XP or Vista or Windows Server 2003
29 |
30 | ## Details: ##
31 |
32 | Latest version: 2.7
33 |
34 | Released: January 27, 2018
--------------------------------------------------------------------------------
/Torrentia.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Torrentia", "Torrentia\Torrentia.csproj", "{DC6ADB84-56A9-4D11-8916-D28E7F352362}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {DC6ADB84-56A9-4D11-8916-D28E7F352362}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {DC6ADB84-56A9-4D11-8916-D28E7F352362}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {DC6ADB84-56A9-4D11-8916-D28E7F352362}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {DC6ADB84-56A9-4D11-8916-D28E7F352362}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/Torrentia/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Torrentia.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.3.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Torrentia/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Torrentia")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Torrentia")]
13 | [assembly: AssemblyCopyright("deadmoon © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("dc6adb84-56a9-4d11-8916-d28e7f352362")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("0.0.0.0")]
36 | [assembly: AssemblyFileVersion("0.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Torrentia Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | ## [2.7] - 2018-01-27
6 | - Yet again, Fix: 'The remote name could not be resolved' error
7 |
8 | ## [2.6] - 2018-01-25
9 | - Yet again, Fix: 'The remote name could not be resolved' error
10 |
11 | ## [2.5] - 2018-01-22
12 | - Added RSS: track scene releases in realtime
13 |
14 | ## [2.4] - 2018-01-21
15 | - Added torrent name in magnet URL
16 |
17 | ## [2.3] - 2018-01-15
18 | - Again, Fix: 'The remote name could not be resolved' error
19 | - Added: Check for new versions
20 |
21 | ## [2.2] - 2018-01-04
22 | - Fix: 'The remote name could not be resolved' error
23 |
24 | ## [2.1] - 2017-12-31
25 | - New Download button
26 | - Copy Magnet URI removed, no longer provided by Torrentz2.eu
27 | - Hash is now available
28 | - General adaptations to Torrentz2.eu
29 |
30 | ## [2.0] - 2017-11-29
31 | - Rare bug fix when updating app
32 |
33 | ## [1.9] - 2017-10-22
34 | - Keep window state added
35 |
36 | ## [1.8] - 2017-08-04
37 | - Critical search bug fixed
38 |
39 | ## [1.7] - 2017-05-31
40 | - Critical bug fixed...
41 |
42 | ## [1.6] - 2017-04-05
43 | - As always, critical bug fixed
44 |
45 | ## [1.5] - 2017-03-14
46 | - Just another critical bug fixed
47 |
48 | ## [1.4] - 2017-02-17
49 | - Added automatic column resizing
50 | - Minor bug fixes
51 |
52 | ## [1.3] - 2017-02-09
53 | - Another critical bug fixed
54 |
55 | ## [1.2] - 2017-02-06
56 | - Critical bug fixed
57 |
58 | ## [1.1] - 2017-01-03
59 | - Search improvements
60 |
61 | ## [1.0] - 2016-12-12
62 | - Initial release
--------------------------------------------------------------------------------
/Torrentia/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Reflection;
6 | using System.Threading.Tasks;
7 | using System.Windows.Forms;
8 |
9 |
10 | namespace Torrentia
11 | {
12 | static class Program
13 | {
14 | /* VERSION PROPERTIES */
15 | /* DO NOT LEAVE THEM EMPTY */
16 |
17 | // Enter current version here
18 | internal readonly static float Major = 2;
19 | internal readonly static float Minor = 7;
20 |
21 | /* END OF VERSION PROPERTIES */
22 |
23 | internal static string GetCurrentVersionToString()
24 | {
25 | return Major.ToString() + "." + Minor.ToString();
26 | }
27 |
28 | internal static float GetCurrentVersion()
29 | {
30 | return float.Parse(GetCurrentVersionToString());
31 | }
32 |
33 | static string resource = "Torrentia.HtmlAgilityPack.dll";
34 | static string resource2 = "Torrentia.Newtonsoft.Json.dll";
35 |
36 | [STAThread]
37 | static void Main()
38 | {
39 | Application.EnableVisualStyles();
40 | Application.SetCompatibleTextRenderingDefault(false);
41 |
42 | EmbeddedAssembly.Load(resource, resource.Replace("Torrentia.", string.Empty));
43 | EmbeddedAssembly.Load(resource2, resource2.Replace("Torrentia.", string.Empty));
44 | AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
45 |
46 | Options.LoadSettings();
47 | Application.Run(new MainForm());
48 | }
49 |
50 | static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
51 | {
52 | return EmbeddedAssembly.Get(args.Name);
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/Torrentia/EmbeddedAssembly.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Reflection;
6 | using System.Security.Cryptography;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace Torrentia
11 | {
12 | public class EmbeddedAssembly
13 | {
14 | private static Dictionary dic;
15 |
16 | public static void Load(string embeddedResource, string fileName)
17 | {
18 | if (dic == null)
19 | dic = new Dictionary();
20 |
21 | byte[] ba = null;
22 | Assembly asm = null;
23 | var curAsm = Assembly.GetExecutingAssembly();
24 |
25 | using (var stm = curAsm.GetManifestResourceStream(embeddedResource))
26 | {
27 | if (stm == null)
28 | throw new Exception(embeddedResource + " is not found in Embedded Resources.");
29 |
30 | ba = new byte[(int)stm.Length];
31 | stm.Read(ba, 0, (int)stm.Length);
32 | try
33 | {
34 | asm = Assembly.Load(ba);
35 |
36 | dic.Add(asm.FullName, asm);
37 | return;
38 | }
39 | catch { }
40 | }
41 |
42 | var fileOk = false;
43 | var tempFile = "";
44 |
45 | using (var sha1 = new SHA1CryptoServiceProvider())
46 | {
47 | var fileHash = BitConverter.ToString(sha1.ComputeHash(ba)).Replace("-", string.Empty);
48 | ;
49 |
50 | tempFile = Path.GetTempPath() + fileName;
51 |
52 | if (File.Exists(tempFile))
53 | {
54 | var bb = File.ReadAllBytes(tempFile);
55 | var fileHash2 = BitConverter.ToString(sha1.ComputeHash(bb)).Replace("-", string.Empty);
56 |
57 | if (fileHash == fileHash2)
58 | {
59 | fileOk = true;
60 | }
61 | }
62 | else
63 | {
64 | fileOk = false;
65 | }
66 | }
67 |
68 | if (!fileOk)
69 | {
70 | File.WriteAllBytes(tempFile, ba);
71 | }
72 |
73 | asm = Assembly.LoadFile(tempFile);
74 |
75 | dic.Add(asm.FullName, asm);
76 | }
77 |
78 | public static Assembly Get(string assemblyFullName)
79 | {
80 | if (dic == null || dic.Count == 0)
81 | return null;
82 |
83 | if (dic.ContainsKey(assemblyFullName))
84 | return dic[assemblyFullName];
85 |
86 | return null;
87 | }
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/Torrentia/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Torrentia.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Torrentia.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Torrentia/OptionsForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace Torrentia
12 | {
13 | public partial class OptionsForm : Form
14 | {
15 | MainForm _main;
16 |
17 | public OptionsForm(MainForm main)
18 | {
19 | InitializeComponent();
20 | _main = main;
21 |
22 | LoadSettings();
23 | Options.ApplyTheme(this);
24 | }
25 |
26 | private void LoadSettings()
27 | {
28 | switch (Options.CurrentOptions.Color)
29 | {
30 | case Theme.Caramel:
31 | carameltheme.Checked = true;
32 | break;
33 | case Theme.Lime:
34 | limetheme.Checked = true;
35 | break;
36 | case Theme.Magma:
37 | magmatheme.Checked = true;
38 | break;
39 | case Theme.Minimal:
40 | minimaltheme.Checked = true;
41 | break;
42 | case Theme.Ocean:
43 | oceantheme.Checked = true;
44 | break;
45 | case Theme.Zerg:
46 | zergtheme.Checked = true;
47 | break;
48 | }
49 | }
50 |
51 | private void OptionsForm_Load(object sender, EventArgs e)
52 | {
53 | CheckForIllegalCrossThreadCalls = false;
54 | }
55 |
56 | private void okbtn_Click(object sender, EventArgs e)
57 | {
58 | this.Close();
59 | }
60 |
61 | private void oceantheme_CheckedChanged(object sender, EventArgs e)
62 | {
63 | Options.CurrentOptions.Color = Theme.Ocean;
64 | Options.ApplyTheme(this);
65 | Options.ApplyTheme(_main);
66 | }
67 |
68 | private void magmatheme_CheckedChanged(object sender, EventArgs e)
69 | {
70 | Options.CurrentOptions.Color = Theme.Magma;
71 | Options.ApplyTheme(this);
72 | Options.ApplyTheme(_main);
73 | }
74 |
75 | private void zergtheme_CheckedChanged(object sender, EventArgs e)
76 | {
77 | Options.CurrentOptions.Color = Theme.Zerg;
78 | Options.ApplyTheme(this);
79 | Options.ApplyTheme(_main);
80 | }
81 |
82 | private void carameltheme_CheckedChanged(object sender, EventArgs e)
83 | {
84 | Options.CurrentOptions.Color = Theme.Caramel;
85 | Options.ApplyTheme(this);
86 | Options.ApplyTheme(_main);
87 | }
88 |
89 | private void limetheme_CheckedChanged(object sender, EventArgs e)
90 | {
91 | Options.CurrentOptions.Color = Theme.Lime;
92 | Options.ApplyTheme(this);
93 | Options.ApplyTheme(_main);
94 | }
95 |
96 | private void minimaltheme_CheckedChanged(object sender, EventArgs e)
97 | {
98 | Options.CurrentOptions.Color = Theme.Minimal;
99 | Options.ApplyTheme(this);
100 | Options.ApplyTheme(_main);
101 | }
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/Torrentia/RssForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Windows.Forms;
7 | using System.Net;
8 | using System.Xml.Linq;
9 | using System.Diagnostics;
10 |
11 | namespace Torrentia
12 | {
13 | public partial class RssForm : Form
14 | {
15 | string _rssFeedLink = "http://predb.me/?rss=1";
16 | WebClient _client;
17 |
18 | ListViewItem _item;
19 | List _items;
20 |
21 | List _rssItems;
22 |
23 | public RssForm()
24 | {
25 | InitializeComponent();
26 |
27 | CheckForIllegalCrossThreadCalls = false;
28 | Options.ApplyTheme(this);
29 |
30 | _rssItems = new List();
31 |
32 | _client = new WebClient();
33 | _client.Encoding = Encoding.UTF8;
34 | _client.Headers["User-Agent"] = @"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0";
35 |
36 | RetrieveRSS();
37 |
38 | rssTimer.Interval = 60000;
39 | rssTimer.Start();
40 | }
41 |
42 | private void RssForm_Load(object sender, EventArgs e)
43 | {
44 |
45 | }
46 |
47 | private void RetrieveRSS()
48 | {
49 | _client = new WebClient();
50 | _client.Encoding = Encoding.UTF8;
51 | _client.Headers["User-Agent"] = @"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0";
52 |
53 | XDocument xml = XDocument.Parse(_client.DownloadString(_rssFeedLink));
54 |
55 | var feeds = from feed in xml.Descendants("item")
56 | select new
57 | {
58 | Release = feed.Element("title").Value,
59 | Link = feed.Element("link").Value
60 | };
61 |
62 | _rssItems.Clear();
63 | listResults.Items.Clear();
64 |
65 | foreach (var x in feeds)
66 | {
67 | _rssItems.Add(new RssItem(x.Release, x.Link));
68 |
69 | _items = new List();
70 |
71 | _item = new ListViewItem(x.Release);
72 | _items.Add(_item);
73 |
74 | listResults.Items.AddRange(_items.ToArray());
75 | }
76 |
77 | listResults.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
78 | listResults.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
79 | }
80 |
81 | private void listResults_MouseDoubleClick(object sender, MouseEventArgs e)
82 | {
83 | try
84 | {
85 | Process.Start(_rssItems[listResults.SelectedIndices[0]].Link);
86 | }
87 | catch (Exception ex)
88 | {
89 | MessageBox.Show(ex.Message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
90 | }
91 | }
92 |
93 | private void btnRefresh_Click(object sender, EventArgs e)
94 | {
95 | RetrieveRSS();
96 | }
97 |
98 | private void rssTimer_Tick(object sender, EventArgs e)
99 | {
100 | RetrieveRSS();
101 | }
102 |
103 | private void notifyIcon_MouseDoubleClick(object sender, MouseEventArgs e)
104 | {
105 | if (this.WindowState == FormWindowState.Minimized) this.WindowState = FormWindowState.Normal;
106 | this.Activate();
107 | }
108 |
109 | private void notifyIcon_BalloonTipClicked(object sender, EventArgs e)
110 | {
111 | if (this.WindowState == FormWindowState.Minimized) this.WindowState = FormWindowState.Normal;
112 | this.Activate();
113 | }
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/Torrentia/ListViewColumnSorter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Forms;
8 |
9 | namespace Torrentia
10 | {
11 | public class ListViewColumnSorter : IComparer
12 | {
13 | ///
14 | /// Specifies the column to be sorted
15 | ///
16 | private int columnToSort;
17 |
18 | ///
19 | /// Specifies the order in which to sort (i.e. 'Ascending').
20 | ///
21 | private SortOrder orderOfSort;
22 |
23 | ///
24 | /// Case insensitive comparer object
25 | ///
26 | private CaseInsensitiveComparer objectCompare;
27 |
28 | ///
29 | /// Initializes a new instance of the ListViewColumnSorter class
30 | ///
31 | public ListViewColumnSorter()
32 | {
33 | // Initialize the column to '0'
34 | this.columnToSort = 0;
35 |
36 | // Initialize the sort order to 'none'
37 | this.orderOfSort = SortOrder.None;
38 |
39 | // Initialize the CaseInsensitiveComparer object
40 | this.objectCompare = new CaseInsensitiveComparer();
41 | }
42 |
43 | ///
44 | /// Gets or sets the number of the column to which to apply the sorting operation (Defaults to '0').
45 | ///
46 | public int SortColumn
47 | {
48 | get
49 | {
50 | return this.columnToSort;
51 | }
52 |
53 | set
54 | {
55 | this.columnToSort = value;
56 | }
57 | }
58 |
59 | ///
60 | /// Gets or sets the order of sorting to apply (for example, 'Ascending' or 'Descending').
61 | ///
62 | public SortOrder Order
63 | {
64 | get
65 | {
66 | return this.orderOfSort;
67 | }
68 |
69 | set
70 | {
71 | this.orderOfSort = value;
72 | }
73 | }
74 |
75 | ///
76 | /// This method is inherited from the IComparer interface. It compares the two objects passed using a case insensitive comparison.
77 | ///
78 | /// First object to be compared
79 | /// Second object to be compared
80 | /// The result of the comparison. "0" if equal, negative if 'x' is less than 'y' and positive if 'x' is greater than 'y'
81 | public int Compare(object x, object y)
82 | {
83 | int compareResult;
84 | ListViewItem listviewX, listviewY;
85 |
86 | // Cast the objects to be compared to ListViewItem objects
87 | listviewX = (ListViewItem)x;
88 | listviewY = (ListViewItem)y;
89 |
90 | // Compare the two items
91 | try
92 | {
93 | // if the numeric sort (try) fails, then we want
94 | // to do the text sort (catch)
95 | compareResult = this.objectCompare.Compare(Convert.ToInt64(listviewX.SubItems[this.columnToSort].Text), Convert.ToInt64(listviewY.SubItems[this.columnToSort].Text));
96 | }
97 | catch
98 | {
99 | compareResult = this.objectCompare.Compare(listviewX.SubItems[this.columnToSort].Text, listviewY.SubItems[this.columnToSort].Text);
100 | }
101 |
102 | // Calculate correct return value based on object comparison
103 | if (this.orderOfSort == SortOrder.Ascending)
104 | {
105 | // Ascending sort is selected, return normal result of compare operation
106 | return compareResult;
107 | }
108 | else if (this.orderOfSort == SortOrder.Descending)
109 | {
110 | // Descending sort is selected, return negative result of compare operation
111 | return -compareResult;
112 | }
113 | else
114 | {
115 | // Return '0' to indicate they are equal
116 | return 0;
117 | }
118 | }
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/Torrentia/DetailsForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using System.Diagnostics;
11 |
12 | namespace Torrentia
13 | {
14 | public partial class DetailsForm : Form
15 | {
16 | TorrentzResult _result;
17 | TorrentzScraper _scraper = new TorrentzScraper();
18 | //string _magnet = string.Empty;
19 |
20 | public DetailsForm(TorrentzResult sr)
21 | {
22 | InitializeComponent();
23 | Options.ApplyTheme(this);
24 |
25 | _result = sr;
26 | }
27 |
28 | //private void OpenTorrentLink()
29 | //{
30 | // if (listResults.SelectedIndices.Count == 1)
31 | // {
32 | // try
33 | // {
34 | // Process.Start(_result.Links[listResults.SelectedIndices[0]]);
35 | // }
36 | // catch (Exception ex)
37 | // {
38 | // MessageBox.Show(ex.Message, "Torrentia", MessageBoxButtons.OK, MessageBoxIcon.Information);
39 | // }
40 | // }
41 | //}
42 |
43 | //private void CopyMagnetURI()
44 | //{
45 | // if (listResults.SelectedIndices.Count == 1)
46 | // {
47 | // try
48 | // {
49 | // _magnet = _scraper.GetMagnetUri(_result.Links[listResults.SelectedIndices[0]]);
50 | // Clipboard.SetText(_magnet);
51 | // }
52 | // catch (Exception ex)
53 | // {
54 | // MessageBox.Show(ex.Message);
55 | // _magnet = string.Empty;
56 | // }
57 | // }
58 | //}
59 |
60 | private void DetailsForm_Load(object sender, EventArgs e)
61 | {
62 | lblTorrent.Text = _result.Verified + " " + _result.Title;
63 | lblHash.Text += _result.InfoHash;
64 | txtContents.Text = _result.Contents.Trim();
65 |
66 | //int counter = 0;
67 | foreach (string x in _result.Trackers)
68 | {
69 | ListViewItem item = new ListViewItem(x);
70 |
71 | //if (counter <= _result.Dates.Count - 1)
72 | //{
73 | // item.SubItems.Add(_result.Dates[counter++]);
74 | //}
75 |
76 | listResults.Items.Add(item);
77 | }
78 |
79 | //listResults.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
80 | //listResults.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
81 | }
82 |
83 | private void listResults_MouseDoubleClick(object sender, MouseEventArgs e)
84 | {
85 | //if (listResults.SelectedIndices.Count == 1)
86 | //{
87 | // LaunchTorrentClient();
88 | //}
89 | }
90 |
91 | private void LaunchTorrentClient()
92 | {
93 | //try
94 | //{
95 | // _magnet = _scraper.GetMagnetUri(_result.Links[listResults.SelectedIndices[0]]);
96 | //}
97 | //catch (Exception ex)
98 | //{
99 | // MessageBox.Show(ex.Message, "Torrentia", MessageBoxButtons.OK, MessageBoxIcon.Information);
100 | // _magnet = string.Empty;
101 | //}
102 |
103 | //if (!string.IsNullOrEmpty(_magnet))
104 | //{
105 | // try
106 | // {
107 | // Process.Start(_magnet);
108 | // }
109 | // catch { }
110 | //}
111 | }
112 |
113 | private string GenerateMagnetLink()
114 | {
115 | string result = "magnet:?xt=urn:btih:" + _result.InfoHash;
116 |
117 | foreach (string x in _result.Trackers)
118 | {
119 | result += string.Format("&dn={0}&tr={1}", _result.Title, x.Replace("/", "%2F").Replace(":", "%3A"));
120 | }
121 |
122 | return result;
123 | }
124 |
125 | private void Download()
126 | {
127 | try
128 | {
129 | Process.Start(GenerateMagnetLink());
130 | }
131 | catch { }
132 | }
133 |
134 | private void CopyHash()
135 | {
136 | try
137 | {
138 | Clipboard.SetText(lblHash.Text.Replace("Info Hash: ", string.Empty), TextDataFormat.Text);
139 | }
140 | catch { }
141 | }
142 |
143 | private void btnCopyHash_Click(object sender, EventArgs e)
144 | {
145 | CopyHash();
146 | }
147 |
148 | private void btnDownload_Click(object sender, EventArgs e)
149 | {
150 | Download();
151 | }
152 | }
153 | }
154 |
--------------------------------------------------------------------------------
/Torrentia/AboutForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Diagnostics;
6 | using System.Drawing;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows.Forms;
11 |
12 | namespace Torrentia
13 | {
14 | public partial class AboutForm : Form
15 | {
16 | public AboutForm()
17 | {
18 | InitializeComponent();
19 | Options.ApplyTheme(this);
20 | CheckForIllegalCrossThreadCalls = false;
21 | }
22 |
23 | private void button7_Click(object sender, EventArgs e)
24 | {
25 | this.Close();
26 | }
27 |
28 | private void About_Load(object sender, EventArgs e)
29 | {
30 | t1.Interval = 50;
31 | t2.Interval = 50;
32 |
33 | t1.Start();
34 | }
35 |
36 | private void t2_Tick(object sender, EventArgs e)
37 | {
38 | string s0 = "";
39 | string s1 = "d";
40 | string s2 = "de";
41 | string s3 = "dea";
42 | string s4 = "dead";
43 | string s5 = "deadm";
44 | string s6 = "deadmo";
45 | string s7 = "deadmoo";
46 | string s8 = "deadmoon";
47 | string s9 = "deadmoon © ";
48 | string s10 = "deadmoon © 2";
49 | string s11 = "deadmoon © 20";
50 | string s12 = "deadmoon © 201";
51 | string s13 = "deadmoon © 2018";
52 |
53 | switch (l2.Text)
54 | {
55 | case "":
56 | l2.Text = s1;
57 | break;
58 | case "d":
59 | l2.Text = s2;
60 | break;
61 | case "de":
62 | l2.Text = s3;
63 | break;
64 | case "dea":
65 | l2.Text = s4;
66 | break;
67 | case "dead":
68 | l2.Text = s5;
69 | break;
70 | case "deadm":
71 | l2.Text = s6;
72 | break;
73 | case "deadmo":
74 | l2.Text = s7;
75 | break;
76 | case "deadmoo":
77 | l2.Text = s8;
78 | break;
79 | case "deadmoon":
80 | l2.Text = s9;
81 | break;
82 | case "deadmoon © ":
83 | l2.Text = s10;
84 | break;
85 | case "deadmoon © 2":
86 | l2.Text = s11;
87 | break;
88 | case "deadmoon © 20":
89 | l2.Text = s12;
90 | break;
91 | case "deadmoon © 201":
92 | l2.Text = s13;
93 | t2.Stop();
94 | //t1.Start();
95 | break;
96 | case "deadmoon © 2018":
97 | l2.Text = s0;
98 | break;
99 | }
100 | }
101 |
102 | private void l2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
103 | {
104 | Process.Start("https://elgaming.eu/deadmoon");
105 | }
106 |
107 | private void t1_Tick(object sender, EventArgs e)
108 | {
109 | const string s0 = "";
110 | const string s1 = "T";
111 | const string s2 = "To";
112 | const string s3 = "Tor";
113 | const string s4 = "Torr";
114 | const string s5 = "Torre";
115 | const string s6 = "Torren";
116 | const string s7 = "Torrent";
117 | const string s8 = "Torrenti";
118 | const string s9 = "Torrentia";
119 |
120 | switch (l1.Text)
121 | {
122 | case s0:
123 | l1.Text = s1;
124 | break;
125 | case s1:
126 | l1.Text = s2;
127 | break;
128 | case s2:
129 | l1.Text = s3;
130 | break;
131 | case s3:
132 | l1.Text = s4;
133 | break;
134 | case s4:
135 | l1.Text = s5;
136 | break;
137 | case s5:
138 | l1.Text = s6;
139 | break;
140 | case s6:
141 | l1.Text = s7;
142 | break;
143 | case s7:
144 | l1.Text = s8;
145 | break;
146 | case s8:
147 | l1.Text = s9;
148 | t1.Stop();
149 | t2.Start();
150 | break;
151 | case s9:
152 | l1.Text = s0;
153 | break;
154 | }
155 | }
156 | }
157 | }
158 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | _pkginfo.txt
179 |
180 | # Visual Studio cache files
181 | # files ending in .cache can be ignored
182 | *.[Cc]ache
183 | # but keep track of directories ending in .cache
184 | !*.[Cc]ache/
185 |
186 | # Others
187 | ClientBin/
188 | ~$*
189 | *~
190 | *.dbmdl
191 | *.dbproj.schemaview
192 | *.jfm
193 | *.pfx
194 | *.publishsettings
195 | node_modules/
196 | orleans.codegen.cs
197 |
198 | # Since there are multiple workflows, uncomment next line to ignore bower_components
199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
200 | #bower_components/
201 |
202 | # RIA/Silverlight projects
203 | Generated_Code/
204 |
205 | # Backup & report files from converting an old project file
206 | # to a newer Visual Studio version. Backup files are not needed,
207 | # because we have git ;-)
208 | _UpgradeReport_Files/
209 | Backup*/
210 | UpgradeLog*.XML
211 | UpgradeLog*.htm
212 |
213 | # SQL Server files
214 | *.mdf
215 | *.ldf
216 |
217 | # Business Intelligence projects
218 | *.rdl.data
219 | *.bim.layout
220 | *.bim_*.settings
221 |
222 | # Microsoft Fakes
223 | FakesAssemblies/
224 |
225 | # GhostDoc plugin setting file
226 | *.GhostDoc.xml
227 |
228 | # Node.js Tools for Visual Studio
229 | .ntvs_analysis.dat
230 |
231 | # Visual Studio 6 build log
232 | *.plg
233 |
234 | # Visual Studio 6 workspace options file
235 | *.opt
236 |
237 | # Visual Studio LightSwitch build output
238 | **/*.HTMLClient/GeneratedArtifacts
239 | **/*.DesktopClient/GeneratedArtifacts
240 | **/*.DesktopClient/ModelManifest.xml
241 | **/*.Server/GeneratedArtifacts
242 | **/*.Server/ModelManifest.xml
243 | _Pvt_Extensions
244 |
245 | # Paket dependency manager
246 | .paket/paket.exe
247 | paket-files/
248 |
249 | # FAKE - F# Make
250 | .fake/
251 |
252 | # JetBrains Rider
253 | .idea/
254 | *.sln.iml
255 |
256 | # CodeRush
257 | .cr/
258 |
259 | # Python Tools for Visual Studio (PTVS)
260 | __pycache__/
261 | *.pyc
--------------------------------------------------------------------------------
/Torrentia/DetailsForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Torrentia/OptionsForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Torrentia/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
--------------------------------------------------------------------------------
/Torrentia/Options.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.IO;
7 | using System.Drawing;
8 | using System.Windows.Forms;
9 | using Newtonsoft.Json;
10 |
11 | namespace Torrentia
12 | {
13 | public class SettingsJson
14 | {
15 | public Theme Color { get; set; }
16 | public bool AdultFilter { get; set; }
17 | public bool VerifiedOnly { get; set; }
18 | public Size WindowSize { get; set; }
19 | public Point? WindowLocation { get; set; }
20 | public FormWindowState WindowState { get; set; }
21 | }
22 |
23 | public class Options
24 | {
25 | internal static Color ForegroundColor = Color.MediumOrchid;
26 | internal static Color BackgroundColor = Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
27 |
28 | internal readonly static string ThemeFlag = "themeable";
29 | readonly static string SettingsFile = Application.StartupPath + "\\Torrentia.json";
30 |
31 | internal static SettingsJson CurrentOptions = new SettingsJson();
32 |
33 | internal static IEnumerable GetSelfAndChildrenRecursive(Control parent)
34 | {
35 | List controls = new List();
36 |
37 | foreach (Control child in parent.Controls)
38 | {
39 | controls.AddRange(GetSelfAndChildrenRecursive(child));
40 | }
41 |
42 | controls.Add(parent);
43 | return controls;
44 | }
45 |
46 | internal static void ApplyTheme(Form f)
47 | {
48 | switch (CurrentOptions.Color)
49 | {
50 | case Theme.Caramel:
51 | SetTheme(f, Color.DarkOrange, Color.Chocolate);
52 | break;
53 | case Theme.Lime:
54 | SetTheme(f, Color.LimeGreen, Color.ForestGreen);
55 | break;
56 | case Theme.Magma:
57 | SetTheme(f, Color.Tomato, Color.Red);
58 | break;
59 | case Theme.Minimal:
60 | SetTheme(f, Color.Gray, Color.DimGray);
61 | break;
62 | case Theme.Ocean:
63 | SetTheme(f, Color.DodgerBlue, Color.RoyalBlue);
64 | break;
65 | case Theme.Zerg:
66 | SetTheme(f, Color.MediumOrchid, Color.DarkOrchid);
67 | break;
68 | }
69 | }
70 |
71 | private static void SetTheme(Form f, Color c1, Color c2)
72 | {
73 | ForegroundColor = c1;
74 |
75 | GetSelfAndChildrenRecursive(f).OfType