All scraping code removed
This commit is contained in:
parent
c61bc27a7b
commit
df90fc5361
106 changed files with 666 additions and 5319 deletions
|
|
@ -7,7 +7,7 @@ using System.Windows.Forms;
|
|||
|
||||
namespace LibationWinForm
|
||||
{
|
||||
public interface IRunnableDialog : IValidatable
|
||||
public interface IRunnableDialog
|
||||
{
|
||||
IButtonControl AcceptButton { get; set; }
|
||||
Control.ControlCollection Controls { get; }
|
||||
|
|
|
|||
|
|
@ -36,26 +36,6 @@ namespace LibationWinForm
|
|||
|
||||
public static async Task Run(this IRunnableDialog dialog)
|
||||
{
|
||||
// validate children
|
||||
// OfType<T>() -- skips items which aren't of the required type
|
||||
// Cast<T>() -- throws an exception
|
||||
var errorStrings = dialog
|
||||
// get children
|
||||
.Controls
|
||||
.GetControlListRecursive()
|
||||
.OfType<IValidatable>()
|
||||
// and self
|
||||
.Append(dialog)
|
||||
// validate. get errors
|
||||
.Select(c => c.StringBasedValidate())
|
||||
// ignore successes
|
||||
.Where(e => e != null);
|
||||
if (errorStrings.Any())
|
||||
{
|
||||
MessageBox.Show(errorStrings.Aggregate((a, b) => a + "\r\n" + b));
|
||||
return;
|
||||
}
|
||||
|
||||
// get top level controls only. If Enabled, disable and push on stack
|
||||
var disabledStack = disable(dialog);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LibationWinForm
|
||||
{
|
||||
public interface IValidatable
|
||||
{
|
||||
// forms has a framework for ValidateChildren and ErrorProvider.s
|
||||
// i don't feel like setting it up right now. doing this instead
|
||||
string StringBasedValidate();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
namespace LibationWinForm
|
||||
{
|
||||
partial class ScanLibraryDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.websiteProcessorControl1 = new LibationWinForm.WebsiteProcessorControl();
|
||||
this.BeginScanBtn = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// websiteProcessorControl1
|
||||
//
|
||||
this.websiteProcessorControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.websiteProcessorControl1.Location = new System.Drawing.Point(12, 12);
|
||||
this.websiteProcessorControl1.Name = "websiteProcessorControl1";
|
||||
this.websiteProcessorControl1.Size = new System.Drawing.Size(324, 137);
|
||||
this.websiteProcessorControl1.TabIndex = 0;
|
||||
//
|
||||
// BeginScanBtn
|
||||
//
|
||||
this.BeginScanBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.BeginScanBtn.Location = new System.Drawing.Point(12, 155);
|
||||
this.BeginScanBtn.Name = "BeginScanBtn";
|
||||
this.BeginScanBtn.Size = new System.Drawing.Size(324, 23);
|
||||
this.BeginScanBtn.TabIndex = 1;
|
||||
this.BeginScanBtn.Text = "BEGIN SCAN";
|
||||
this.BeginScanBtn.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// ScanLibraryDialog
|
||||
//
|
||||
this.AcceptButton = this.BeginScanBtn;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(348, 190);
|
||||
this.Controls.Add(this.BeginScanBtn);
|
||||
this.Controls.Add(this.websiteProcessorControl1);
|
||||
this.Name = "ScanLibraryDialog";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Scan Library";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private WebsiteProcessorControl websiteProcessorControl1;
|
||||
private System.Windows.Forms.Button BeginScanBtn;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Dinah.Core;
|
||||
using ScrapingDomainServices;
|
||||
|
||||
namespace LibationWinForm
|
||||
{
|
||||
public partial class ScanLibraryDialog : Form, IIndexLibraryDialog
|
||||
{
|
||||
public ScanLibraryDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public string StringBasedValidate() => null;
|
||||
|
||||
List<string> successMessages { get; } = new List<string>();
|
||||
public string SuccessMessage => string.Join("\r\n", successMessages);
|
||||
|
||||
public int NewBooksAdded { get; private set; }
|
||||
public int TotalBooksProcessed { get; private set; }
|
||||
|
||||
public async Task DoMainWorkAsync()
|
||||
{
|
||||
using var pageRetriever = websiteProcessorControl1.GetPageRetriever();
|
||||
var jsonFilepaths = await DownloadLibrary.DownloadLibraryAsync(pageRetriever).ConfigureAwait(false);
|
||||
|
||||
successMessages.Add($"Downloaded {"library page".PluralizeWithCount(jsonFilepaths.Count)}");
|
||||
|
||||
(TotalBooksProcessed, NewBooksAdded) = await Indexer
|
||||
.IndexLibraryAsync(jsonFilepaths)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
successMessages.Add($"Total processed: {TotalBooksProcessed}");
|
||||
successMessages.Add($"New: {NewBooksAdded}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
namespace LibationWinForm
|
||||
{
|
||||
partial class WebsiteProcessorControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.AuthGb = new System.Windows.Forms.GroupBox();
|
||||
this.AuthRb_Browserless = new System.Windows.Forms.RadioButton();
|
||||
this.AuthRb_UseCanonicalChrome = new System.Windows.Forms.RadioButton();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.AuthRb_ManualLogin = new System.Windows.Forms.RadioButton();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.PasswordTb = new System.Windows.Forms.TextBox();
|
||||
this.UsernameTb = new System.Windows.Forms.TextBox();
|
||||
this.AuthGb.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// AuthGb
|
||||
//
|
||||
this.AuthGb.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.AuthGb.Controls.Add(this.AuthRb_Browserless);
|
||||
this.AuthGb.Controls.Add(this.AuthRb_UseCanonicalChrome);
|
||||
this.AuthGb.Controls.Add(this.label3);
|
||||
this.AuthGb.Controls.Add(this.AuthRb_ManualLogin);
|
||||
this.AuthGb.Controls.Add(this.label2);
|
||||
this.AuthGb.Controls.Add(this.PasswordTb);
|
||||
this.AuthGb.Controls.Add(this.UsernameTb);
|
||||
this.AuthGb.Location = new System.Drawing.Point(0, 0);
|
||||
this.AuthGb.Name = "AuthGb";
|
||||
this.AuthGb.Size = new System.Drawing.Size(324, 137);
|
||||
this.AuthGb.TabIndex = 1;
|
||||
this.AuthGb.TabStop = false;
|
||||
this.AuthGb.Text = "Authentication";
|
||||
//
|
||||
// AuthRb_Browserless
|
||||
//
|
||||
this.AuthRb_Browserless.AutoSize = true;
|
||||
this.AuthRb_Browserless.Checked = true;
|
||||
this.AuthRb_Browserless.Location = new System.Drawing.Point(6, 19);
|
||||
this.AuthRb_Browserless.Name = "AuthRb_Browserless";
|
||||
this.AuthRb_Browserless.Size = new System.Drawing.Size(143, 17);
|
||||
this.AuthRb_Browserless.TabIndex = 0;
|
||||
this.AuthRb_Browserless.TabStop = true;
|
||||
this.AuthRb_Browserless.Text = "Browserless with cookies";
|
||||
this.AuthRb_Browserless.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// AuthRb_UseCanonicalChrome
|
||||
//
|
||||
this.AuthRb_UseCanonicalChrome.AutoSize = true;
|
||||
this.AuthRb_UseCanonicalChrome.Location = new System.Drawing.Point(6, 114);
|
||||
this.AuthRb_UseCanonicalChrome.Name = "AuthRb_UseCanonicalChrome";
|
||||
this.AuthRb_UseCanonicalChrome.Size = new System.Drawing.Size(216, 17);
|
||||
this.AuthRb_UseCanonicalChrome.TabIndex = 6;
|
||||
this.AuthRb_UseCanonicalChrome.Text = "Use Canonical Chrome. SEE WARNING";
|
||||
this.AuthRb_UseCanonicalChrome.UseVisualStyleBackColor = true;
|
||||
this.AuthRb_UseCanonicalChrome.CheckedChanged += new System.EventHandler(this.AuthRb_UseCanonicalChrome_CheckedChanged);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(27, 91);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(53, 13);
|
||||
this.label3.TabIndex = 4;
|
||||
this.label3.Text = "Password";
|
||||
//
|
||||
// AuthRb_ManualLogin
|
||||
//
|
||||
this.AuthRb_ManualLogin.AutoSize = true;
|
||||
this.AuthRb_ManualLogin.Location = new System.Drawing.Point(6, 42);
|
||||
this.AuthRb_ManualLogin.Name = "AuthRb_ManualLogin";
|
||||
this.AuthRb_ManualLogin.Size = new System.Drawing.Size(89, 17);
|
||||
this.AuthRb_ManualLogin.TabIndex = 1;
|
||||
this.AuthRb_ManualLogin.Text = "Manual Login";
|
||||
this.AuthRb_ManualLogin.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(27, 65);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(85, 13);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "Username/Email";
|
||||
//
|
||||
// PasswordTb
|
||||
//
|
||||
this.PasswordTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.PasswordTb.Location = new System.Drawing.Point(118, 88);
|
||||
this.PasswordTb.Name = "PasswordTb";
|
||||
this.PasswordTb.PasswordChar = '*';
|
||||
this.PasswordTb.Size = new System.Drawing.Size(200, 20);
|
||||
this.PasswordTb.TabIndex = 5;
|
||||
this.PasswordTb.TextChanged += new System.EventHandler(this.UserIsEnteringLoginInfo);
|
||||
this.PasswordTb.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.UsernamePasswordTb_KeyPress);
|
||||
this.PasswordTb.MouseUp += new System.Windows.Forms.MouseEventHandler(this.UserIsEnteringLoginInfo);
|
||||
//
|
||||
// UsernameTb
|
||||
//
|
||||
this.UsernameTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.UsernameTb.Location = new System.Drawing.Point(118, 62);
|
||||
this.UsernameTb.Name = "UsernameTb";
|
||||
this.UsernameTb.Size = new System.Drawing.Size(200, 20);
|
||||
this.UsernameTb.TabIndex = 3;
|
||||
this.UsernameTb.TextChanged += new System.EventHandler(this.UserIsEnteringLoginInfo);
|
||||
this.UsernameTb.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.UsernamePasswordTb_KeyPress);
|
||||
this.UsernameTb.MouseUp += new System.Windows.Forms.MouseEventHandler(this.UserIsEnteringLoginInfo);
|
||||
//
|
||||
// WebsiteProcessorControl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.AuthGb);
|
||||
this.Name = "WebsiteProcessorControl";
|
||||
this.Size = new System.Drawing.Size(324, 137);
|
||||
this.AuthGb.ResumeLayout(false);
|
||||
this.AuthGb.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox AuthGb;
|
||||
private System.Windows.Forms.RadioButton AuthRb_UseCanonicalChrome;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.RadioButton AuthRb_ManualLogin;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox PasswordTb;
|
||||
private System.Windows.Forms.TextBox UsernameTb;
|
||||
private System.Windows.Forms.RadioButton AuthRb_Browserless;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
using AudibleDotComAutomation;
|
||||
|
||||
namespace LibationWinForm
|
||||
{
|
||||
public partial class WebsiteProcessorControl : UserControl, IValidatable
|
||||
{
|
||||
public event EventHandler<KeyPressEventArgs> KeyPressSubmit;
|
||||
|
||||
public WebsiteProcessorControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public IPageRetriever GetPageRetriever()
|
||||
=> AuthRb_UseCanonicalChrome.Checked ? new UserDataSeleniumRetriever()
|
||||
: AuthRb_Browserless.Checked ? (IPageRetriever)new BrowserlessRetriever()
|
||||
: new ManualLoginSeleniumRetriever(UsernameTb.Text, PasswordTb.Text);
|
||||
|
||||
public string StringBasedValidate()
|
||||
{
|
||||
if (AuthRb_ManualLogin.Checked && (string.IsNullOrWhiteSpace(UsernameTb.Text) || string.IsNullOrWhiteSpace(PasswordTb.Text)))
|
||||
return "must fill in username and password";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void UsernamePasswordTb_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (e.KeyChar == (char)Keys.Return)
|
||||
{
|
||||
KeyPressSubmit?.Invoke(sender, e);
|
||||
// call your method for action on enter
|
||||
e.Handled = true; // suppress default handling
|
||||
}
|
||||
}
|
||||
|
||||
private void UserIsEnteringLoginInfo(object sender, EventArgs e) => AuthRb_ManualLogin.Checked = true;
|
||||
|
||||
private void AuthRb_UseCanonicalChrome_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (AuthRb_UseCanonicalChrome.Checked)
|
||||
MessageBox.Show(@"A canonical version of Chrome will be used including User Data, cookies. etc. Selenium chromedriver won't launch URL if another Chrome instance is open");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Loading…
Add table
Add a link
Reference in a new issue