├── IMDbAPI_Client ├── ProjectIcon.ico ├── Resources │ ├── OK.png │ ├── Cancel.png │ ├── Exit.png │ ├── IMDb.png │ ├── Search.png │ ├── GridLoad.png │ ├── Minimize.png │ ├── ViewSmall.png │ └── PictureNotAvailable.jpg ├── Models │ ├── Enums.cs │ ├── GridData.cs │ ├── ClientUtils.cs │ └── ClientOptions.cs ├── packages.config ├── Program.cs ├── UserControls │ ├── CastUserControl.cs │ ├── ToolbarUserControl.cs │ ├── PingItemUserControl.cs │ ├── PingItemUserControl.Designer.cs │ ├── CastUserControl.Designer.cs │ ├── ToolbarUserControl.Designer.cs │ ├── Step3_SettingsUC.cs │ ├── CastUserControl.resx │ ├── Step3_SettingsUC.resx │ ├── Step4_DownloadUC.resx │ ├── PingItemUserControl.resx │ ├── ToolbarUserControl.resx │ ├── Step1_InitUC.resx │ ├── Step2_SearchUC.resx │ ├── Step1_InitUC.cs │ ├── Step2_SearchUC.cs │ ├── Step4_DownloadUC.Designer.cs │ └── Step2_SearchUC.Designer.cs ├── SelectSeasonForm.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Settings.settings │ ├── Resources.Designer.cs │ ├── Settings.Designer.cs │ └── Resources.resx ├── ShutdownForm.cs ├── App.config ├── PingForm.cs ├── SettingsForm.cs ├── MoreInfoForm.cs ├── ShutdownForm.designer.cs ├── ShutdownForm.resx ├── SearchForm.cs ├── SelectSeasonForm.designer.cs ├── PingForm.designer.cs └── MainForm.cs ├── README.md ├── IMDbAPI_Client.sln ├── .gitattributes └── .gitignore /IMDbAPI_Client/ProjectIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IMDb-API/IMDbApiClient/HEAD/IMDbAPI_Client/ProjectIcon.ico -------------------------------------------------------------------------------- /IMDbAPI_Client/Resources/OK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IMDb-API/IMDbApiClient/HEAD/IMDbAPI_Client/Resources/OK.png -------------------------------------------------------------------------------- /IMDbAPI_Client/Resources/Cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IMDb-API/IMDbApiClient/HEAD/IMDbAPI_Client/Resources/Cancel.png -------------------------------------------------------------------------------- /IMDbAPI_Client/Resources/Exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IMDb-API/IMDbApiClient/HEAD/IMDbAPI_Client/Resources/Exit.png -------------------------------------------------------------------------------- /IMDbAPI_Client/Resources/IMDb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IMDb-API/IMDbApiClient/HEAD/IMDbAPI_Client/Resources/IMDb.png -------------------------------------------------------------------------------- /IMDbAPI_Client/Resources/Search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IMDb-API/IMDbApiClient/HEAD/IMDbAPI_Client/Resources/Search.png -------------------------------------------------------------------------------- /IMDbAPI_Client/Resources/GridLoad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IMDb-API/IMDbApiClient/HEAD/IMDbAPI_Client/Resources/GridLoad.png -------------------------------------------------------------------------------- /IMDbAPI_Client/Resources/Minimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IMDb-API/IMDbApiClient/HEAD/IMDbAPI_Client/Resources/Minimize.png -------------------------------------------------------------------------------- /IMDbAPI_Client/Resources/ViewSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IMDb-API/IMDbApiClient/HEAD/IMDbAPI_Client/Resources/ViewSmall.png -------------------------------------------------------------------------------- /IMDbAPI_Client/Resources/PictureNotAvailable.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IMDb-API/IMDbApiClient/HEAD/IMDbAPI_Client/Resources/PictureNotAvailable.jpg -------------------------------------------------------------------------------- /IMDbAPI_Client/Models/Enums.cs: -------------------------------------------------------------------------------- 1 | namespace IMDbAPI_Client 2 | { 3 | public enum OperationType 4 | { 5 | Movies, 6 | TVSeries, 7 | MovieFile 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /IMDbAPI_Client/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /IMDbAPI_Client/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.Windows.Forms; 4 | 5 | namespace IMDbAPI_Client 6 | { 7 | internal static class Program 8 | { 9 | /// 10 | /// The main entry point for the application. 11 | /// 12 | [STAThread] 13 | private static void Main() 14 | { 15 | Application.EnableVisualStyles(); 16 | Application.SetCompatibleTextRenderingDefault(false); 17 | Application.Run(new MainForm()); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/CastUserControl.cs: -------------------------------------------------------------------------------- 1 | using MetroFramework.Controls; 2 | using System.Drawing; 3 | 4 | namespace IMDbAPI_Client.UserControls 5 | { 6 | public partial class CastUserControl : MetroUserControl 7 | { 8 | public CastUserControl() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | public Image CastImage 14 | { 15 | set => picCastImage.Image = value; 16 | } 17 | 18 | public string CastName 19 | { 20 | set => lblCastName.Text = value; 21 | } 22 | 23 | public string CastAsCharacter 24 | { 25 | set => lblCastAsCharacter.Text = value; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TV-API (IMDb-Api) Client Application 2 | The TV-API is a web service for receiving movie, serial and cast information. APIs results is a JSON and includes items such as movie specifications, images, posters, trailers, ratings, Wikipedia page content and more. [TV-API](https://tv-api.com) 3 | 4 | ## Nuget 5 | Install from Nuget using the command: **Install-Package IMDbApiLib** View more about that here: https://nuget.org/packages/IMDbApiLib 6 | 7 | ## API Documentation 8 | [TV-API Documentation](https://tv-api.com/api) 9 | 10 | ## Screenshot 11 | ![TV-API Client](https://tv-api.com/img/imdb-api-client.png "TV-API Client") 12 | 13 | ## Download 14 | [Download latest version](https://github.com/IMDb-API/IMDbApiClient/releases) -------------------------------------------------------------------------------- /IMDbAPI_Client/Models/GridData.cs: -------------------------------------------------------------------------------- 1 | namespace IMDbAPI_Client 2 | { 3 | public class GridData 4 | { 5 | public GridData() 6 | { 7 | 8 | } 9 | 10 | public GridData(bool select, string folder, string fullTitle, string originalTitle, string id) 11 | { 12 | Select = select; 13 | Folder = folder; 14 | FullTitle = fullTitle; 15 | OriginalTitle = originalTitle; 16 | Id = id; 17 | } 18 | 19 | public bool Select { get; set; } 20 | public string Folder { get; set; } 21 | public string FullTitle { get; set; } 22 | public string OriginalTitle { get; set; } 23 | public string Id { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /IMDbAPI_Client.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29613.14 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IMDbAPI_Client", "IMDbAPI_Client\IMDbAPI_Client.csproj", "{D9610FC2-4BA0-4E98-A30B-D31E784FF896}" 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 | {D9610FC2-4BA0-4E98-A30B-D31E784FF896}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {D9610FC2-4BA0-4E98-A30B-D31E784FF896}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {D9610FC2-4BA0-4E98-A30B-D31E784FF896}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {D9610FC2-4BA0-4E98-A30B-D31E784FF896}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {58AC3A8D-18E7-47DC-A16B-6A7C641E5FE9} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /IMDbAPI_Client/SelectSeasonForm.cs: -------------------------------------------------------------------------------- 1 | using MetroFramework.Forms; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Windows.Forms; 5 | 6 | namespace IMDbAPI_Client 7 | { 8 | public partial class SelectSeasonForm : MetroForm 9 | { 10 | public SelectSeasonForm(string fullTitle, List seasons) 11 | { 12 | InitializeComponent(); 13 | 14 | this.Text = fullTitle; 15 | 16 | seasons.Insert(0, "All"); 17 | ddlSeasons.DataSource = seasons; 18 | } 19 | 20 | public int? SeasonNumber 21 | { 22 | get 23 | { 24 | if (string.IsNullOrEmpty(ddlSeasons.Text) || ddlSeasons.Text == "All") 25 | return null; 26 | 27 | return Convert.ToInt32(ddlSeasons.Text); 28 | } 29 | } 30 | 31 | private void SelectSeasonForm_Load(object sender, EventArgs e) 32 | { 33 | Theme = metroStyleManager1.Theme = Properties.Settings.Default.Theme; 34 | Style = metroStyleManager1.Style = Properties.Settings.Default.Style; 35 | } 36 | 37 | private void btnOK_Click(object sender, EventArgs e) 38 | { 39 | if (string.IsNullOrEmpty(ddlSeasons.Text)) 40 | return; 41 | 42 | this.DialogResult = DialogResult.OK; 43 | this.Close(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/ToolbarUserControl.cs: -------------------------------------------------------------------------------- 1 | using MetroFramework.Controls; 2 | using System; 3 | using System.ComponentModel; 4 | using System.Windows.Forms; 5 | 6 | namespace IMDbAPI_Client.UserControls 7 | { 8 | public partial class ToolbarUserControl : MetroUserControl 9 | { 10 | public ToolbarUserControl() 11 | { 12 | InitializeComponent(); 13 | 14 | MinimzeButton = true; 15 | } 16 | 17 | [DefaultValue(true)] 18 | public bool MinimzeButton 19 | { 20 | set => btnToolMinimize.Visible = value; 21 | get => btnToolMinimize.Visible; 22 | } 23 | 24 | private void btnToolExit_Click(object sender, EventArgs e) 25 | { 26 | if (ParentForm.GetType() == typeof(MainForm)) 27 | Application.Exit(); 28 | else 29 | ParentForm.Close(); 30 | } 31 | 32 | private void btnToolMinimize_Click(object sender, EventArgs e) 33 | { 34 | ParentForm.WindowState = FormWindowState.Minimized; 35 | } 36 | 37 | protected override void OnLoad(EventArgs e) 38 | { 39 | Theme = metroStyleManager1.Theme = Properties.Settings.Default.Theme; 40 | Style = metroStyleManager1.Style = Properties.Settings.Default.Style; 41 | 42 | if (ParentForm.GetType() != typeof(MainForm)) 43 | metroToolTip1.SetToolTip(btnToolExit, "Close"); 44 | 45 | base.OnLoad(e); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/PingItemUserControl.cs: -------------------------------------------------------------------------------- 1 | using MetroFramework.Controls; 2 | using System; 3 | using System.Diagnostics; 4 | 5 | namespace IMDbAPI_Client.UserControls 6 | { 7 | public partial class PingItemUserControl : MetroUserControl 8 | { 9 | public PingItemUserControl() 10 | { 11 | InitializeComponent(); 12 | 13 | Url = ""; 14 | Passed = false; 15 | } 16 | 17 | public PingItemUserControl(string url, bool passed) 18 | { 19 | InitializeComponent(); 20 | 21 | Url = url; 22 | Passed = passed; 23 | } 24 | 25 | public string Url 26 | { 27 | set 28 | { 29 | lnkUrl.Text = value; 30 | lnkUrl.Click += (sx, ox) => Process.Start($"https://{value}"); 31 | } 32 | get => lnkUrl.Text; 33 | } 34 | 35 | private bool _passed; 36 | public bool Passed 37 | { 38 | set 39 | { 40 | _passed = value; 41 | picPassed.Image = value ? Properties.Resources.OK : Properties.Resources.Cancel; 42 | } 43 | get => _passed; 44 | } 45 | 46 | protected override void OnLoad(EventArgs e) 47 | { 48 | Theme = metroStyleManager1.Theme = Properties.Settings.Default.Theme; 49 | Style = metroStyleManager1.Style = Properties.Settings.Default.Style; 50 | 51 | base.OnLoad(e); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /IMDbAPI_Client/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("IMDbAPI Client")] 8 | [assembly: AssemblyDescription("Manage and organize movies and series")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("TV-API")] 11 | [assembly: AssemblyProduct("IMDbAPI Client")] 12 | [assembly: AssemblyCopyright("Copyright © 2024")] 13 | [assembly: AssemblyTrademark("https://tv-api.com")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("d9610fc2-4ba0-4e98-a30b-d31e784ff896")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("2.0.1.0")] 35 | [assembly: AssemblyFileVersion("2.0.1.0")] 36 | -------------------------------------------------------------------------------- /IMDbAPI_Client/ShutdownForm.cs: -------------------------------------------------------------------------------- 1 | using IMDbApiLib; 2 | using MetroFramework.Forms; 3 | using System; 4 | using System.Windows.Forms; 5 | 6 | namespace IMDbAPI_Client 7 | { 8 | public partial class ShutdownForm : MetroForm 9 | { 10 | public ShutdownForm() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | private int _counter; 16 | 17 | private void ShutdownForm_Load(object sender, EventArgs e) 18 | { 19 | Theme = metroStyleManager1.Theme = Properties.Settings.Default.Theme; 20 | Style = metroStyleManager1.Style = Properties.Settings.Default.Style; 21 | 22 | _counter = progress.Maximum = progress.Value = 60; 23 | } 24 | 25 | private void ShutdownForm_Shown(object sender, EventArgs e) 26 | { 27 | timer1.Enabled = true; 28 | } 29 | 30 | private void timer1_Tick(object sender, EventArgs e) 31 | { 32 | if (_counter > 0) 33 | { 34 | progress.Value = _counter; 35 | lblShutdownTitle.Text = $"Shutting down PC after {_counter} seconds..."; 36 | _counter--; 37 | } 38 | 39 | if (_counter <= 0) 40 | { 41 | progress.Value = 0; 42 | lblShutdownTitle.Text = $"Shutting down..."; 43 | timer1.Enabled = false; 44 | ApiUtils.Shutdown(); 45 | } 46 | } 47 | 48 | private void btnCancel_Click(object sender, EventArgs e) 49 | { 50 | timer1.Enabled = false; 51 | 52 | DialogResult = DialogResult.Cancel; 53 | Close(); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /IMDbAPI_Client/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | D:\New Movies 7 | 8 | 9 | 10 | 11 | 12 | DownloadSiteName1 13 | DownloadSiteName2 14 | 15 | 16 | Default 17 | 18 | 19 | Default 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Movies 32 | 33 | 34 | False 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /IMDbAPI_Client/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | D:\New Movies 15 | 16 | 17 | 18 | 19 | 20 | DownloadSiteName1 21 | DownloadSiteName2 22 | 23 | 24 | Default 25 | 26 | 27 | Default 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | Movies 40 | 41 | 42 | False 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /IMDbAPI_Client/Models/ClientUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Imaging; 4 | using System.IO; 5 | 6 | namespace IMDbAPI_Client 7 | { 8 | public class ClientUtils 9 | { 10 | public static byte[] ImageToBytes(Image img) 11 | { 12 | return ImageToBytes(img, ImageFormat.Png); 13 | } 14 | 15 | public static byte[] ImageToBytes(Image img, Size size) 16 | { 17 | if (img == null) 18 | return null; 19 | 20 | if (img.Width > size.Width || img.Height > size.Height) 21 | img = ResizeImage(img, size); 22 | 23 | return ImageToBytes(img, ImageFormat.Png); 24 | } 25 | 26 | public static byte[] ImageToBytes(Image img, ImageFormat imgFormat) 27 | { 28 | if (img == null) 29 | return null; 30 | 31 | var ms = new MemoryStream(); 32 | img.Save(ms, imgFormat); 33 | return ms.ToArray(); 34 | } 35 | 36 | public static Image BytesToImage(byte[] bytes) 37 | { 38 | if (bytes == null) 39 | return null; 40 | 41 | var ms = new MemoryStream(bytes); 42 | var returnImage = Image.FromStream(ms); 43 | return returnImage; 44 | } 45 | 46 | public static Image BytesToImage(byte[] bytes, Size size) 47 | { 48 | if (bytes == null) 49 | return null; 50 | 51 | var img = BytesToImage(bytes); 52 | if (img.Width > size.Width || img.Height > size.Height) 53 | return ResizeImage(img, size); 54 | 55 | return img; 56 | } 57 | 58 | public static Image ResizeImage(Image img, Size size) 59 | { 60 | var ratioX = (double)size.Width / img.Width; 61 | var ratioY = (double)size.Height / img.Height; 62 | var ratio = Math.Min(ratioX, ratioY); 63 | 64 | var newWidth = (int)(img.Width * ratio); 65 | var newHeight = (int)(img.Height * ratio); 66 | 67 | var newImage = new Bitmap(newWidth, newHeight); 68 | 69 | using (var graphics = Graphics.FromImage(newImage)) 70 | graphics.DrawImage(img, 0, 0, newWidth, newHeight); 71 | 72 | return newImage; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /IMDbAPI_Client/PingForm.cs: -------------------------------------------------------------------------------- 1 | using IMDbAPI_Client.UserControls; 2 | using IMDbApiLib; 3 | using MetroFramework.Forms; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Drawing; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Windows.Forms; 11 | 12 | namespace IMDbAPI_Client 13 | { 14 | public partial class PingForm : MetroForm 15 | { 16 | public PingForm() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | private void PingForm_Load(object sender, EventArgs e) 22 | { 23 | Theme = metroStyleManager1.Theme = Properties.Settings.Default.Theme; 24 | Style = metroStyleManager1.Style = Properties.Settings.Default.Style; 25 | } 26 | 27 | private async void PingForm_Shown(object sender, EventArgs e) 28 | { 29 | ActiveControl = null; 30 | EnableControlls(false); 31 | 32 | var servers = new List() 33 | { 34 | "tv-api.com", 35 | "imdb.com", 36 | "wikipedia.org", 37 | "themoviedb.org", 38 | "youtube.com", 39 | //"subscene.com", 40 | //"rottentomatoes.com", 41 | //"www.metacritic.com", 42 | //"www.tv.com", 43 | //"thetvdb.com", 44 | //"filmaffinity.com", 45 | //"boxofficemojo.com", 46 | }; 47 | 48 | int passedCount = 0; 49 | flowLayoutPanel1.Controls.Clear(); 50 | foreach (string server in servers) 51 | { 52 | bool passed = await ApiUtils.PingAsync(server); 53 | 54 | if (passed) passedCount++; 55 | 56 | var itemUC = new PingItemUserControl(server, passed); 57 | flowLayoutPanel1.Controls.Add(itemUC); 58 | } 59 | 60 | 61 | bool success = passedCount == servers.Count; 62 | lblMessage.ForeColor = success ? Color.Green : Color.Crimson; 63 | 64 | var msg = new StringBuilder(); 65 | msg.Append($"Passed: {passedCount} of {servers.Count}"); 66 | if (success) 67 | msg.Append(" (successs)"); 68 | else 69 | msg.Append(" (Please use VPN)"); 70 | 71 | lblMessage.Text = msg.ToString(); 72 | 73 | EnableControlls(true); 74 | } 75 | 76 | private void EnableControlls(bool enabled) 77 | { 78 | Controls.Cast().Where(cx 79 | => cx.Name != toolbarUserControl1.Name 80 | && cx.Name != lblWaiting.Name 81 | && cx.Name != spinnerWaiting.Name) 82 | .ToList().ForEach(cx => cx.Enabled = enabled); 83 | 84 | lblWaiting.Visible = spinnerWaiting.Visible = !enabled; 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /IMDbAPI_Client/Models/ClientOptions.cs: -------------------------------------------------------------------------------- 1 | using IMDbApiLib.Models; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace IMDbAPI_Client 6 | { 7 | public class ClientOptions 8 | { 9 | // Default values 10 | public ClientOptions() 11 | { 12 | PlotLanguage = Language.en; 13 | Report_Ratings = true; 14 | Posters = true; 15 | Posters_EnglishOnly = true; 16 | Report = true; 17 | Images_Short = true; 18 | } 19 | 20 | public Language PlotLanguage { get; set; } 21 | 22 | 23 | public bool Report { get; set; } 24 | public bool Report_Ratings { get; set; } 25 | public bool Report_FullActor { get; set; } 26 | public bool Report_FullCast { get; set; } 27 | public bool Report_Wikipedia { get; set; } 28 | 29 | 30 | public bool Posters { get; set; } 31 | public bool Posters_AllLanguages { get; set; } 32 | public bool Posters_EnglishOnly { get; set; } 33 | 34 | 35 | public bool Images { get; set; } 36 | public bool Images_Short { get; set; } 37 | public bool Images_Full { get; set; } 38 | 39 | 40 | public bool Trailer { get; set; } 41 | 42 | public bool ExternalSites { get; set; } 43 | 44 | public bool ResizeImagesAndPosters { get; set; } 45 | 46 | public override string ToString() 47 | { 48 | var sb = new StringBuilder(); 49 | var lst = new List(); 50 | if (Report) 51 | { 52 | if (Report_Ratings) 53 | lst.Add("Ratings"); 54 | if (Report_FullActor) 55 | lst.Add("FullActor"); 56 | if (Report_FullCast) 57 | lst.Add("FullCast"); 58 | if (Report_Wikipedia) 59 | lst.Add("Wikipedia"); 60 | } 61 | 62 | if (Posters) 63 | lst.Add("Posters"); 64 | if (Images) 65 | lst.Add("Images"); 66 | if (Trailer) 67 | lst.Add("Trailer"); 68 | sb.Append(string.Join(",", lst)); 69 | 70 | return sb.ToString(); 71 | } 72 | 73 | public string ReportOptionsString 74 | { 75 | get 76 | { 77 | string reportOptions = ""; 78 | if (Report) 79 | { 80 | if (Report_Ratings) 81 | reportOptions += ",Ratings"; 82 | if (Report_FullActor) 83 | reportOptions += ",FullActor"; 84 | if (Report_FullCast) 85 | reportOptions += ",FullCast"; 86 | if (Report_Wikipedia) 87 | reportOptions += ",Wikipedia"; 88 | } 89 | 90 | return reportOptions; 91 | } 92 | 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /IMDbAPI_Client/SettingsForm.cs: -------------------------------------------------------------------------------- 1 | using IMDbAPI_Client.UserControls; 2 | using MetroFramework; 3 | using MetroFramework.Forms; 4 | using System; 5 | using System.Drawing; 6 | using System.Windows.Forms; 7 | 8 | namespace IMDbAPI_Client 9 | { 10 | public partial class SettingsForm : MetroForm 11 | { 12 | public SettingsForm() 13 | { 14 | InitializeComponent(); 15 | txtRemoveSiteName.Text = Properties.Settings.Default.RemoveSites; 16 | chkUseProxy.Checked = Properties.Settings.Default.UseProxy; 17 | txtProxyAddress.Text = Properties.Settings.Default.ProxyAddress; 18 | txtProxyUsername.Text = Properties.Settings.Default.ProxyUsername; 19 | txtProxyPassword.Text = Properties.Settings.Default.ProxyPassword; 20 | chkUseProxy_CheckedChanged(null, null); 21 | 22 | ddlTheme.DataSource = Enum.GetValues(typeof(MetroThemeStyle)); 23 | ddlTheme.SelectedItem = Properties.Settings.Default.Theme; 24 | ddlStyle.DataSource = Enum.GetValues(typeof(MetroColorStyle)); 25 | ddlStyle.SelectedItem = Properties.Settings.Default.Style; 26 | 27 | _settingsUC = new Step3_SettingsUC(true); 28 | _settingsUC.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom; 29 | tabOptions.Controls.Add(_settingsUC); 30 | } 31 | 32 | private Step3_SettingsUC _settingsUC; 33 | 34 | private void SettingsForm_Load(object sender, EventArgs e) 35 | { 36 | Theme = metroStyleManager1.Theme = Properties.Settings.Default.Theme; 37 | Style = metroStyleManager1.Style = Properties.Settings.Default.Style; 38 | 39 | ddlTheme.SelectedIndexChanged += DdlTheme_SelectedIndexChanged; 40 | ddlStyle.SelectedIndexChanged += DdlTheme_SelectedIndexChanged; 41 | DdlTheme_SelectedIndexChanged(null, null); 42 | } 43 | 44 | private void btnOK_Click(object sender, EventArgs e) 45 | { 46 | _settingsUC.SaveSettings(); 47 | 48 | Properties.Settings.Default.RemoveSites = txtRemoveSiteName.Text; 49 | Properties.Settings.Default.ProxyAddress = txtProxyAddress.Text; 50 | Properties.Settings.Default.ProxyUsername = txtProxyUsername.Text; 51 | Properties.Settings.Default.ProxyPassword = txtProxyPassword.Text; 52 | 53 | Properties.Settings.Default.Theme = (MetroThemeStyle)Enum.Parse(typeof(MetroThemeStyle), ddlTheme.Text); 54 | Properties.Settings.Default.Style = (MetroColorStyle)Enum.Parse(typeof(MetroColorStyle), ddlStyle.Text); 55 | 56 | Properties.Settings.Default.Save(); 57 | 58 | DialogResult = DialogResult.OK; 59 | Close(); 60 | } 61 | 62 | private void DdlTheme_SelectedIndexChanged(object sender, EventArgs e) 63 | { 64 | // Theme 65 | string colorName = "White"; 66 | switch (ddlTheme.Text) 67 | { 68 | case "Default": colorName = "White"; break; 69 | case "Light": colorName = "White"; break; 70 | case "Dark": colorName = "Black"; break; 71 | } 72 | pnlStyleViewer.BackColor = Color.FromName(colorName); 73 | 74 | // Style 75 | colorName = ddlStyle.Text; 76 | if (colorName == "Default" || colorName == "Blue") 77 | colorName = "SkyBlue"; 78 | lblStyleTitle.ForeColor = Color.FromName(colorName); 79 | lblStyleContent.ForeColor = Color.FromName(colorName); 80 | } 81 | 82 | private void chkUseProxy_CheckedChanged(object sender, EventArgs e) 83 | { 84 | lblProxyAddress.Enabled = 85 | txtProxyAddress.Enabled = 86 | lblProxyUsername.Enabled = 87 | txtProxyUsername.Enabled = 88 | lblProxyPassword.Enabled = 89 | txtProxyPassword.Enabled = chkUseProxy.Checked; 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/PingItemUserControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace IMDbAPI_Client.UserControls 2 | { 3 | partial class PingItemUserControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | this.metroStyleManager1 = new MetroFramework.Components.MetroStyleManager(this.components); 33 | this.metroToolTip1 = new MetroFramework.Components.MetroToolTip(); 34 | this.lnkUrl = new MetroFramework.Controls.MetroLink(); 35 | this.picPassed = new System.Windows.Forms.PictureBox(); 36 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).BeginInit(); 37 | ((System.ComponentModel.ISupportInitialize)(this.picPassed)).BeginInit(); 38 | this.SuspendLayout(); 39 | // 40 | // metroStyleManager1 41 | // 42 | this.metroStyleManager1.Owner = this; 43 | // 44 | // metroToolTip1 45 | // 46 | this.metroToolTip1.Style = MetroFramework.MetroColorStyle.Blue; 47 | this.metroToolTip1.StyleManager = null; 48 | this.metroToolTip1.Theme = MetroFramework.MetroThemeStyle.Light; 49 | // 50 | // lnkUrl 51 | // 52 | this.lnkUrl.Location = new System.Drawing.Point(3, 7); 53 | this.lnkUrl.Name = "lnkUrl"; 54 | this.lnkUrl.Size = new System.Drawing.Size(323, 23); 55 | this.lnkUrl.TabIndex = 0; 56 | this.lnkUrl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 57 | this.lnkUrl.UseSelectable = true; 58 | // 59 | // picPassed 60 | // 61 | this.picPassed.Location = new System.Drawing.Point(332, 2); 62 | this.picPassed.Name = "picPassed"; 63 | this.picPassed.Size = new System.Drawing.Size(45, 34); 64 | this.picPassed.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; 65 | this.picPassed.TabIndex = 1; 66 | this.picPassed.TabStop = false; 67 | // 68 | // PingItemUserControl 69 | // 70 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); 71 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 72 | this.Controls.Add(this.picPassed); 73 | this.Controls.Add(this.lnkUrl); 74 | this.Font = new System.Drawing.Font("Segoe UI", 9.75F); 75 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 76 | this.Name = "PingItemUserControl"; 77 | this.Size = new System.Drawing.Size(383, 38); 78 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).EndInit(); 79 | ((System.ComponentModel.ISupportInitialize)(this.picPassed)).EndInit(); 80 | this.ResumeLayout(false); 81 | 82 | } 83 | 84 | #endregion 85 | private MetroFramework.Components.MetroStyleManager metroStyleManager1; 86 | private MetroFramework.Components.MetroToolTip metroToolTip1; 87 | private MetroFramework.Controls.MetroLink lnkUrl; 88 | private System.Windows.Forms.PictureBox picPassed; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/CastUserControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace IMDbAPI_Client.UserControls 2 | { 3 | partial class CastUserControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.lblCastName = new MetroFramework.Controls.MetroLabel(); 32 | this.lblCastAsCharacter = new MetroFramework.Controls.MetroLabel(); 33 | this.picCastImage = new System.Windows.Forms.PictureBox(); 34 | ((System.ComponentModel.ISupportInitialize)(this.picCastImage)).BeginInit(); 35 | this.SuspendLayout(); 36 | // 37 | // lblCastName 38 | // 39 | this.lblCastName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 40 | | System.Windows.Forms.AnchorStyles.Right))); 41 | this.lblCastName.FontWeight = MetroFramework.MetroLabelWeight.Regular; 42 | this.lblCastName.Location = new System.Drawing.Point(3, 147); 43 | this.lblCastName.Name = "lblCastName"; 44 | this.lblCastName.Size = new System.Drawing.Size(130, 19); 45 | this.lblCastName.TabIndex = 16; 46 | this.lblCastName.Text = "-"; 47 | this.lblCastName.TextAlign = System.Drawing.ContentAlignment.TopCenter; 48 | this.lblCastName.UseStyleColors = true; 49 | // 50 | // lblCastAsCharacter 51 | // 52 | this.lblCastAsCharacter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 53 | | System.Windows.Forms.AnchorStyles.Right))); 54 | this.lblCastAsCharacter.FontSize = MetroFramework.MetroLabelSize.Small; 55 | this.lblCastAsCharacter.Location = new System.Drawing.Point(3, 169); 56 | this.lblCastAsCharacter.Name = "lblCastAsCharacter"; 57 | this.lblCastAsCharacter.Size = new System.Drawing.Size(130, 21); 58 | this.lblCastAsCharacter.TabIndex = 17; 59 | this.lblCastAsCharacter.Text = "-"; 60 | this.lblCastAsCharacter.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 61 | // 62 | // picCastImage 63 | // 64 | this.picCastImage.Location = new System.Drawing.Point(22, 12); 65 | this.picCastImage.Name = "picCastImage"; 66 | this.picCastImage.Size = new System.Drawing.Size(96, 132); 67 | this.picCastImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 68 | this.picCastImage.TabIndex = 15; 69 | this.picCastImage.TabStop = false; 70 | // 71 | // CastUserControl 72 | // 73 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 74 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 75 | this.Controls.Add(this.lblCastName); 76 | this.Controls.Add(this.lblCastAsCharacter); 77 | this.Controls.Add(this.picCastImage); 78 | this.Name = "CastUserControl"; 79 | this.Size = new System.Drawing.Size(136, 205); 80 | ((System.ComponentModel.ISupportInitialize)(this.picCastImage)).EndInit(); 81 | this.ResumeLayout(false); 82 | 83 | } 84 | 85 | #endregion 86 | 87 | private MetroFramework.Controls.MetroLabel lblCastName; 88 | private MetroFramework.Controls.MetroLabel lblCastAsCharacter; 89 | private System.Windows.Forms.PictureBox picCastImage; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /IMDbAPI_Client/MoreInfoForm.cs: -------------------------------------------------------------------------------- 1 | using IMDbAPI_Client.UserControls; 2 | using IMDbApiLib; 3 | using IMDbApiLib.Models; 4 | using MetroFramework; 5 | using MetroFramework.Forms; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Data; 9 | using System.Linq; 10 | using System.Net; 11 | using System.Windows.Forms; 12 | 13 | namespace IMDbAPI_Client 14 | { 15 | public partial class MoreInfoForm : MetroForm 16 | { 17 | public MoreInfoForm(string id) 18 | { 19 | InitializeComponent(); 20 | _id = id; 21 | 22 | string apiKey = Properties.Settings.Default.ApiKey; 23 | if (Properties.Settings.Default.UseProxy) 24 | _apiLib = new ApiLib(apiKey, 25 | Properties.Settings.Default.ProxyAddress, 26 | Properties.Settings.Default.ProxyUsername, 27 | Properties.Settings.Default.ProxyPassword); 28 | else 29 | _apiLib = new ApiLib(apiKey); 30 | } 31 | 32 | private readonly ApiLib _apiLib; 33 | private readonly string _id; 34 | 35 | private void MoreInfoForm_Load(object sender, EventArgs e) 36 | { 37 | Theme = metroStyleManager1.Theme = Properties.Settings.Default.Theme; 38 | Style = metroStyleManager1.Style = Properties.Settings.Default.Style; 39 | } 40 | 41 | private async void MoreInfoForm_Shown(object sender, EventArgs e) 42 | { 43 | ActiveControl = null; 44 | EnableControlls(false); 45 | var data = await _apiLib.TitleAsync(_id); 46 | if (!string.IsNullOrEmpty(data.ErrorMessage)) 47 | { 48 | MetroMessageBox.Show(this, data.ErrorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 49 | EnableControlls(true); 50 | return; 51 | } 52 | this.Text = data.Title; 53 | lblFullTitle.Text = data.FullTitle; 54 | lblOriginalTitle.Text = data.OriginalTitle; 55 | if (string.IsNullOrEmpty(lblOriginalTitle.Text)) 56 | lblOriginalTitle.Visible = false; 57 | if (string.IsNullOrEmpty(data.PlotLocal)) 58 | txtPlot.Text = data.Plot; 59 | else 60 | { 61 | txtPlot.Text = data.PlotLocal; 62 | if (data.PlotLocalIsRtl) 63 | txtPlot.RightToLeft = RightToLeft.Yes; 64 | } 65 | 66 | var creators = new List(); 67 | if (data.DirectorList != null) 68 | creators.AddRange(data.DirectorList); 69 | if (data.WriterList != null) 70 | creators.AddRange(data.WriterList); 71 | if (data.TvSeriesInfo != null && !string.IsNullOrEmpty(data.TvSeriesInfo.Creators)) 72 | creators.AddRange(data.TvSeriesInfo.CreatorList); 73 | 74 | txtPlot.Visible = lblCreatorsTitle.Visible = lblCountryTitle.Visible = lblCompanyTitle.Visible = lblRuntimeTitle.Visible = lblGenreTitle.Visible = true; 75 | 76 | lblCreators.Text = string.Join(", ", creators.Select(cx => cx.Name).Distinct()); 77 | lblCountry.Text = string.Join(", ", data.CountryList.Select(cx => cx.Key)); 78 | lblCompany.Text = data.Companies; 79 | lblRuntime.Text = data.RuntimeStr; 80 | lblGenre.Text = string.Join(", ", data.GenreList.Select(cx => cx.Key)); 81 | if (Properties.Settings.Default.ClientOptions.ResizeImagesAndPosters) 82 | { 83 | var imageBytes = await _apiLib.ResizeImageAsync("224x308", data.Image); 84 | picPoster.Image = ClientUtils.BytesToImage(imageBytes); 85 | } 86 | else 87 | { 88 | var imageBytes = await ApiUtils.GetBytesAsync(data.Image); 89 | picPoster.Image = ClientUtils.BytesToImage(imageBytes); 90 | } 91 | foreach (var act in data.ActorList.Take(6)) 92 | { 93 | var uc = new CastUserControl(); 94 | if (Properties.Settings.Default.ClientOptions.ResizeImagesAndPosters) 95 | { 96 | var imageBytes = await _apiLib.ResizeImageAsync("96x132", act.Image); 97 | uc.CastImage = ClientUtils.BytesToImage(imageBytes); 98 | } 99 | else 100 | { 101 | var imageBytes = await ApiUtils.GetBytesAsync(act.Image); 102 | uc.CastImage = ClientUtils.BytesToImage(imageBytes); 103 | } 104 | uc.CastName = act.Name; 105 | uc.CastAsCharacter = act.AsCharacter; 106 | 107 | flowLayoutPanel1.Controls.Add(uc); 108 | } 109 | EnableControlls(true); 110 | } 111 | 112 | private void EnableControlls(bool enabled) 113 | { 114 | btnIMDb.Enabled = enabled; 115 | lblWaiting.Visible = spinnerWaiting.Visible = !enabled; 116 | } 117 | 118 | private void btnIMDb_Click(object sender, EventArgs e) 119 | { 120 | System.Diagnostics.Process.Start($"https://www.imdb.com/title/{_id}"); 121 | } 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/ToolbarUserControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace IMDbAPI_Client.UserControls 2 | { 3 | partial class ToolbarUserControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | this.metroStyleManager1 = new MetroFramework.Components.MetroStyleManager(this.components); 33 | this.btnToolMinimize = new System.Windows.Forms.Button(); 34 | this.btnToolExit = new System.Windows.Forms.Button(); 35 | this.metroToolTip1 = new MetroFramework.Components.MetroToolTip(); 36 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).BeginInit(); 37 | this.SuspendLayout(); 38 | // 39 | // metroStyleManager1 40 | // 41 | this.metroStyleManager1.Owner = this; 42 | // 43 | // btnToolMinimize 44 | // 45 | this.btnToolMinimize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 46 | this.btnToolMinimize.FlatAppearance.BorderSize = 0; 47 | this.btnToolMinimize.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 48 | this.btnToolMinimize.Image = global::IMDbAPI_Client.Properties.Resources.Minimize; 49 | this.btnToolMinimize.Location = new System.Drawing.Point(6, 4); 50 | this.btnToolMinimize.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 51 | this.btnToolMinimize.Name = "btnToolMinimize"; 52 | this.btnToolMinimize.Size = new System.Drawing.Size(47, 52); 53 | this.btnToolMinimize.TabIndex = 5; 54 | this.btnToolMinimize.TabStop = false; 55 | this.metroToolTip1.SetToolTip(this.btnToolMinimize, "Minimize"); 56 | this.btnToolMinimize.UseVisualStyleBackColor = true; 57 | this.btnToolMinimize.Click += new System.EventHandler(this.btnToolMinimize_Click); 58 | // 59 | // btnToolExit 60 | // 61 | this.btnToolExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 62 | this.btnToolExit.DialogResult = System.Windows.Forms.DialogResult.Cancel; 63 | this.btnToolExit.FlatAppearance.BorderSize = 0; 64 | this.btnToolExit.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 65 | this.btnToolExit.Image = global::IMDbAPI_Client.Properties.Resources.Exit; 66 | this.btnToolExit.Location = new System.Drawing.Point(57, 4); 67 | this.btnToolExit.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 68 | this.btnToolExit.Name = "btnToolExit"; 69 | this.btnToolExit.Size = new System.Drawing.Size(47, 52); 70 | this.btnToolExit.TabIndex = 4; 71 | this.btnToolExit.TabStop = false; 72 | this.metroToolTip1.SetToolTip(this.btnToolExit, "Exit"); 73 | this.btnToolExit.UseVisualStyleBackColor = true; 74 | this.btnToolExit.Click += new System.EventHandler(this.btnToolExit_Click); 75 | // 76 | // metroToolTip1 77 | // 78 | this.metroToolTip1.Style = MetroFramework.MetroColorStyle.Blue; 79 | this.metroToolTip1.StyleManager = null; 80 | this.metroToolTip1.Theme = MetroFramework.MetroThemeStyle.Light; 81 | // 82 | // ToolbarUserControl 83 | // 84 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); 85 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 86 | this.Controls.Add(this.btnToolMinimize); 87 | this.Controls.Add(this.btnToolExit); 88 | this.Font = new System.Drawing.Font("Segoe UI", 9.75F); 89 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 90 | this.Name = "ToolbarUserControl"; 91 | this.Size = new System.Drawing.Size(108, 62); 92 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).EndInit(); 93 | this.ResumeLayout(false); 94 | 95 | } 96 | 97 | #endregion 98 | 99 | private System.Windows.Forms.Button btnToolMinimize; 100 | private System.Windows.Forms.Button btnToolExit; 101 | private MetroFramework.Components.MetroStyleManager metroStyleManager1; 102 | private MetroFramework.Components.MetroToolTip metroToolTip1; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/Step3_SettingsUC.cs: -------------------------------------------------------------------------------- 1 | using IMDbApiLib; 2 | using IMDbApiLib.Models; 3 | using MetroFramework; 4 | using MetroFramework.Controls; 5 | using System; 6 | using System.Drawing; 7 | using System.Windows.Forms; 8 | 9 | namespace IMDbAPI_Client.UserControls 10 | { 11 | public partial class Step3_SettingsUC : MetroUserControl 12 | { 13 | public Step3_SettingsUC(bool visibleResizeImageOption = false) 14 | { 15 | InitializeComponent(); 16 | 17 | if (Properties.Settings.Default.ClientOptions is null) 18 | { 19 | Properties.Settings.Default.ClientOptions = new ClientOptions(); 20 | Properties.Settings.Default.Save(); 21 | } 22 | 23 | #region Languages 24 | ddlPlotLanguage.DataSource = new BindingSource(ApiUtils.Languages, null); 25 | ddlPlotLanguage.DisplayMember = "Key"; 26 | ddlPlotLanguage.ValueMember = "Value"; 27 | #endregion 28 | 29 | Options = Properties.Settings.Default.ClientOptions; 30 | chkResizeImagesAndPosters.Visible = visibleResizeImageOption; 31 | } 32 | 33 | public ClientOptions Options 34 | { 35 | set 36 | { 37 | ddlPlotLanguage.SelectedValue = value.PlotLanguage.ToString().ToLower(); 38 | 39 | chkPosters.Checked = value.Posters; 40 | rbPosters_AllLanguages.Checked = value.Posters_AllLanguages; 41 | rbPosters_EnglishOnly.Checked = value.Posters_EnglishOnly; 42 | 43 | chkReport.Checked = value.Report; 44 | chkReport_Ratings.Checked = value.Report_Ratings; 45 | chkReport_FullActor.Checked = value.Report_FullActor; 46 | chkReport_FullCast.Checked = value.Report_FullCast; 47 | chkReport_Wikipedia.Checked = value.Report_Wikipedia; 48 | 49 | chkImages.Checked = value.Images; 50 | rbImages_Short.Checked = value.Images_Short; 51 | rbImages_Full.Checked = value.Images_Full; 52 | 53 | chkTrailer.Checked = value.Trailer; 54 | 55 | chkExternalSites.Checked = value.ExternalSites; 56 | chkResizeImagesAndPosters.Checked = value.ResizeImagesAndPosters; 57 | 58 | chkPosters_CheckedChanged(null, null); 59 | chkReport_CheckedChanged(null, null); 60 | chkImages_CheckedChanged(null, null); 61 | } 62 | get 63 | { 64 | var opt = new ClientOptions(); 65 | opt.PlotLanguage = (Language)Enum.Parse(typeof(Language), ddlPlotLanguage.SelectedValue.ToString(), true); 66 | opt.Posters = chkPosters.Checked; 67 | opt.Posters_AllLanguages = rbPosters_AllLanguages.Checked; 68 | opt.Posters_EnglishOnly = rbPosters_EnglishOnly.Checked; 69 | opt.Report = chkReport.Checked; 70 | opt.Report_Ratings = chkReport_Ratings.Checked; 71 | opt.Report_FullActor = chkReport_FullActor.Checked; 72 | opt.Report_FullCast = chkReport_FullCast.Checked; 73 | opt.Report_Wikipedia = chkReport_Wikipedia.Checked; 74 | opt.Images = chkImages.Checked; 75 | opt.Images_Short = rbImages_Short.Checked; 76 | opt.Images_Full = rbImages_Full.Checked; 77 | opt.Trailer = chkTrailer.Checked; 78 | opt.ExternalSites = chkExternalSites.Checked; 79 | opt.ResizeImagesAndPosters = chkResizeImagesAndPosters.Checked; 80 | 81 | return opt; 82 | } 83 | } 84 | 85 | public string Title => "Step III: Settings"; 86 | 87 | private void chkReport_CheckedChanged(object sender, EventArgs e) 88 | { 89 | grpReport.Enabled = chkReport.Checked; 90 | } 91 | 92 | private void chkImages_CheckedChanged(object sender, EventArgs e) 93 | { 94 | grpImages.Enabled = chkImages.Checked; 95 | } 96 | 97 | private void chkPosters_CheckedChanged(object sender, EventArgs e) 98 | { 99 | grpPosters.Enabled = chkPosters.Checked; 100 | } 101 | 102 | public void SaveSettings() 103 | { 104 | Properties.Settings.Default.ClientOptions = Options; 105 | Properties.Settings.Default.Save(); 106 | } 107 | 108 | protected override void OnLoad(EventArgs e) 109 | { 110 | Theme = metroStyleManager1.Theme = Properties.Settings.Default.Theme; 111 | Style = metroStyleManager1.Style = Properties.Settings.Default.Style; 112 | 113 | if (Theme == MetroThemeStyle.Dark) 114 | grpReport.ForeColor = grpPosters.ForeColor = grpImages.ForeColor = Color.Silver; 115 | else 116 | grpReport.ForeColor = grpPosters.ForeColor = grpImages.ForeColor = Color.Black; 117 | 118 | base.OnLoad(e); 119 | } 120 | 121 | public string InvalidMessage 122 | { 123 | get 124 | { 125 | if (!chkReport.Checked && !chkPosters.Checked && !chkImages.Checked && !chkTrailer.Checked && !chkExternalSites.Checked) 126 | return "Please choose one or more items to download"; 127 | 128 | return string.Empty; 129 | } 130 | } 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/CastUserControl.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 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/Step3_SettingsUC.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 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/Step4_DownloadUC.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 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /IMDbAPI_Client/ShutdownForm.designer.cs: -------------------------------------------------------------------------------- 1 | namespace IMDbAPI_Client 2 | { 3 | partial class ShutdownForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | this.progress = new MetroFramework.Controls.MetroProgressBar(); 33 | this.lblShutdownTitle = new MetroFramework.Controls.MetroLabel(); 34 | this.metroStyleManager1 = new MetroFramework.Components.MetroStyleManager(this.components); 35 | this.btnCancel = new System.Windows.Forms.Button(); 36 | this.timer1 = new System.Windows.Forms.Timer(this.components); 37 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).BeginInit(); 38 | this.SuspendLayout(); 39 | // 40 | // progress 41 | // 42 | this.progress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 43 | | System.Windows.Forms.AnchorStyles.Right))); 44 | this.progress.Location = new System.Drawing.Point(35, 130); 45 | this.progress.Name = "progress"; 46 | this.progress.Size = new System.Drawing.Size(751, 76); 47 | this.progress.TabIndex = 7; 48 | // 49 | // lblShutdownTitle 50 | // 51 | this.lblShutdownTitle.AutoSize = true; 52 | this.lblShutdownTitle.FontSize = MetroFramework.MetroLabelSize.Tall; 53 | this.lblShutdownTitle.FontWeight = MetroFramework.MetroLabelWeight.Regular; 54 | this.lblShutdownTitle.Location = new System.Drawing.Point(35, 97); 55 | this.lblShutdownTitle.Name = "lblShutdownTitle"; 56 | this.lblShutdownTitle.Size = new System.Drawing.Size(303, 25); 57 | this.lblShutdownTitle.TabIndex = 8; 58 | this.lblShutdownTitle.Text = "Shutting down PC after 60 seconds..."; 59 | this.lblShutdownTitle.UseStyleColors = true; 60 | // 61 | // metroStyleManager1 62 | // 63 | this.metroStyleManager1.Owner = this; 64 | // 65 | // btnCancel 66 | // 67 | this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 68 | this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(209)))), ((int)(((byte)(17)))), ((int)(((byte)(65))))); 69 | this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 70 | this.btnCancel.FlatAppearance.BorderSize = 0; 71 | this.btnCancel.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(77)))), ((int)(((byte)(95))))); 72 | this.btnCancel.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(77)))), ((int)(((byte)(65))))); 73 | this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 74 | this.btnCancel.ForeColor = System.Drawing.Color.White; 75 | this.btnCancel.Location = new System.Drawing.Point(667, 238); 76 | this.btnCancel.Name = "btnCancel"; 77 | this.btnCancel.Size = new System.Drawing.Size(119, 49); 78 | this.btnCancel.TabIndex = 29; 79 | this.btnCancel.Text = "&CANCEL"; 80 | this.btnCancel.UseVisualStyleBackColor = false; 81 | this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); 82 | // 83 | // timer1 84 | // 85 | this.timer1.Interval = 1000; 86 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick); 87 | // 88 | // ShutdownForm 89 | // 90 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); 91 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 92 | this.CancelButton = this.btnCancel; 93 | this.ClientSize = new System.Drawing.Size(822, 317); 94 | this.ControlBox = false; 95 | this.Controls.Add(this.btnCancel); 96 | this.Controls.Add(this.lblShutdownTitle); 97 | this.Controls.Add(this.progress); 98 | this.Font = new System.Drawing.Font("Segoe UI", 9.75F); 99 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 100 | this.MinimumSize = new System.Drawing.Size(822, 317); 101 | this.Name = "ShutdownForm"; 102 | this.Padding = new System.Windows.Forms.Padding(23, 79, 23, 27); 103 | this.Resizable = false; 104 | this.Text = "Shutting down..."; 105 | this.TopMost = true; 106 | this.Load += new System.EventHandler(this.ShutdownForm_Load); 107 | this.Shown += new System.EventHandler(this.ShutdownForm_Shown); 108 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).EndInit(); 109 | this.ResumeLayout(false); 110 | this.PerformLayout(); 111 | 112 | } 113 | 114 | #endregion 115 | 116 | private MetroFramework.Controls.MetroProgressBar progress; 117 | private MetroFramework.Controls.MetroLabel lblShutdownTitle; 118 | private MetroFramework.Components.MetroStyleManager metroStyleManager1; 119 | private System.Windows.Forms.Button btnCancel; 120 | private System.Windows.Forms.Timer timer1; 121 | } 122 | } -------------------------------------------------------------------------------- /IMDbAPI_Client/ShutdownForm.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 | 17, 17 122 | 123 | 124 | 183, 17 125 | 126 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/PingItemUserControl.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 | 17, 17 122 | 123 | 124 | 183, 17 125 | 126 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/ToolbarUserControl.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 | 17, 17 122 | 123 | 124 | 183, 17 125 | 126 | -------------------------------------------------------------------------------- /IMDbAPI_Client/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 IMDbAPI_Client.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", "16.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("IMDbAPI_Client.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 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap Cancel { 67 | get { 68 | object obj = ResourceManager.GetObject("Cancel", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap Exit { 77 | get { 78 | object obj = ResourceManager.GetObject("Exit", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap GridLoad { 87 | get { 88 | object obj = ResourceManager.GetObject("GridLoad", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap IMDb { 97 | get { 98 | object obj = ResourceManager.GetObject("IMDb", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Drawing.Bitmap. 105 | /// 106 | internal static System.Drawing.Bitmap Minimize { 107 | get { 108 | object obj = ResourceManager.GetObject("Minimize", resourceCulture); 109 | return ((System.Drawing.Bitmap)(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Drawing.Bitmap. 115 | /// 116 | internal static System.Drawing.Bitmap OK { 117 | get { 118 | object obj = ResourceManager.GetObject("OK", resourceCulture); 119 | return ((System.Drawing.Bitmap)(obj)); 120 | } 121 | } 122 | 123 | /// 124 | /// Looks up a localized resource of type System.Drawing.Bitmap. 125 | /// 126 | internal static System.Drawing.Bitmap PictureNotAvailable { 127 | get { 128 | object obj = ResourceManager.GetObject("PictureNotAvailable", resourceCulture); 129 | return ((System.Drawing.Bitmap)(obj)); 130 | } 131 | } 132 | 133 | /// 134 | /// Looks up a localized resource of type System.Drawing.Bitmap. 135 | /// 136 | internal static System.Drawing.Bitmap Search { 137 | get { 138 | object obj = ResourceManager.GetObject("Search", resourceCulture); 139 | return ((System.Drawing.Bitmap)(obj)); 140 | } 141 | } 142 | 143 | /// 144 | /// Looks up a localized resource of type System.Drawing.Bitmap. 145 | /// 146 | internal static System.Drawing.Bitmap ViewSmall { 147 | get { 148 | object obj = ResourceManager.GetObject("ViewSmall", resourceCulture); 149 | return ((System.Drawing.Bitmap)(obj)); 150 | } 151 | } 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/Step1_InitUC.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 | 17, 17 122 | 123 | 124 | 349, 17 125 | 126 | 127 | 183, 17 128 | 129 | 130 | 481, 17 131 | 132 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | lib/ 33 | # Uncomment if you have tasks that create the project's static files in wwwroot 34 | #wwwroot/ 35 | 36 | # Visual Studio 2017 auto generated files 37 | Generated\ Files/ 38 | 39 | # MSTest test Results 40 | [Tt]est[Rr]esult*/ 41 | [Bb]uild[Ll]og.* 42 | 43 | # NUNIT 44 | *.VisualState.xml 45 | TestResult.xml 46 | 47 | # Build Results of an ATL Project 48 | [Dd]ebugPS/ 49 | [Rr]eleasePS/ 50 | dlldata.c 51 | 52 | # Benchmark Results 53 | BenchmarkDotNet.Artifacts/ 54 | 55 | # .NET Core 56 | project.lock.json 57 | project.fragment.lock.json 58 | artifacts/ 59 | 60 | # StyleCop 61 | StyleCopReport.xml 62 | 63 | # Files built by Visual Studio 64 | *_i.c 65 | *_p.c 66 | *_h.h 67 | *.ilk 68 | *.meta 69 | *.obj 70 | *.iobj 71 | *.pch 72 | *.pdb 73 | *.ipdb 74 | *.pgc 75 | *.pgd 76 | *.rsp 77 | *.sbr 78 | *.tlb 79 | *.tli 80 | *.tlh 81 | *.tmp 82 | *.tmp_proj 83 | *_wpftmp.csproj 84 | *.log 85 | *.vspscc 86 | *.vssscc 87 | .builds 88 | *.pidb 89 | *.svclog 90 | *.scc 91 | 92 | # Chutzpah Test files 93 | _Chutzpah* 94 | 95 | # Visual C++ cache files 96 | ipch/ 97 | *.aps 98 | *.ncb 99 | *.opendb 100 | *.opensdf 101 | *.sdf 102 | *.cachefile 103 | *.VC.db 104 | *.VC.VC.opendb 105 | 106 | # Visual Studio profiler 107 | *.psess 108 | *.vsp 109 | *.vspx 110 | *.sap 111 | 112 | # Visual Studio Trace Files 113 | *.e2e 114 | 115 | # TFS 2012 Local Workspace 116 | $tf/ 117 | 118 | # Guidance Automation Toolkit 119 | *.gpState 120 | 121 | # ReSharper is a .NET coding add-in 122 | _ReSharper*/ 123 | *.[Rr]e[Ss]harper 124 | *.DotSettings.user 125 | 126 | # JustCode is a .NET coding add-in 127 | .JustCode 128 | 129 | # TeamCity is a build add-in 130 | _TeamCity* 131 | 132 | # DotCover is a Code Coverage Tool 133 | *.dotCover 134 | 135 | # AxoCover is a Code Coverage Tool 136 | .axoCover/* 137 | !.axoCover/settings.json 138 | 139 | # Visual Studio code coverage results 140 | *.coverage 141 | *.coveragexml 142 | 143 | # NCrunch 144 | _NCrunch_* 145 | .*crunch*.local.xml 146 | nCrunchTemp_* 147 | 148 | # MightyMoose 149 | *.mm.* 150 | AutoTest.Net/ 151 | 152 | # Web workbench (sass) 153 | .sass-cache/ 154 | 155 | # Installshield output folder 156 | [Ee]xpress/ 157 | 158 | # DocProject is a documentation generator add-in 159 | DocProject/buildhelp/ 160 | DocProject/Help/*.HxT 161 | DocProject/Help/*.HxC 162 | DocProject/Help/*.hhc 163 | DocProject/Help/*.hhk 164 | DocProject/Help/*.hhp 165 | DocProject/Help/Html2 166 | DocProject/Help/html 167 | 168 | # Click-Once directory 169 | publish/ 170 | 171 | # Publish Web Output 172 | *.[Pp]ublish.xml 173 | *.azurePubxml 174 | # Note: Comment the next line if you want to checkin your web deploy settings, 175 | # but database connection strings (with potential passwords) will be unencrypted 176 | *.pubxml 177 | *.publishproj 178 | 179 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 180 | # checkin your Azure Web App publish settings, but sensitive information contained 181 | # in these scripts will be unencrypted 182 | PublishScripts/ 183 | 184 | # NuGet Packages 185 | *.nupkg 186 | # The packages folder can be ignored because of Package Restore 187 | **/[Pp]ackages/* 188 | # except build/, which is used as an MSBuild target. 189 | !**/[Pp]ackages/build/ 190 | # Uncomment if necessary however generally it will be regenerated when needed 191 | #!**/[Pp]ackages/repositories.config 192 | # NuGet v3's project.json files produces more ignorable files 193 | *.nuget.props 194 | *.nuget.targets 195 | 196 | # Microsoft Azure Build Output 197 | csx/ 198 | *.build.csdef 199 | 200 | # Microsoft Azure Emulator 201 | ecf/ 202 | rcf/ 203 | 204 | # Windows Store app package directories and files 205 | AppPackages/ 206 | BundleArtifacts/ 207 | Package.StoreAssociation.xml 208 | _pkginfo.txt 209 | *.appx 210 | 211 | # Visual Studio cache files 212 | # files ending in .cache can be ignored 213 | *.[Cc]ache 214 | # but keep track of directories ending in .cache 215 | !?*.[Cc]ache/ 216 | 217 | # Others 218 | ClientBin/ 219 | ~$* 220 | *~ 221 | *.dbmdl 222 | *.dbproj.schemaview 223 | *.jfm 224 | *.pfx 225 | *.publishsettings 226 | orleans.codegen.cs 227 | 228 | # Including strong name files can present a security risk 229 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 230 | #*.snk 231 | 232 | # Since there are multiple workflows, uncomment next line to ignore bower_components 233 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 234 | #bower_components/ 235 | 236 | # RIA/Silverlight projects 237 | Generated_Code/ 238 | 239 | # Backup & report files from converting an old project file 240 | # to a newer Visual Studio version. Backup files are not needed, 241 | # because we have git ;-) 242 | _UpgradeReport_Files/ 243 | Backup*/ 244 | UpgradeLog*.XML 245 | UpgradeLog*.htm 246 | ServiceFabricBackup/ 247 | *.rptproj.bak 248 | 249 | # SQL Server files 250 | *.mdf 251 | *.ldf 252 | *.ndf 253 | 254 | # Business Intelligence projects 255 | *.rdl.data 256 | *.bim.layout 257 | *.bim_*.settings 258 | *.rptproj.rsuser 259 | *- Backup*.rdl 260 | 261 | # Microsoft Fakes 262 | FakesAssemblies/ 263 | 264 | # GhostDoc plugin setting file 265 | *.GhostDoc.xml 266 | 267 | # Node.js Tools for Visual Studio 268 | .ntvs_analysis.dat 269 | node_modules/ 270 | 271 | # Visual Studio 6 build log 272 | *.plg 273 | 274 | # Visual Studio 6 workspace options file 275 | *.opt 276 | 277 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 278 | *.vbw 279 | 280 | # Visual Studio LightSwitch build output 281 | **/*.HTMLClient/GeneratedArtifacts 282 | **/*.DesktopClient/GeneratedArtifacts 283 | **/*.DesktopClient/ModelManifest.xml 284 | **/*.Server/GeneratedArtifacts 285 | **/*.Server/ModelManifest.xml 286 | _Pvt_Extensions 287 | 288 | # Paket dependency manager 289 | .paket/paket.exe 290 | paket-files/ 291 | 292 | # FAKE - F# Make 293 | .fake/ 294 | 295 | # JetBrains Rider 296 | .idea/ 297 | *.sln.iml 298 | 299 | # CodeRush personal settings 300 | .cr/personal 301 | 302 | # Python Tools for Visual Studio (PTVS) 303 | __pycache__/ 304 | *.pyc 305 | 306 | # Cake - Uncomment if you are using it 307 | # tools/** 308 | # !tools/packages.config 309 | 310 | # Tabs Studio 311 | *.tss 312 | 313 | # Telerik's JustMock configuration file 314 | *.jmconfig 315 | 316 | # BizTalk build output 317 | *.btp.cs 318 | *.btm.cs 319 | *.odx.cs 320 | *.xsd.cs 321 | 322 | # OpenCover UI analysis results 323 | OpenCover/ 324 | 325 | # Azure Stream Analytics local run output 326 | ASALocalRun/ 327 | 328 | # MSBuild Binary and Structured Log 329 | *.binlog 330 | 331 | # NVidia Nsight GPU debugger configuration file 332 | *.nvuser 333 | 334 | # MFractors (Xamarin productivity tool) working folder 335 | .mfractor/ 336 | 337 | # Local History for Visual Studio 338 | .localhistory/ 339 | 340 | # BeatPulse healthcheck temp database 341 | healthchecksdb -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/Step2_SearchUC.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 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | 133 | True 134 | 135 | 136 | True 137 | 138 | 139 | True 140 | 141 | 142 | 17, 17 143 | 144 | -------------------------------------------------------------------------------- /IMDbAPI_Client/SearchForm.cs: -------------------------------------------------------------------------------- 1 | using IMDbApiLib; 2 | using IMDbApiLib.Models; 3 | using MetroFramework; 4 | using MetroFramework.Forms; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Data; 8 | using System.Linq; 9 | using System.Net; 10 | using System.Security.Cryptography; 11 | using System.Windows.Forms; 12 | 13 | namespace IMDbAPI_Client 14 | { 15 | public partial class SearchForm : MetroForm 16 | { 17 | public SearchForm(SearchData searchData) 18 | { 19 | InitializeComponent(); 20 | 21 | txtExpression.Text = searchData.Expression; 22 | 23 | rbMovie.Checked = Properties.Settings.Default.OperationType == OperationType.Movies; 24 | rbSeriesTV.Checked = Properties.Settings.Default.OperationType == OperationType.TVSeries; 25 | _searchData = searchData; 26 | 27 | string apiKey = Properties.Settings.Default.ApiKey; 28 | if (Properties.Settings.Default.UseProxy) 29 | { 30 | _apiLib = new ApiLib(apiKey, 31 | Properties.Settings.Default.ProxyAddress, 32 | Properties.Settings.Default.ProxyUsername, 33 | Properties.Settings.Default.ProxyPassword); 34 | } 35 | else 36 | { 37 | _apiLib = new ApiLib(apiKey); 38 | } 39 | } 40 | 41 | private readonly ApiLib _apiLib; 42 | private SearchData _searchData; 43 | private List _results 44 | { 45 | get 46 | { 47 | var rs = new List(); 48 | if (_searchData != null && _searchData.Results != null && _searchData.Results.Count > 0) 49 | { 50 | foreach (var r in _searchData.Results) 51 | { 52 | rs.Add(new MovieResult(r.Id, $"{r.Title} {r.Description}")); 53 | } 54 | } 55 | return rs; 56 | } 57 | } 58 | 59 | public SearchResult Result 60 | { 61 | get 62 | { 63 | var item = _searchData.Results.FirstOrDefault(rx => rx.Id == lbResults.SelectedValue.ToString()); 64 | return item; 65 | } 66 | } 67 | 68 | public class MovieResult 69 | { 70 | public MovieResult(string id, string title) 71 | { 72 | Id = id; 73 | Title = title; 74 | } 75 | 76 | public string Id { get; set; } 77 | public string Title { set; get; } 78 | } 79 | 80 | public string Id => lbResults.SelectedValue.ToString(); 81 | 82 | private async void btnSearch_Click(object sender, EventArgs e) 83 | { 84 | if (string.IsNullOrEmpty(txtExpression.Text.Trim())) 85 | return; 86 | 87 | EnableControlls(false); 88 | picPoster.Image = null; 89 | SearchData data; 90 | if (rbMovie.Checked) 91 | data = await _apiLib.SearchMovieAsync(txtExpression.Text.Trim()); 92 | else 93 | data = await _apiLib.SearchSeriesAsync(txtExpression.Text.Trim()); 94 | 95 | _searchData = data; 96 | if (!string.IsNullOrEmpty(data.ErrorMessage)) 97 | { 98 | MetroMessageBox.Show(this, data.ErrorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 99 | EnableControlls(true); 100 | return; 101 | } 102 | 103 | FillListBox(); 104 | EnableControlls(true); 105 | } 106 | 107 | private void EnableControlls(bool enabled) 108 | { 109 | Controls.Cast().Where(cx 110 | => cx.Name != toolbarUserControl1.Name 111 | && cx.Name != lblWaiting.Name 112 | && cx.Name != spinnerWaiting.Name 113 | && cx.Name != rbMovie.Name 114 | && cx.Name != rbSeriesTV.Name) 115 | .ToList().ForEach(cx => cx.Enabled = enabled); 116 | 117 | lblWaiting.Visible = spinnerWaiting.Visible = !enabled; 118 | } 119 | 120 | private void FillListBox() 121 | { 122 | lbResults.DisplayMember = "Title"; 123 | lbResults.ValueMember = "Id"; 124 | lbResults.DataSource = _results; 125 | if (_results != null && _results.Count > 0) 126 | { 127 | lbResults.SelectedIndex = 0; 128 | } 129 | } 130 | 131 | private void btnOK_Click(object sender, EventArgs e) 132 | { 133 | if (lbResults.SelectedIndex == -1) 134 | { 135 | MetroMessageBox.Show(this, "Please select a result", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); 136 | return; 137 | } 138 | 139 | this.DialogResult = DialogResult.OK; 140 | this.Close(); 141 | } 142 | 143 | private void btnIMDb_Click(object sender, EventArgs e) 144 | { 145 | if (lbResults.SelectedIndex == -1) 146 | { 147 | MetroMessageBox.Show(this, "Please select a result", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); 148 | return; 149 | } 150 | 151 | System.Diagnostics.Process.Start($"https://www.imdb.com/title/{Id}"); 152 | } 153 | 154 | private void txtExpression_Enter(object sender, EventArgs e) 155 | { 156 | this.AcceptButton = btnSearch; 157 | } 158 | 159 | private async void lbSearchMovie_SelectedIndexChanged(object sender, EventArgs e) 160 | { 161 | if (lbResults.SelectedIndex == -1) 162 | { 163 | picPoster.Image = null; 164 | return; 165 | } 166 | 167 | var item = _searchData.Results.FirstOrDefault(rx => rx.Id == lbResults.SelectedValue.ToString()); 168 | 169 | if (item is null || string.IsNullOrEmpty(item.Image) || item.Image.Contains("nopicture.jpg")) 170 | { 171 | picPoster.Image = Properties.Resources.PictureNotAvailable; 172 | return; 173 | } 174 | 175 | EnableControlls(false); 176 | picPoster.Image = null; 177 | if (Properties.Settings.Default.ClientOptions.ResizeImagesAndPosters) 178 | { 179 | var imageBytes = await _apiLib.ResizeImageAsync("224x308", item.Image); 180 | picPoster.Image = ClientUtils.BytesToImage(imageBytes); 181 | } 182 | else 183 | { 184 | var imageBytes = await ApiUtils.GetBytesAsync(item.Image); 185 | picPoster.Image = ClientUtils.BytesToImage(imageBytes); 186 | } 187 | EnableControlls(true); 188 | } 189 | 190 | private void SearchForm_Load(object sender, EventArgs e) 191 | { 192 | Theme = metroStyleManager1.Theme = Properties.Settings.Default.Theme; 193 | Style = metroStyleManager1.Style = Properties.Settings.Default.Style; 194 | 195 | FillListBox(); 196 | } 197 | 198 | private void picPoster_Click(object sender, EventArgs e) 199 | { 200 | if (lbResults.SelectedIndex == -1) 201 | { 202 | MetroMessageBox.Show(this, "Please select a result", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); 203 | return; 204 | } 205 | 206 | new MoreInfoForm(lbResults.SelectedValue.ToString()).ShowDialog(); 207 | } 208 | 209 | private void btnMoreInfo_Click(object sender, EventArgs e) 210 | { 211 | picPoster_Click(null, null); 212 | } 213 | } 214 | } 215 | -------------------------------------------------------------------------------- /IMDbAPI_Client/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 IMDbAPI_Client.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.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 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("D:\\New Movies")] 29 | public string MoviesDirectory { 30 | get { 31 | return ((string)(this["MoviesDirectory"])); 32 | } 33 | set { 34 | this["MoviesDirectory"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("")] 41 | public string ApiKey { 42 | get { 43 | return ((string)(this["ApiKey"])); 44 | } 45 | set { 46 | this["ApiKey"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("DownloadSiteName1\r\nDownloadSiteName2")] 53 | public string RemoveSites { 54 | get { 55 | return ((string)(this["RemoveSites"])); 56 | } 57 | set { 58 | this["RemoveSites"] = value; 59 | } 60 | } 61 | 62 | [global::System.Configuration.UserScopedSettingAttribute()] 63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 | [global::System.Configuration.DefaultSettingValueAttribute("Default")] 65 | public global::MetroFramework.MetroThemeStyle Theme { 66 | get { 67 | return ((global::MetroFramework.MetroThemeStyle)(this["Theme"])); 68 | } 69 | set { 70 | this["Theme"] = value; 71 | } 72 | } 73 | 74 | [global::System.Configuration.UserScopedSettingAttribute()] 75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 76 | [global::System.Configuration.DefaultSettingValueAttribute("Default")] 77 | public global::MetroFramework.MetroColorStyle Style { 78 | get { 79 | return ((global::MetroFramework.MetroColorStyle)(this["Style"])); 80 | } 81 | set { 82 | this["Style"] = value; 83 | } 84 | } 85 | 86 | [global::System.Configuration.UserScopedSettingAttribute()] 87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 88 | [global::System.Configuration.DefaultSettingValueAttribute("")] 89 | public string SeriesTvDirectory { 90 | get { 91 | return ((string)(this["SeriesTvDirectory"])); 92 | } 93 | set { 94 | this["SeriesTvDirectory"] = value; 95 | } 96 | } 97 | 98 | [global::System.Configuration.UserScopedSettingAttribute()] 99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 100 | [global::System.Configuration.DefaultSettingValueAttribute("")] 101 | public string SeriesTvID { 102 | get { 103 | return ((string)(this["SeriesTvID"])); 104 | } 105 | set { 106 | this["SeriesTvID"] = value; 107 | } 108 | } 109 | 110 | [global::System.Configuration.UserScopedSettingAttribute()] 111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 112 | [global::System.Configuration.DefaultSettingValueAttribute("")] 113 | public string MovieFile { 114 | get { 115 | return ((string)(this["MovieFile"])); 116 | } 117 | set { 118 | this["MovieFile"] = value; 119 | } 120 | } 121 | 122 | [global::System.Configuration.UserScopedSettingAttribute()] 123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 124 | [global::System.Configuration.DefaultSettingValueAttribute("Movies")] 125 | public global::IMDbAPI_Client.OperationType OperationType { 126 | get { 127 | return ((global::IMDbAPI_Client.OperationType)(this["OperationType"])); 128 | } 129 | set { 130 | this["OperationType"] = value; 131 | } 132 | } 133 | 134 | [global::System.Configuration.UserScopedSettingAttribute()] 135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 136 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 137 | public bool UseProxy { 138 | get { 139 | return ((bool)(this["UseProxy"])); 140 | } 141 | set { 142 | this["UseProxy"] = value; 143 | } 144 | } 145 | 146 | [global::System.Configuration.UserScopedSettingAttribute()] 147 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 148 | [global::System.Configuration.DefaultSettingValueAttribute("")] 149 | public string ProxyAddress { 150 | get { 151 | return ((string)(this["ProxyAddress"])); 152 | } 153 | set { 154 | this["ProxyAddress"] = value; 155 | } 156 | } 157 | 158 | [global::System.Configuration.UserScopedSettingAttribute()] 159 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 160 | [global::System.Configuration.DefaultSettingValueAttribute("")] 161 | public string ProxyUsername { 162 | get { 163 | return ((string)(this["ProxyUsername"])); 164 | } 165 | set { 166 | this["ProxyUsername"] = value; 167 | } 168 | } 169 | 170 | [global::System.Configuration.UserScopedSettingAttribute()] 171 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 172 | [global::System.Configuration.DefaultSettingValueAttribute("")] 173 | public string ProxyPassword { 174 | get { 175 | return ((string)(this["ProxyPassword"])); 176 | } 177 | set { 178 | this["ProxyPassword"] = value; 179 | } 180 | } 181 | 182 | [global::System.Configuration.UserScopedSettingAttribute()] 183 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 184 | public global::IMDbAPI_Client.ClientOptions ClientOptions { 185 | get { 186 | return ((global::IMDbAPI_Client.ClientOptions)(this["ClientOptions"])); 187 | } 188 | set { 189 | this["ClientOptions"] = value; 190 | } 191 | } 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /IMDbAPI_Client/SelectSeasonForm.designer.cs: -------------------------------------------------------------------------------- 1 | namespace IMDbAPI_Client 2 | { 3 | partial class SelectSeasonForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SelectSeasonForm)); 33 | this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); 34 | this.ddlSeasons = new MetroFramework.Controls.MetroComboBox(); 35 | this.metroStyleManager1 = new MetroFramework.Components.MetroStyleManager(this.components); 36 | this.toolbarUserControl1 = new IMDbAPI_Client.UserControls.ToolbarUserControl(); 37 | this.btnCancel = new MetroFramework.Controls.MetroButton(); 38 | this.btnOK = new MetroFramework.Controls.MetroButton(); 39 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).BeginInit(); 40 | this.SuspendLayout(); 41 | // 42 | // metroLabel1 43 | // 44 | this.metroLabel1.AutoSize = true; 45 | this.metroLabel1.FontSize = MetroFramework.MetroLabelSize.Tall; 46 | this.metroLabel1.Location = new System.Drawing.Point(29, 117); 47 | this.metroLabel1.Name = "metroLabel1"; 48 | this.metroLabel1.Size = new System.Drawing.Size(242, 25); 49 | this.metroLabel1.TabIndex = 0; 50 | this.metroLabel1.Text = "Download Subtitles for Season"; 51 | this.metroLabel1.UseStyleColors = true; 52 | // 53 | // ddlSeasons 54 | // 55 | this.ddlSeasons.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 56 | | System.Windows.Forms.AnchorStyles.Right))); 57 | this.ddlSeasons.FontSize = MetroFramework.MetroComboBoxSize.Tall; 58 | this.ddlSeasons.FontWeight = MetroFramework.MetroComboBoxWeight.Bold; 59 | this.ddlSeasons.FormattingEnabled = true; 60 | this.ddlSeasons.ItemHeight = 29; 61 | this.ddlSeasons.Location = new System.Drawing.Point(277, 112); 62 | this.ddlSeasons.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 63 | this.ddlSeasons.Name = "ddlSeasons"; 64 | this.ddlSeasons.Size = new System.Drawing.Size(188, 35); 65 | this.ddlSeasons.TabIndex = 1; 66 | this.ddlSeasons.UseSelectable = true; 67 | // 68 | // metroStyleManager1 69 | // 70 | this.metroStyleManager1.Owner = this; 71 | // 72 | // toolbarUserControl1 73 | // 74 | this.toolbarUserControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 75 | this.toolbarUserControl1.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 76 | this.toolbarUserControl1.Location = new System.Drawing.Point(378, 10); 77 | this.toolbarUserControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 78 | this.toolbarUserControl1.MinimzeButton = false; 79 | this.toolbarUserControl1.Name = "toolbarUserControl1"; 80 | this.toolbarUserControl1.Size = new System.Drawing.Size(108, 62); 81 | this.toolbarUserControl1.TabIndex = 23; 82 | this.toolbarUserControl1.UseSelectable = true; 83 | // 84 | // btnCancel 85 | // 86 | this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 87 | this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(209)))), ((int)(((byte)(17)))), ((int)(((byte)(65))))); 88 | this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 89 | this.btnCancel.ForeColor = System.Drawing.Color.White; 90 | this.btnCancel.Location = new System.Drawing.Point(221, 198); 91 | this.btnCancel.Name = "btnCancel"; 92 | this.btnCancel.Size = new System.Drawing.Size(119, 49); 93 | this.btnCancel.TabIndex = 26; 94 | this.btnCancel.Text = "&CANCEL"; 95 | this.btnCancel.UseCustomBackColor = true; 96 | this.btnCancel.UseCustomForeColor = true; 97 | this.btnCancel.UseSelectable = true; 98 | // 99 | // btnOK 100 | // 101 | this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 102 | this.btnOK.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(177)))), ((int)(((byte)(89))))); 103 | this.btnOK.ForeColor = System.Drawing.Color.White; 104 | this.btnOK.Location = new System.Drawing.Point(346, 198); 105 | this.btnOK.Name = "btnOK"; 106 | this.btnOK.Size = new System.Drawing.Size(119, 49); 107 | this.btnOK.TabIndex = 25; 108 | this.btnOK.Text = "&OK"; 109 | this.btnOK.UseCustomBackColor = true; 110 | this.btnOK.UseCustomForeColor = true; 111 | this.btnOK.UseSelectable = true; 112 | this.btnOK.Click += new System.EventHandler(this.btnOK_Click); 113 | // 114 | // SelectSeasonForm 115 | // 116 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); 117 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 118 | this.CancelButton = this.btnCancel; 119 | this.ClientSize = new System.Drawing.Size(493, 276); 120 | this.ControlBox = false; 121 | this.Controls.Add(this.btnCancel); 122 | this.Controls.Add(this.btnOK); 123 | this.Controls.Add(this.toolbarUserControl1); 124 | this.Controls.Add(this.ddlSeasons); 125 | this.Controls.Add(this.metroLabel1); 126 | this.Font = new System.Drawing.Font("Segoe UI", 9.75F); 127 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 128 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 129 | this.MinimumSize = new System.Drawing.Size(493, 276); 130 | this.Name = "SelectSeasonForm"; 131 | this.Padding = new System.Windows.Forms.Padding(23, 79, 23, 27); 132 | this.TopMost = true; 133 | this.Load += new System.EventHandler(this.SelectSeasonForm_Load); 134 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).EndInit(); 135 | this.ResumeLayout(false); 136 | this.PerformLayout(); 137 | 138 | } 139 | 140 | #endregion 141 | 142 | private MetroFramework.Controls.MetroLabel metroLabel1; 143 | private MetroFramework.Controls.MetroComboBox ddlSeasons; 144 | private MetroFramework.Components.MetroStyleManager metroStyleManager1; 145 | private UserControls.ToolbarUserControl toolbarUserControl1; 146 | private MetroFramework.Controls.MetroButton btnCancel; 147 | private MetroFramework.Controls.MetroButton btnOK; 148 | } 149 | } -------------------------------------------------------------------------------- /IMDbAPI_Client/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 | 122 | ..\Resources\Cancel.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\Exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | ..\Resources\GridLoad.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | ..\Resources\IMDb.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | ..\Resources\Minimize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 135 | 136 | 137 | ..\Resources\OK.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 138 | 139 | 140 | ..\Resources\PictureNotAvailable.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 141 | 142 | 143 | ..\Resources\Search.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 144 | 145 | 146 | ..\Resources\ViewSmall.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 147 | 148 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/Step1_InitUC.cs: -------------------------------------------------------------------------------- 1 | using IMDbApiLib; 2 | using IMDbApiLib.Models; 3 | using MetroFramework.Controls; 4 | using System; 5 | using System.IO; 6 | using System.Windows.Forms; 7 | 8 | namespace IMDbAPI_Client.UserControls 9 | { 10 | public partial class Step1_InitUC : MetroUserControl 11 | { 12 | public Step1_InitUC() 13 | { 14 | InitializeComponent(); 15 | 16 | MovieType = Properties.Settings.Default.OperationType; 17 | MovieFile = Properties.Settings.Default.MovieFile; 18 | MoviesDirectory = Properties.Settings.Default.MoviesDirectory; 19 | SeriesTvDirectory = Properties.Settings.Default.SeriesTvDirectory; 20 | SeriesTvID = Properties.Settings.Default.SeriesTvID; 21 | 22 | txtApiKey.Text = Properties.Settings.Default.ApiKey; 23 | txtApiKey.UseSystemPasswordChar = true; 24 | 25 | string apiKey = Properties.Settings.Default.ApiKey; 26 | if (Properties.Settings.Default.UseProxy) 27 | { 28 | _apiLib = new ApiLib(apiKey, 29 | Properties.Settings.Default.ProxyAddress, 30 | Properties.Settings.Default.ProxyUsername, 31 | Properties.Settings.Default.ProxyPassword); 32 | } 33 | else 34 | { 35 | _apiLib = new ApiLib(apiKey); 36 | } 37 | 38 | if (Properties.Settings.Default.ClientOptions is null) 39 | { 40 | Properties.Settings.Default.ClientOptions = new ClientOptions(); 41 | Properties.Settings.Default.Save(); 42 | } 43 | } 44 | 45 | private readonly ApiLib _apiLib; 46 | 47 | public string Title => "Step I: Init"; 48 | 49 | public OperationType MovieType 50 | { 51 | set 52 | { 53 | rbMovieFile.Checked = value == OperationType.MovieFile; 54 | rbMovies.Checked = value == OperationType.Movies; 55 | rbSeriesTV.Checked = value == OperationType.TVSeries; 56 | } 57 | get 58 | { 59 | if (rbMovieFile.Checked) 60 | return OperationType.MovieFile; 61 | else if (rbMovies.Checked) 62 | return OperationType.Movies; 63 | else 64 | return OperationType.TVSeries; 65 | } 66 | } 67 | 68 | public string MovieFile 69 | { 70 | set => txtMovieFile.Text = value; 71 | get => txtMovieFile.Text; 72 | } 73 | 74 | public string MoviesDirectory 75 | { 76 | set => txtMoviesDir.Text = value; 77 | get => txtMoviesDir.Text; 78 | } 79 | 80 | public string SeriesTvDirectory 81 | { 82 | set => txtSeriesTvDir.Text = value; 83 | get => txtSeriesTvDir.Text; 84 | } 85 | 86 | public string SeriesTvID 87 | { 88 | set => txtSeriesTvID.Text = value; 89 | get => txtSeriesTvID.Text; 90 | } 91 | 92 | public void SaveSettings() 93 | { 94 | Properties.Settings.Default.OperationType = MovieType; 95 | Properties.Settings.Default.MovieFile = MovieFile; 96 | Properties.Settings.Default.MoviesDirectory = MoviesDirectory; 97 | Properties.Settings.Default.SeriesTvDirectory = SeriesTvDirectory; 98 | Properties.Settings.Default.SeriesTvID = SeriesTvID; 99 | 100 | Properties.Settings.Default.ApiKey = txtApiKey.Text; 101 | 102 | Properties.Settings.Default.Save(); 103 | } 104 | 105 | public string InvalidMessage 106 | { 107 | get 108 | { 109 | if (string.IsNullOrEmpty(txtApiKey.Text)) 110 | return "API Key requied."; 111 | 112 | if (rbMovieFile.Checked) 113 | { 114 | if (string.IsNullOrEmpty(txtMovieFile.Text)) 115 | return "Movie file requied."; 116 | 117 | if (!File.Exists(txtMovieFile.Text)) 118 | return "Movie file not exists."; 119 | } 120 | else if (rbMovies.Checked) 121 | { 122 | if (string.IsNullOrEmpty(txtMoviesDir.Text)) 123 | return "Movies directory requied."; 124 | 125 | if (!Directory.Exists(txtMoviesDir.Text)) 126 | return "Movies directory not exists."; 127 | } 128 | else if (rbSeriesTV.Checked) 129 | { 130 | if (string.IsNullOrEmpty(txtSeriesTvDir.Text)) 131 | return "Series TV directory requied."; 132 | 133 | if (!Directory.Exists(txtSeriesTvDir.Text)) 134 | return "Series TV directory not exists."; 135 | 136 | if (string.IsNullOrEmpty(txtSeriesTvID.Text)) 137 | return "Series TV IMDb Id requied."; 138 | 139 | if (!txtSeriesTvID.Text.StartsWith("tt")) 140 | return "Invalid Series TV IMdb Id (ex: tt1234567)."; 141 | } 142 | 143 | return string.Empty; 144 | } 145 | } 146 | 147 | private void txtMoviesDir_ButtonClick(object sender, EventArgs e) 148 | { 149 | if (Directory.Exists(txtMoviesDir.Text)) 150 | folderBrowserDialog1.SelectedPath = txtMoviesDir.Text; 151 | 152 | if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) 153 | txtMoviesDir.Text = folderBrowserDialog1.SelectedPath; 154 | } 155 | 156 | private void txtSeriesTvDir_ButtonClick(object sender, EventArgs e) 157 | { 158 | if (Directory.Exists(txtSeriesTvDir.Text)) 159 | folderBrowserDialog1.SelectedPath = txtSeriesTvDir.Text; 160 | 161 | if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) 162 | txtSeriesTvDir.Text = folderBrowserDialog1.SelectedPath; 163 | } 164 | 165 | private void lnkRegister_Click(object sender, EventArgs e) 166 | { 167 | System.Diagnostics.Process.Start($"{_apiLib.BaseUrl}/Identity/Account/Register"); 168 | } 169 | 170 | private void txtApiKey_ButtonClick(object sender, EventArgs e) 171 | { 172 | txtApiKey.UseSystemPasswordChar = !txtApiKey.UseSystemPasswordChar; 173 | } 174 | 175 | private void rbAll_CheckedChanged(object sender, EventArgs e) 176 | { 177 | if (rbMovieFile.Checked) 178 | { 179 | EnabledControls(true, lblMovieFile, txtMovieFile); 180 | EnabledControls(false, lblMoviesDir, txtMoviesDir); 181 | EnabledControls(false, lblSeriesTvDir, txtSeriesTvDir, lblSeriesTvID, txtSeriesTvID, btnSearchSeriesTV, btnMoreInfo); 182 | } 183 | else if (rbMovies.Checked) 184 | { 185 | EnabledControls(false, lblMovieFile, txtMovieFile); 186 | EnabledControls(true, lblMoviesDir, txtMoviesDir); 187 | EnabledControls(false, lblSeriesTvDir, txtSeriesTvDir, lblSeriesTvID, txtSeriesTvID, btnSearchSeriesTV, btnMoreInfo); 188 | } 189 | else if (rbSeriesTV.Checked) 190 | { 191 | EnabledControls(false, lblMovieFile, txtMovieFile); 192 | EnabledControls(false, lblMoviesDir, txtMoviesDir); 193 | EnabledControls(true, lblSeriesTvDir, txtSeriesTvDir, lblSeriesTvID, txtSeriesTvID, btnSearchSeriesTV, btnMoreInfo); 194 | } 195 | } 196 | 197 | private void EnabledControls(bool enabled, params Control[] controls) 198 | { 199 | foreach (var c in controls) 200 | c.Enabled = enabled; 201 | } 202 | 203 | protected override void OnLoad(EventArgs e) 204 | { 205 | Theme = metroStyleManager1.Theme = Properties.Settings.Default.Theme; 206 | Style = metroStyleManager1.Style = Properties.Settings.Default.Style; 207 | 208 | base.OnLoad(e); 209 | } 210 | 211 | private void btnSearchSeriesTV_Click(object sender, EventArgs e) 212 | { 213 | SaveSettings(); 214 | var data = new SearchData() 215 | { 216 | Expression = txtSeriesTvID.Text, 217 | SearchType = "Series" 218 | }; 219 | 220 | var searchForm = new SearchForm(data); 221 | if (searchForm.ShowDialog() == DialogResult.OK) 222 | { 223 | txtSeriesTvID.Text = searchForm.Result.Id; 224 | } 225 | } 226 | 227 | private void btnMoreInfo_Click(object sender, EventArgs e) 228 | { 229 | if (string.IsNullOrEmpty(txtSeriesTvID.Text) || !txtSeriesTvID.Text.StartsWith("tt")) 230 | return; 231 | 232 | new MoreInfoForm(txtSeriesTvID.Text).ShowDialog(); 233 | } 234 | 235 | private void txtMovieFile_ButtonClick(object sender, EventArgs e) 236 | { 237 | if (Directory.Exists(txtMoviesDir.Text)) 238 | openFileDialog1.InitialDirectory = txtMoviesDir.Text; 239 | 240 | if (openFileDialog1.ShowDialog() == DialogResult.OK) 241 | { 242 | txtMovieFile.Text = openFileDialog1.FileName; 243 | } 244 | } 245 | } 246 | } 247 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/Step2_SearchUC.cs: -------------------------------------------------------------------------------- 1 | using IMDbApiLib; 2 | using IMDbApiLib.Models; 3 | using MetroFramework; 4 | using MetroFramework.Controls; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Drawing; 8 | using System.IO; 9 | using System.Linq; 10 | using System.Threading.Tasks; 11 | using System.Windows.Forms; 12 | 13 | namespace IMDbAPI_Client.UserControls 14 | { 15 | public partial class Step2_SearchUC : MetroUserControl 16 | { 17 | public Step2_SearchUC() 18 | { 19 | InitializeComponent(); 20 | 21 | string apiKey = Properties.Settings.Default.ApiKey; 22 | if (Properties.Settings.Default.UseProxy) 23 | { 24 | _apiLib = new ApiLib(apiKey, 25 | Properties.Settings.Default.ProxyAddress, 26 | Properties.Settings.Default.ProxyUsername, 27 | Properties.Settings.Default.ProxyPassword); 28 | } 29 | else 30 | { 31 | _apiLib = new ApiLib(apiKey); 32 | } 33 | } 34 | 35 | private readonly ApiLib _apiLib; 36 | 37 | public string Title => "Step II: Search Title"; 38 | 39 | public List GridDataItems 40 | { 41 | get 42 | { 43 | var items = new List(); 44 | foreach (DataGridViewRow r in dgv.Rows) 45 | { 46 | if (Convert.ToBoolean(r.Cells["SelectColumn"].Value)) 47 | items.Add(new GridData( 48 | Convert.ToBoolean(r.Cells["SelectColumn"].Value), 49 | r.Cells["FolderColumn"].Value.ToString(), 50 | r.Cells["FullTitleColumn"].Value.ToString(), 51 | r.Cells["OriginalTitleColumn"].Value.ToString(), 52 | r.Cells["IdColumn"].Value.ToString() 53 | )); 54 | } 55 | return items; 56 | } 57 | } 58 | 59 | public delegate void ReadyDelegate(); 60 | public event ReadyDelegate OnReady; 61 | 62 | protected override async void OnLoad(EventArgs e) 63 | { 64 | Theme = metroStyleManager1.Theme = Properties.Settings.Default.Theme; 65 | Style = metroStyleManager1.Style = Properties.Settings.Default.Style; 66 | 67 | string colorName = Style.ToString(); 68 | if (colorName == "Default") 69 | colorName = "Blue"; 70 | FolderColumn.LinkColor = FolderColumn.VisitedLinkColor = Color.FromName(colorName); 71 | 72 | var items = new List(); 73 | var dirs = new List(); 74 | // MOVE 75 | if (Properties.Settings.Default.OperationType == OperationType.Movies) 76 | { 77 | string dir = Properties.Settings.Default.MoviesDirectory; 78 | var dinfo = new DirectoryInfo(dir); 79 | foreach (var fi in dinfo.GetFiles()) 80 | { 81 | // Create Folder 82 | string nameOnly = fi.Name.Replace(fi.Extension, ""); 83 | nameOnly = ApiUtils.RemoveDlSiteName(nameOnly, Properties.Settings.Default.RemoveSites); 84 | string newFolder = $"{dir}\\{nameOnly}"; 85 | Directory.CreateDirectory(newFolder); 86 | 87 | // Moving File 88 | fi.MoveTo($"{newFolder}\\{nameOnly}{fi.Extension}"); 89 | } 90 | 91 | dirs = new DirectoryInfo(dir).GetDirectories().Where(dx => !dx.Name.StartsWith("0")).ToList(); 92 | } 93 | else if (Properties.Settings.Default.OperationType == OperationType.MovieFile) 94 | { 95 | string file = Properties.Settings.Default.MovieFile; 96 | var fi = new FileInfo(file); 97 | // Create Folder 98 | string nameOnly = fi.Name.Replace(fi.Extension, ""); 99 | nameOnly = ApiUtils.RemoveDlSiteName(nameOnly, Properties.Settings.Default.RemoveSites); 100 | string newFolder = $"{fi.Directory.FullName}\\{nameOnly}"; 101 | Directory.CreateDirectory(newFolder); 102 | 103 | // Moving File 104 | fi.MoveTo($"{newFolder}\\{nameOnly}{fi.Extension}"); 105 | 106 | dirs.Add(fi.Directory); 107 | } 108 | // ADD To GridData 109 | foreach (var di in dirs) 110 | { 111 | var data = await _apiLib.SearchMovieAsync(di.Name); 112 | if (!string.IsNullOrEmpty(data.ErrorMessage)) 113 | { 114 | MetroMessageBox.Show(this, data.ErrorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 115 | OnReady?.Invoke(); 116 | return; 117 | } 118 | 119 | if (data.Results != null && data.Results.Count == 1) 120 | { 121 | var result = data.Results.First(); 122 | var titleData = await _apiLib.TitleAsync(result.Id); 123 | items.Add(new GridData(true, di.Name, titleData.FullTitle, titleData.OriginalTitle, titleData.Id)); 124 | } 125 | else 126 | { 127 | var searchForm = new SearchForm(data); 128 | if (searchForm.ShowDialog() == DialogResult.OK) 129 | { 130 | var result = searchForm.Result; 131 | var titleData = await _apiLib.TitleAsync(result.Id); 132 | if (string.IsNullOrEmpty(titleData.ErrorMessage)) 133 | items.Add(new GridData(true, di.Name, titleData.FullTitle, titleData.OriginalTitle, titleData.Id)); 134 | else 135 | { 136 | MetroMessageBox.Show(this, data.ErrorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 137 | OnReady?.Invoke(); 138 | return; 139 | } 140 | } 141 | else 142 | { 143 | // Not add 144 | } 145 | } 146 | dgv.DataSource = new List(items); 147 | } 148 | 149 | await Task.Delay(100); 150 | InfoColumn.Text = "info..."; 151 | InfoColumn.UseColumnTextForButtonValue = true; 152 | SearchAgainColumn.Text = "search again"; 153 | SearchAgainColumn.UseColumnTextForButtonValue = true; 154 | 155 | dgv.DataSource = new List(items); 156 | OnReady?.Invoke(); 157 | base.OnLoad(e); 158 | } 159 | 160 | public string InvalidMessage 161 | { 162 | get 163 | { 164 | if (dgv.Rows.Count == 0) 165 | return "Items is empty"; 166 | 167 | bool hastSelect = false; 168 | foreach (DataGridViewRow r in dgv.Rows) 169 | if (Convert.ToBoolean(r.Cells["SelectColumn"].Value)) 170 | hastSelect = true; 171 | if (!hastSelect) 172 | return "Items is empty"; 173 | 174 | return string.Empty; 175 | } 176 | } 177 | 178 | private async void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e) 179 | { 180 | if (e.ColumnIndex == dgv.Columns["FolderColumn"].Index) 181 | { 182 | if (dgv.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null) 183 | { 184 | string query = dgv.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); 185 | query = query.Replace(" [NoSUB]", ""); 186 | query = query.Replace(" [NOSUB]", ""); 187 | query = query.Replace(" ", "+"); 188 | query = query.Replace("&", "+and+"); 189 | query += "+imdb"; 190 | System.Diagnostics.Process.Start($"https://www.google.com/search?q={query}"); 191 | } 192 | } 193 | 194 | if (e.ColumnIndex == 0) 195 | { 196 | string id = dgv.Rows[e.RowIndex].Cells[nameof(IdColumn)].Value.ToString(); 197 | if (string.IsNullOrEmpty(id)) 198 | return; 199 | 200 | new MoreInfoForm(id).ShowDialog(); 201 | } 202 | 203 | if (e.ColumnIndex == 1) 204 | { 205 | string id = dgv.Rows[e.RowIndex].Cells[nameof(IdColumn)].Value.ToString(); 206 | if (string.IsNullOrEmpty(id)) 207 | return; 208 | 209 | string folder = dgv.Rows[e.RowIndex].Cells[nameof(FolderColumn)].Value.ToString(); 210 | 211 | var searchdata = new SearchData() 212 | { 213 | Expression = folder, 214 | SearchType = "Movie" 215 | }; 216 | var searchForm = new SearchForm(searchdata); 217 | if (searchForm.ShowDialog() == DialogResult.OK) 218 | { 219 | var result = searchForm.Result; 220 | var titleData = await _apiLib.TitleAsync(result.Id); 221 | if (string.IsNullOrEmpty(titleData.ErrorMessage)) 222 | { 223 | dgv.Rows[e.RowIndex].Cells[nameof(IdColumn)].Value = titleData.Id; 224 | dgv.Rows[e.RowIndex].Cells[nameof(FullTitleColumn)].Value = titleData.FullTitle; 225 | dgv.Rows[e.RowIndex].Cells[nameof(OriginalTitleColumn)].Value = titleData.OriginalTitle; 226 | } 227 | } 228 | } 229 | 230 | } 231 | } 232 | } 233 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/Step4_DownloadUC.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace IMDbAPI_Client.UserControls 2 | { 3 | partial class Step4_DownloadUC 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | this.progressTotal = new MetroFramework.Controls.MetroProgressBar(); 33 | this.progressCurrentJob = new MetroFramework.Controls.MetroProgressBar(); 34 | this.label1 = new System.Windows.Forms.Label(); 35 | this.label2 = new System.Windows.Forms.Label(); 36 | this.lblTotalProgress = new System.Windows.Forms.Label(); 37 | this.lblCurrent = new System.Windows.Forms.Label(); 38 | this.metroStyleManager1 = new MetroFramework.Components.MetroStyleManager(this.components); 39 | this.btnCancel = new System.Windows.Forms.Button(); 40 | this.ddlWhenDone = new MetroFramework.Controls.MetroComboBox(); 41 | this.lblWhenDone = new System.Windows.Forms.Label(); 42 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).BeginInit(); 43 | this.SuspendLayout(); 44 | // 45 | // progressTotal 46 | // 47 | this.progressTotal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 48 | | System.Windows.Forms.AnchorStyles.Right))); 49 | this.progressTotal.HideProgressText = false; 50 | this.progressTotal.Location = new System.Drawing.Point(65, 69); 51 | this.progressTotal.Name = "progressTotal"; 52 | this.progressTotal.Size = new System.Drawing.Size(751, 72); 53 | this.progressTotal.TabIndex = 4; 54 | // 55 | // progressCurrentJob 56 | // 57 | this.progressCurrentJob.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 58 | | System.Windows.Forms.AnchorStyles.Right))); 59 | this.progressCurrentJob.HideProgressText = false; 60 | this.progressCurrentJob.Location = new System.Drawing.Point(65, 196); 61 | this.progressCurrentJob.Name = "progressCurrentJob"; 62 | this.progressCurrentJob.Size = new System.Drawing.Size(751, 72); 63 | this.progressCurrentJob.TabIndex = 6; 64 | // 65 | // label1 66 | // 67 | this.label1.AutoSize = true; 68 | this.label1.BackColor = System.Drawing.Color.Transparent; 69 | this.label1.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 70 | this.label1.Location = new System.Drawing.Point(67, 45); 71 | this.label1.Name = "label1"; 72 | this.label1.Size = new System.Drawing.Size(64, 19); 73 | this.label1.TabIndex = 7; 74 | this.label1.Text = "TOTAL"; 75 | // 76 | // label2 77 | // 78 | this.label2.AutoSize = true; 79 | this.label2.BackColor = System.Drawing.Color.Transparent; 80 | this.label2.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 81 | this.label2.Location = new System.Drawing.Point(67, 172); 82 | this.label2.Name = "label2"; 83 | this.label2.Size = new System.Drawing.Size(89, 19); 84 | this.label2.TabIndex = 8; 85 | this.label2.Text = "CURRENT"; 86 | // 87 | // lblTotalProgress 88 | // 89 | this.lblTotalProgress.AutoSize = true; 90 | this.lblTotalProgress.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 91 | this.lblTotalProgress.Location = new System.Drawing.Point(179, 45); 92 | this.lblTotalProgress.Name = "lblTotalProgress"; 93 | this.lblTotalProgress.Size = new System.Drawing.Size(24, 19); 94 | this.lblTotalProgress.TabIndex = 7; 95 | this.lblTotalProgress.Text = "..."; 96 | // 97 | // lblCurrent 98 | // 99 | this.lblCurrent.AutoSize = true; 100 | this.lblCurrent.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 101 | this.lblCurrent.Location = new System.Drawing.Point(179, 172); 102 | this.lblCurrent.Name = "lblCurrent"; 103 | this.lblCurrent.Size = new System.Drawing.Size(24, 19); 104 | this.lblCurrent.TabIndex = 9; 105 | this.lblCurrent.Text = "..."; 106 | // 107 | // metroStyleManager1 108 | // 109 | this.metroStyleManager1.Owner = this; 110 | // 111 | // btnCancel 112 | // 113 | this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 114 | this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(209)))), ((int)(((byte)(17)))), ((int)(((byte)(65))))); 115 | this.btnCancel.FlatAppearance.BorderSize = 0; 116 | this.btnCancel.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(77)))), ((int)(((byte)(95))))); 117 | this.btnCancel.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(77)))), ((int)(((byte)(65))))); 118 | this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 119 | this.btnCancel.ForeColor = System.Drawing.Color.White; 120 | this.btnCancel.Location = new System.Drawing.Point(697, 323); 121 | this.btnCancel.Name = "btnCancel"; 122 | this.btnCancel.Size = new System.Drawing.Size(119, 46); 123 | this.btnCancel.TabIndex = 28; 124 | this.btnCancel.Text = "&CANCEL"; 125 | this.btnCancel.UseVisualStyleBackColor = false; 126 | this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); 127 | // 128 | // ddlWhenDone 129 | // 130 | this.ddlWhenDone.FormattingEnabled = true; 131 | this.ddlWhenDone.ItemHeight = 23; 132 | this.ddlWhenDone.Items.AddRange(new object[] { 133 | "Keep PC Running", 134 | "Shutdown [On Successfull]", 135 | "Shutdown [Anyway]"}); 136 | this.ddlWhenDone.Location = new System.Drawing.Point(65, 340); 137 | this.ddlWhenDone.Name = "ddlWhenDone"; 138 | this.ddlWhenDone.Size = new System.Drawing.Size(206, 29); 139 | this.ddlWhenDone.TabIndex = 30; 140 | this.ddlWhenDone.UseSelectable = true; 141 | // 142 | // lblWhenDone 143 | // 144 | this.lblWhenDone.AutoSize = true; 145 | this.lblWhenDone.BackColor = System.Drawing.Color.Transparent; 146 | this.lblWhenDone.Location = new System.Drawing.Point(62, 319); 147 | this.lblWhenDone.Name = "lblWhenDone"; 148 | this.lblWhenDone.Size = new System.Drawing.Size(73, 16); 149 | this.lblWhenDone.TabIndex = 31; 150 | this.lblWhenDone.Text = "When done"; 151 | // 152 | // Step4_DownloadUC 153 | // 154 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); 155 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 156 | this.Controls.Add(this.lblWhenDone); 157 | this.Controls.Add(this.ddlWhenDone); 158 | this.Controls.Add(this.btnCancel); 159 | this.Controls.Add(this.lblCurrent); 160 | this.Controls.Add(this.label2); 161 | this.Controls.Add(this.lblTotalProgress); 162 | this.Controls.Add(this.label1); 163 | this.Controls.Add(this.progressCurrentJob); 164 | this.Controls.Add(this.progressTotal); 165 | this.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 166 | this.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); 167 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 168 | this.Name = "Step4_DownloadUC"; 169 | this.Size = new System.Drawing.Size(870, 414); 170 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).EndInit(); 171 | this.ResumeLayout(false); 172 | this.PerformLayout(); 173 | 174 | } 175 | 176 | #endregion 177 | private MetroFramework.Controls.MetroProgressBar progressTotal; 178 | private MetroFramework.Controls.MetroProgressBar progressCurrentJob; 179 | private System.Windows.Forms.Label label1; 180 | private System.Windows.Forms.Label label2; 181 | private System.Windows.Forms.Label lblTotalProgress; 182 | private System.Windows.Forms.Label lblCurrent; 183 | private MetroFramework.Components.MetroStyleManager metroStyleManager1; 184 | private System.Windows.Forms.Button btnCancel; 185 | private MetroFramework.Controls.MetroComboBox ddlWhenDone; 186 | private System.Windows.Forms.Label lblWhenDone; 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /IMDbAPI_Client/PingForm.designer.cs: -------------------------------------------------------------------------------- 1 | namespace IMDbAPI_Client 2 | { 3 | partial class PingForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PingForm)); 33 | this.metroStyleManager1 = new MetroFramework.Components.MetroStyleManager(this.components); 34 | this.lblFullTitle = new MetroFramework.Controls.MetroLabel(); 35 | this.lblOriginalTitle = new MetroFramework.Controls.MetroLabel(); 36 | this.lblWaiting = new System.Windows.Forms.Label(); 37 | this.spinnerWaiting = new MetroFramework.Controls.MetroProgressSpinner(); 38 | this.btnCancel = new MetroFramework.Controls.MetroButton(); 39 | this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); 40 | this.toolbarUserControl1 = new IMDbAPI_Client.UserControls.ToolbarUserControl(); 41 | this.lblMessage = new System.Windows.Forms.Label(); 42 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).BeginInit(); 43 | this.SuspendLayout(); 44 | // 45 | // metroStyleManager1 46 | // 47 | this.metroStyleManager1.Owner = this; 48 | // 49 | // lblFullTitle 50 | // 51 | this.lblFullTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 52 | | System.Windows.Forms.AnchorStyles.Right))); 53 | this.lblFullTitle.FontSize = MetroFramework.MetroLabelSize.Tall; 54 | this.lblFullTitle.FontWeight = MetroFramework.MetroLabelWeight.Bold; 55 | this.lblFullTitle.Location = new System.Drawing.Point(253, 64); 56 | this.lblFullTitle.Name = "lblFullTitle"; 57 | this.lblFullTitle.Size = new System.Drawing.Size(26, 24); 58 | this.lblFullTitle.TabIndex = 10; 59 | this.lblFullTitle.UseStyleColors = true; 60 | // 61 | // lblOriginalTitle 62 | // 63 | this.lblOriginalTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 64 | | System.Windows.Forms.AnchorStyles.Right))); 65 | this.lblOriginalTitle.FontWeight = MetroFramework.MetroLabelWeight.Regular; 66 | this.lblOriginalTitle.Location = new System.Drawing.Point(253, 96); 67 | this.lblOriginalTitle.Name = "lblOriginalTitle"; 68 | this.lblOriginalTitle.Size = new System.Drawing.Size(26, 21); 69 | this.lblOriginalTitle.TabIndex = 11; 70 | // 71 | // lblWaiting 72 | // 73 | this.lblWaiting.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 74 | this.lblWaiting.AutoSize = true; 75 | this.lblWaiting.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 76 | this.lblWaiting.ForeColor = System.Drawing.Color.Crimson; 77 | this.lblWaiting.Location = new System.Drawing.Point(299, 28); 78 | this.lblWaiting.Name = "lblWaiting"; 79 | this.lblWaiting.Size = new System.Drawing.Size(82, 21); 80 | this.lblWaiting.TabIndex = 23; 81 | this.lblWaiting.Text = "Waiting..."; 82 | this.lblWaiting.Visible = false; 83 | // 84 | // spinnerWaiting 85 | // 86 | this.spinnerWaiting.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 87 | this.spinnerWaiting.Location = new System.Drawing.Point(280, 31); 88 | this.spinnerWaiting.Maximum = 100; 89 | this.spinnerWaiting.Name = "spinnerWaiting"; 90 | this.spinnerWaiting.Size = new System.Drawing.Size(16, 16); 91 | this.spinnerWaiting.Style = MetroFramework.MetroColorStyle.Red; 92 | this.spinnerWaiting.TabIndex = 24; 93 | this.spinnerWaiting.UseCustomForeColor = true; 94 | this.spinnerWaiting.UseSelectable = true; 95 | this.spinnerWaiting.Value = 100; 96 | this.spinnerWaiting.Visible = false; 97 | // 98 | // btnCancel 99 | // 100 | this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 101 | this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(209)))), ((int)(((byte)(17)))), ((int)(((byte)(65))))); 102 | this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 103 | this.btnCancel.ForeColor = System.Drawing.Color.White; 104 | this.btnCancel.Location = new System.Drawing.Point(312, 446); 105 | this.btnCancel.Name = "btnCancel"; 106 | this.btnCancel.Size = new System.Drawing.Size(119, 49); 107 | this.btnCancel.TabIndex = 25; 108 | this.btnCancel.Text = "&CLOSE"; 109 | this.btnCancel.UseCustomBackColor = true; 110 | this.btnCancel.UseCustomForeColor = true; 111 | this.btnCancel.UseSelectable = true; 112 | // 113 | // flowLayoutPanel1 114 | // 115 | this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 116 | | System.Windows.Forms.AnchorStyles.Left) 117 | | System.Windows.Forms.AnchorStyles.Right))); 118 | this.flowLayoutPanel1.AutoScroll = true; 119 | this.flowLayoutPanel1.Location = new System.Drawing.Point(23, 64); 120 | this.flowLayoutPanel1.Name = "flowLayoutPanel1"; 121 | this.flowLayoutPanel1.Size = new System.Drawing.Size(408, 376); 122 | this.flowLayoutPanel1.TabIndex = 26; 123 | // 124 | // toolbarUserControl1 125 | // 126 | this.toolbarUserControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 127 | this.toolbarUserControl1.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 128 | this.toolbarUserControl1.Location = new System.Drawing.Point(392, 9); 129 | this.toolbarUserControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 130 | this.toolbarUserControl1.MinimzeButton = false; 131 | this.toolbarUserControl1.Name = "toolbarUserControl1"; 132 | this.toolbarUserControl1.Size = new System.Drawing.Size(54, 58); 133 | this.toolbarUserControl1.TabIndex = 21; 134 | this.toolbarUserControl1.UseSelectable = true; 135 | // 136 | // lblMessage 137 | // 138 | this.lblMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 139 | | System.Windows.Forms.AnchorStyles.Right))); 140 | this.lblMessage.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 141 | this.lblMessage.Location = new System.Drawing.Point(23, 446); 142 | this.lblMessage.Name = "lblMessage"; 143 | this.lblMessage.Size = new System.Drawing.Size(283, 19); 144 | this.lblMessage.TabIndex = 28; 145 | this.lblMessage.Text = "..."; 146 | // 147 | // PingForm 148 | // 149 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 150 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 151 | this.CancelButton = this.btnCancel; 152 | this.ClientSize = new System.Drawing.Size(454, 518); 153 | this.ControlBox = false; 154 | this.Controls.Add(this.lblMessage); 155 | this.Controls.Add(this.flowLayoutPanel1); 156 | this.Controls.Add(this.btnCancel); 157 | this.Controls.Add(this.spinnerWaiting); 158 | this.Controls.Add(this.lblWaiting); 159 | this.Controls.Add(this.toolbarUserControl1); 160 | this.Controls.Add(this.lblOriginalTitle); 161 | this.Controls.Add(this.lblFullTitle); 162 | this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 163 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 164 | this.Name = "PingForm"; 165 | this.Text = "Ping..."; 166 | this.TopMost = true; 167 | this.Load += new System.EventHandler(this.PingForm_Load); 168 | this.Shown += new System.EventHandler(this.PingForm_Shown); 169 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).EndInit(); 170 | this.ResumeLayout(false); 171 | this.PerformLayout(); 172 | 173 | } 174 | 175 | #endregion 176 | 177 | private MetroFramework.Components.MetroStyleManager metroStyleManager1; 178 | private MetroFramework.Controls.MetroLabel lblFullTitle; 179 | private MetroFramework.Controls.MetroLabel lblOriginalTitle; 180 | private UserControls.ToolbarUserControl toolbarUserControl1; 181 | private System.Windows.Forms.Label lblWaiting; 182 | private MetroFramework.Controls.MetroProgressSpinner spinnerWaiting; 183 | private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; 184 | private MetroFramework.Controls.MetroButton btnCancel; 185 | private System.Windows.Forms.Label lblMessage; 186 | } 187 | } -------------------------------------------------------------------------------- /IMDbAPI_Client/MainForm.cs: -------------------------------------------------------------------------------- 1 | using IMDbAPI_Client.UserControls; 2 | using MetroFramework; 3 | using MetroFramework.Controls; 4 | using MetroFramework.Forms; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Diagnostics; 8 | using System.Windows.Forms; 9 | 10 | namespace IMDbAPI_Client 11 | { 12 | public partial class MainForm : MetroForm 13 | { 14 | public MainForm() 15 | { 16 | InitializeComponent(); 17 | 18 | var assembly = System.Reflection.Assembly.GetExecutingAssembly(); 19 | var fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location); 20 | var version = new Version(fileVersionInfo.ProductVersion); 21 | _version = btnVersion.Text = $"v{version.ToString(3)}"; 22 | } 23 | 24 | 25 | private string _version; 26 | private List _gridDataItems; 27 | 28 | private UserControl _currentUC; 29 | private UserControl CurrentUC 30 | { 31 | set 32 | { 33 | _currentUC = value; 34 | OpenUserControl(_currentUC); 35 | } 36 | get => _currentUC; 37 | } 38 | 39 | private void OpenUserControl(UserControl uc) 40 | { 41 | uc.Dock = DockStyle.Fill; 42 | pnlUserControl.Controls.Clear(); 43 | pnlUserControl.Controls.Add(uc); 44 | } 45 | 46 | private void EnabledButton(Button button, bool enabled, string text = null) 47 | { 48 | button.Enabled = enabled; 49 | if (!string.IsNullOrEmpty(text)) 50 | button.Text = text; 51 | } 52 | 53 | private void MainForm_Load(object sender, EventArgs e) 54 | { 55 | Theme = metroStyleManager1.Theme = Properties.Settings.Default.Theme; 56 | Style = metroStyleManager1.Style = Properties.Settings.Default.Style; 57 | 58 | var uc = new Step1_InitUC(); 59 | lblTitle.Text = uc.Title; 60 | CurrentUC = uc; 61 | _gridDataItems = new List(); 62 | 63 | EnabledButton(btnSettings, true); 64 | EnabledButton(btnPrevious, false); 65 | EnabledButton(btnNext, true, "&NEXT"); 66 | } 67 | 68 | private void btnSettings_Click(object sender, EventArgs e) 69 | { 70 | if (new SettingsForm().ShowDialog() == DialogResult.OK) 71 | { 72 | Theme = metroStyleManager1.Theme = (_currentUC as MetroUserControl).Theme = (toolbarUserControl1 as MetroUserControl).Theme = Properties.Settings.Default.Theme; 73 | Style = metroStyleManager1.Style = (_currentUC as MetroUserControl).Style = (toolbarUserControl1 as MetroUserControl).Style = Properties.Settings.Default.Style; 74 | Refresh(); 75 | } 76 | } 77 | 78 | private void btnPrevious_Click(object sender, EventArgs e) 79 | { 80 | if (CurrentUC.GetType() == typeof(Step1_InitUC)) 81 | { 82 | // Nothing 83 | 84 | EnabledButton(btnSettings, true); 85 | EnabledButton(btnPrevious, false); 86 | EnabledButton(btnNext, true, "&NEXT"); 87 | } 88 | else if (CurrentUC.GetType() == typeof(Step2_SearchUC)) 89 | { 90 | var uc = CurrentUC as Step2_SearchUC; 91 | _gridDataItems = uc.GridDataItems; 92 | 93 | var cUC = new Step1_InitUC(); 94 | lblTitle.Text = cUC.Title; 95 | CurrentUC = cUC; 96 | 97 | EnabledButton(btnSettings, true); 98 | EnabledButton(btnPrevious, false); 99 | EnabledButton(btnNext, true, "&NEXT"); 100 | } 101 | else if (CurrentUC.GetType() == typeof(Step3_SettingsUC)) 102 | { 103 | var uc = CurrentUC as Step3_SettingsUC; 104 | uc.SaveSettings(); 105 | 106 | if (Properties.Settings.Default.OperationType == OperationType.Movies || Properties.Settings.Default.OperationType == OperationType.MovieFile) 107 | { 108 | ShowLoading(true); 109 | var cUC = new Step2_SearchUC(); 110 | lblTitle.Text = cUC.Title; 111 | CurrentUC = cUC; 112 | cUC.OnReady += delegate 113 | { 114 | ShowLoading(false); 115 | }; 116 | 117 | EnabledButton(btnSettings, false); 118 | EnabledButton(btnPrevious, true); 119 | EnabledButton(btnNext, true, "&NEXT"); 120 | } 121 | else 122 | { 123 | var cUC = new Step1_InitUC(); 124 | lblTitle.Text = cUC.Title; 125 | CurrentUC = cUC; 126 | 127 | EnabledButton(btnSettings, true); 128 | EnabledButton(btnPrevious, false); 129 | EnabledButton(btnNext, true, "&NEXT"); 130 | } 131 | } 132 | else if (CurrentUC.GetType() == typeof(Step4_DownloadUC)) 133 | { 134 | var cUC = new Step3_SettingsUC(); 135 | lblTitle.Text = cUC.Title; 136 | CurrentUC = cUC; 137 | 138 | EnabledButton(btnSettings, false); 139 | EnabledButton(btnPrevious, true); 140 | EnabledButton(btnPing, true); 141 | EnabledButton(btnNext, true, "&NEXT"); 142 | } 143 | } 144 | 145 | private void btnNext_Click(object sender, EventArgs e) 146 | { 147 | if (CurrentUC.GetType() == typeof(Step1_InitUC)) 148 | { 149 | var uc = CurrentUC as Step1_InitUC; 150 | if (!string.IsNullOrEmpty(uc.InvalidMessage)) 151 | { 152 | MetroMessageBox.Show(this, uc.InvalidMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); 153 | return; 154 | } 155 | uc.SaveSettings(); 156 | 157 | if (Properties.Settings.Default.OperationType == OperationType.Movies || Properties.Settings.Default.OperationType == OperationType.MovieFile) 158 | { 159 | ShowLoading(true); 160 | var cUC = new Step2_SearchUC(); 161 | lblTitle.Text = cUC.Title; 162 | CurrentUC = cUC; 163 | cUC.OnReady += delegate 164 | { 165 | ShowLoading(false); 166 | }; 167 | } 168 | else if (Properties.Settings.Default.OperationType == OperationType.TVSeries) 169 | { 170 | _gridDataItems = new List(); 171 | string sID = Properties.Settings.Default.SeriesTvID; 172 | _gridDataItems.Add(new GridData(true, sID, sID, sID, sID)); 173 | 174 | var cUC = new Step3_SettingsUC(); 175 | lblTitle.Text = cUC.Title; 176 | CurrentUC = cUC; 177 | } 178 | EnabledButton(btnSettings, false); 179 | EnabledButton(btnPrevious, true); 180 | EnabledButton(btnNext, true, "&NEXT"); 181 | } 182 | else if (CurrentUC.GetType() == typeof(Step2_SearchUC)) 183 | { 184 | var uc = CurrentUC as Step2_SearchUC; 185 | if (!string.IsNullOrEmpty(uc.InvalidMessage)) 186 | { 187 | MetroMessageBox.Show(this, uc.InvalidMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); 188 | return; 189 | } 190 | _gridDataItems = uc.GridDataItems; 191 | 192 | var cUC = new Step3_SettingsUC(); 193 | lblTitle.Text = cUC.Title; 194 | CurrentUC = cUC; 195 | 196 | EnabledButton(btnSettings, false); 197 | EnabledButton(btnPrevious, true); 198 | EnabledButton(btnNext, true, "&NEXT"); 199 | } 200 | else if (CurrentUC.GetType() == typeof(Step3_SettingsUC)) 201 | { 202 | var uc = CurrentUC as Step3_SettingsUC; 203 | if (!string.IsNullOrEmpty(uc.InvalidMessage)) 204 | { 205 | MetroMessageBox.Show(this, uc.InvalidMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); 206 | return; 207 | } 208 | uc.SaveSettings(); 209 | 210 | if (_gridDataItems is null || _gridDataItems.Count == 0) 211 | { 212 | MetroMessageBox.Show(this, "Data is nulled", "Canceled", MessageBoxButtons.OK, MessageBoxIcon.Warning); 213 | return; 214 | } 215 | 216 | lblWaiting.Visible = spinnerWaiting.Visible = true; 217 | var cUC = new Step4_DownloadUC(_gridDataItems); 218 | lblTitle.Text = cUC.Title; 219 | CurrentUC = cUC; 220 | cUC.OnCanceled += delegate 221 | { 222 | lblWaiting.Visible = spinnerWaiting.Visible = false; 223 | EnabledButton(btnSettings, false); 224 | EnabledButton(btnPrevious, true); 225 | EnabledButton(btnNext, true, "&FINISH"); 226 | }; 227 | 228 | EnabledButton(btnSettings, false); 229 | EnabledButton(btnPrevious, false); 230 | EnabledButton(btnPing, false); 231 | EnabledButton(btnNext, false, "&FINISH"); 232 | } 233 | else if (CurrentUC.GetType() == typeof(Step4_DownloadUC)) 234 | { 235 | // Finish 236 | Application.Exit(); 237 | } 238 | } 239 | 240 | private void ShowLoading(bool show) 241 | { 242 | pnlCommands.Enabled = !show; 243 | pnlUserControl.Enabled = !show; 244 | 245 | lblWaiting.Visible = spinnerWaiting.Visible = show; 246 | } 247 | 248 | private void btnPing_Click(object sender, EventArgs e) 249 | { 250 | new PingForm().ShowDialog(); 251 | } 252 | 253 | private void btnVersion_Click(object sender, EventArgs e) 254 | { 255 | string url = "https://tv-api.com/client"; 256 | var ps = new ProcessStartInfo(url) 257 | { 258 | UseShellExecute = true, 259 | Verb = "open" 260 | }; 261 | Process.Start(ps); 262 | } 263 | 264 | private void btnVersion_MouseEnter(object sender, EventArgs e) 265 | { 266 | btnVersion.Text = "CHECK FOR UPDATE"; 267 | } 268 | 269 | private void btnVersion_MouseLeave(object sender, EventArgs e) 270 | { 271 | btnVersion.Text = _version; 272 | } 273 | } 274 | } 275 | -------------------------------------------------------------------------------- /IMDbAPI_Client/UserControls/Step2_SearchUC.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace IMDbAPI_Client.UserControls 2 | { 3 | partial class Step2_SearchUC 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); 33 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); 34 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); 35 | this.dgv = new MetroFramework.Controls.MetroGrid(); 36 | this.metroStyleManager1 = new MetroFramework.Components.MetroStyleManager(this.components); 37 | this.SelectColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); 38 | this.FolderColumn = new System.Windows.Forms.DataGridViewLinkColumn(); 39 | this.FullTitleColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); 40 | this.OriginalTitleColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); 41 | this.IdColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); 42 | this.InfoColumn = new System.Windows.Forms.DataGridViewButtonColumn(); 43 | this.SearchAgainColumn = new System.Windows.Forms.DataGridViewButtonColumn(); 44 | ((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit(); 45 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).BeginInit(); 46 | this.SuspendLayout(); 47 | // 48 | // dgv 49 | // 50 | this.dgv.AllowUserToAddRows = false; 51 | this.dgv.AllowUserToDeleteRows = false; 52 | this.dgv.AllowUserToResizeRows = false; 53 | this.dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; 54 | this.dgv.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); 55 | this.dgv.BorderStyle = System.Windows.Forms.BorderStyle.None; 56 | this.dgv.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; 57 | this.dgv.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; 58 | dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; 59 | dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(174)))), ((int)(((byte)(219))))); 60 | dataGridViewCellStyle1.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); 61 | dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); 62 | dataGridViewCellStyle1.Padding = new System.Windows.Forms.Padding(10, 15, 10, 15); 63 | dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(36)))), ((int)(((byte)(211)))), ((int)(((byte)(255))))); 64 | dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); 65 | dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; 66 | this.dgv.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; 67 | this.dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 68 | this.dgv.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { 69 | this.SelectColumn, 70 | this.FolderColumn, 71 | this.FullTitleColumn, 72 | this.OriginalTitleColumn, 73 | this.IdColumn, 74 | this.InfoColumn, 75 | this.SearchAgainColumn}); 76 | dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; 77 | dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); 78 | dataGridViewCellStyle2.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); 79 | dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136))))); 80 | dataGridViewCellStyle2.Padding = new System.Windows.Forms.Padding(5); 81 | dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(36)))), ((int)(((byte)(211)))), ((int)(((byte)(255))))); 82 | dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); 83 | dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; 84 | this.dgv.DefaultCellStyle = dataGridViewCellStyle2; 85 | this.dgv.Dock = System.Windows.Forms.DockStyle.Fill; 86 | this.dgv.EnableHeadersVisualStyles = false; 87 | this.dgv.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); 88 | this.dgv.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); 89 | this.dgv.HighLightPercentage = 0.5F; 90 | this.dgv.Location = new System.Drawing.Point(0, 0); 91 | this.dgv.Name = "dgv"; 92 | this.dgv.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; 93 | dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; 94 | dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(174)))), ((int)(((byte)(219))))); 95 | dataGridViewCellStyle3.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); 96 | dataGridViewCellStyle3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); 97 | dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(36)))), ((int)(((byte)(211)))), ((int)(((byte)(255))))); 98 | dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); 99 | dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; 100 | this.dgv.RowHeadersDefaultCellStyle = dataGridViewCellStyle3; 101 | this.dgv.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; 102 | this.dgv.RowTemplate.DefaultCellStyle.Padding = new System.Windows.Forms.Padding(5); 103 | this.dgv.RowTemplate.Height = 30; 104 | this.dgv.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; 105 | this.dgv.Size = new System.Drawing.Size(870, 440); 106 | this.dgv.TabIndex = 1; 107 | this.dgv.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgv_CellContentClick); 108 | // 109 | // metroStyleManager1 110 | // 111 | this.metroStyleManager1.Owner = this; 112 | // 113 | // SelectColumn 114 | // 115 | this.SelectColumn.DataPropertyName = "Select"; 116 | this.SelectColumn.FillWeight = 90F; 117 | this.SelectColumn.HeaderText = "SELECT"; 118 | this.SelectColumn.Name = "SelectColumn"; 119 | // 120 | // FolderColumn 121 | // 122 | this.FolderColumn.DataPropertyName = "Folder"; 123 | this.FolderColumn.FillWeight = 300F; 124 | this.FolderColumn.HeaderText = "FOLDER"; 125 | this.FolderColumn.Name = "FolderColumn"; 126 | this.FolderColumn.ReadOnly = true; 127 | // 128 | // FullTitleColumn 129 | // 130 | this.FullTitleColumn.DataPropertyName = "FullTitle"; 131 | this.FullTitleColumn.FillWeight = 300F; 132 | this.FullTitleColumn.HeaderText = "FULLTITLE"; 133 | this.FullTitleColumn.Name = "FullTitleColumn"; 134 | this.FullTitleColumn.ReadOnly = true; 135 | // 136 | // OriginalTitleColumn 137 | // 138 | this.OriginalTitleColumn.DataPropertyName = "OriginalTitle"; 139 | this.OriginalTitleColumn.FillWeight = 230F; 140 | this.OriginalTitleColumn.HeaderText = "ORIGINALTITLE"; 141 | this.OriginalTitleColumn.Name = "OriginalTitleColumn"; 142 | this.OriginalTitleColumn.ReadOnly = true; 143 | // 144 | // IdColumn 145 | // 146 | this.IdColumn.DataPropertyName = "Id"; 147 | this.IdColumn.HeaderText = "ID"; 148 | this.IdColumn.Name = "IdColumn"; 149 | // 150 | // InfoColumn 151 | // 152 | this.InfoColumn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 153 | this.InfoColumn.HeaderText = "INFO"; 154 | this.InfoColumn.Name = "InfoColumn"; 155 | this.InfoColumn.Text = ""; 156 | // 157 | // SearchAgainColumn 158 | // 159 | this.SearchAgainColumn.FillWeight = 120F; 160 | this.SearchAgainColumn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 161 | this.SearchAgainColumn.HeaderText = "SEARCH AGAIN"; 162 | this.SearchAgainColumn.Name = "SearchAgainColumn"; 163 | // 164 | // Step2_SearchUC 165 | // 166 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); 167 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 168 | this.Controls.Add(this.dgv); 169 | this.Font = new System.Drawing.Font("Segoe UI", 9.75F); 170 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 171 | this.Name = "Step2_SearchUC"; 172 | this.Size = new System.Drawing.Size(870, 440); 173 | ((System.ComponentModel.ISupportInitialize)(this.dgv)).EndInit(); 174 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager1)).EndInit(); 175 | this.ResumeLayout(false); 176 | 177 | } 178 | 179 | #endregion 180 | private MetroFramework.Controls.MetroGrid dgv; 181 | private MetroFramework.Components.MetroStyleManager metroStyleManager1; 182 | private System.Windows.Forms.DataGridViewCheckBoxColumn SelectColumn; 183 | private System.Windows.Forms.DataGridViewLinkColumn FolderColumn; 184 | private System.Windows.Forms.DataGridViewTextBoxColumn FullTitleColumn; 185 | private System.Windows.Forms.DataGridViewTextBoxColumn OriginalTitleColumn; 186 | private System.Windows.Forms.DataGridViewTextBoxColumn IdColumn; 187 | private System.Windows.Forms.DataGridViewButtonColumn InfoColumn; 188 | private System.Windows.Forms.DataGridViewButtonColumn SearchAgainColumn; 189 | } 190 | } 191 | --------------------------------------------------------------------------------