diff --git a/EPUBium Desktop/App.config b/EPUBium Desktop/App.config index a18b084..0df5b25 100644 --- a/EPUBium Desktop/App.config +++ b/EPUBium Desktop/App.config @@ -30,6 +30,9 @@ + + http://localhost:8080 + diff --git a/EPUBium Desktop/EPUBium Desktop.csproj b/EPUBium Desktop/EPUBium Desktop.csproj index fb40e38..661fc60 100644 --- a/EPUBium Desktop/EPUBium Desktop.csproj +++ b/EPUBium Desktop/EPUBium Desktop.csproj @@ -110,15 +110,25 @@ FrmChangeResource.cs + + Form + + + InputDialog.cs + + Form1.cs FrmChangeResource.cs + + InputDialog.cs + ResXFileCodeGenerator Resources.Designer.cs diff --git a/EPUBium Desktop/FrmChangeResource.Designer.cs b/EPUBium Desktop/FrmChangeResource.Designer.cs index f7dbf11..0684632 100644 --- a/EPUBium Desktop/FrmChangeResource.Designer.cs +++ b/EPUBium Desktop/FrmChangeResource.Designer.cs @@ -28,17 +28,18 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmChangeResource)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.label2 = new System.Windows.Forms.Label(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.btnDefault = new System.Windows.Forms.Button(); this.btnUse = new System.Windows.Forms.Button(); this.btnOpenDir = new System.Windows.Forms.Button(); - this.btnRestart = new System.Windows.Forms.Button(); + this.btnThemeDev = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.tblItems = new System.Windows.Forms.DataGridView(); this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -46,9 +47,13 @@ private void InitializeComponent() this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column3 = new System.Windows.Forms.DataGridViewLinkColumn(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.mnuDevMode = new System.Windows.Forms.ContextMenuStrip(this.components); + this.mnuThemeDevUseDir = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuThemeDevUseUrl = new System.Windows.Forms.ToolStripMenuItem(); this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tblItems)).BeginInit(); + this.mnuDevMode.SuspendLayout(); this.SuspendLayout(); // // tableLayoutPanel1 @@ -88,7 +93,7 @@ private void InitializeComponent() this.tableLayoutPanel2.Controls.Add(this.btnDefault, 0, 0); this.tableLayoutPanel2.Controls.Add(this.btnUse, 1, 0); this.tableLayoutPanel2.Controls.Add(this.btnOpenDir, 0, 1); - this.tableLayoutPanel2.Controls.Add(this.btnRestart, 1, 1); + this.tableLayoutPanel2.Controls.Add(this.btnThemeDev, 1, 1); this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 793); this.tableLayoutPanel2.Name = "tableLayoutPanel2"; @@ -134,17 +139,17 @@ private void InitializeComponent() this.btnOpenDir.UseVisualStyleBackColor = true; this.btnOpenDir.Click += new System.EventHandler(this.btnOpenDir_Click); // - // btnRestart + // btnThemeDev // - this.btnRestart.Dock = System.Windows.Forms.DockStyle.Fill; - this.btnRestart.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.btnRestart.Location = new System.Drawing.Point(393, 63); - this.btnRestart.Name = "btnRestart"; - this.btnRestart.Size = new System.Drawing.Size(384, 54); - this.btnRestart.TabIndex = 1; - this.btnRestart.Text = "主题包开发模式"; - this.btnRestart.UseVisualStyleBackColor = true; - this.btnRestart.Click += new System.EventHandler(this.btnRestart_Click); + this.btnThemeDev.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnThemeDev.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnThemeDev.Location = new System.Drawing.Point(393, 63); + this.btnThemeDev.Name = "btnThemeDev"; + this.btnThemeDev.Size = new System.Drawing.Size(384, 54); + this.btnThemeDev.TabIndex = 1; + this.btnThemeDev.Text = "主题包开发模式"; + this.btnThemeDev.UseVisualStyleBackColor = true; + this.btnThemeDev.Click += new System.EventHandler(this.btnThemeDev_Click); // // label1 // @@ -198,14 +203,14 @@ private void InitializeComponent() // // Column1 // - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle16.ForeColor = System.Drawing.Color.Black; - dataGridViewCellStyle16.NullValue = ((object)(resources.GetObject("dataGridViewCellStyle16.NullValue"))); - dataGridViewCellStyle16.Padding = new System.Windows.Forms.Padding(32); - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.Black; - this.Column1.DefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle4.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle4.ForeColor = System.Drawing.Color.Black; + dataGridViewCellStyle4.NullValue = ((object)(resources.GetObject("dataGridViewCellStyle4.NullValue"))); + dataGridViewCellStyle4.Padding = new System.Windows.Forms.Padding(32); + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.Black; + this.Column1.DefaultCellStyle = dataGridViewCellStyle4; this.Column1.HeaderText = "Column1"; this.Column1.Image = global::EPUBium_Desktop.Properties.Resources._default; this.Column1.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom; @@ -218,13 +223,13 @@ private void InitializeComponent() // Column2 // this.Column2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle17.ForeColor = System.Drawing.Color.Black; - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.Color.Black; - dataGridViewCellStyle17.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.Column2.DefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.Black; + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.Black; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.Column2.DefaultCellStyle = dataGridViewCellStyle5; this.Column2.HeaderText = "Column2"; this.Column2.MinimumWidth = 10; this.Column2.Name = "Column2"; @@ -233,13 +238,13 @@ private void InitializeComponent() // // Column3 // - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomRight; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle18.ForeColor = System.Drawing.Color.Black; - dataGridViewCellStyle18.Padding = new System.Windows.Forms.Padding(0, 0, 20, 20); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.Black; - this.Column3.DefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomRight; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.ForeColor = System.Drawing.Color.Black; + dataGridViewCellStyle6.Padding = new System.Windows.Forms.Padding(0, 0, 20, 20); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.Black; + this.Column3.DefaultCellStyle = dataGridViewCellStyle6; this.Column3.HeaderText = "Column3"; this.Column3.MinimumWidth = 10; this.Column3.Name = "Column3"; @@ -252,6 +257,29 @@ private void InitializeComponent() this.openFileDialog1.Filter = "资源包描述文件|meta.json|资源包图标|pack.png"; this.openFileDialog1.Title = "选择资源包的文件"; // + // mnuDevMode + // + this.mnuDevMode.ImageScalingSize = new System.Drawing.Size(32, 32); + this.mnuDevMode.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mnuThemeDevUseDir, + this.mnuThemeDevUseUrl}); + this.mnuDevMode.Name = "mnuDevMode"; + this.mnuDevMode.Size = new System.Drawing.Size(301, 124); + // + // mnuThemeDevUseDir + // + this.mnuThemeDevUseDir.Name = "mnuThemeDevUseDir"; + this.mnuThemeDevUseDir.Size = new System.Drawing.Size(300, 38); + this.mnuThemeDevUseDir.Text = "使用本地文件夹"; + this.mnuThemeDevUseDir.Click += new System.EventHandler(this.mnuThemeDevUseDir_Click); + // + // mnuThemeDevUseUrl + // + this.mnuThemeDevUseUrl.Name = "mnuThemeDevUseUrl"; + this.mnuThemeDevUseUrl.Size = new System.Drawing.Size(300, 38); + this.mnuThemeDevUseUrl.Text = "使用http路径"; + this.mnuThemeDevUseUrl.Click += new System.EventHandler(this.mnuThemeDevUseUrl_Click); + // // FrmChangeResource // this.AutoScaleDimensions = new System.Drawing.SizeF(192F, 192F); @@ -271,6 +299,7 @@ private void InitializeComponent() this.tableLayoutPanel1.PerformLayout(); this.tableLayoutPanel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.tblItems)).EndInit(); + this.mnuDevMode.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -285,12 +314,15 @@ private void InitializeComponent() private System.Windows.Forms.Button btnUse; private System.Windows.Forms.Label label2; private System.Windows.Forms.Button btnOpenDir; - private System.Windows.Forms.Button btnRestart; + private System.Windows.Forms.Button btnThemeDev; private System.Windows.Forms.DataGridView tblItems; private System.Windows.Forms.DataGridViewTextBoxColumn Column4; private System.Windows.Forms.DataGridViewImageColumn Column1; private System.Windows.Forms.DataGridViewTextBoxColumn Column2; private System.Windows.Forms.DataGridViewLinkColumn Column3; private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.ContextMenuStrip mnuDevMode; + private System.Windows.Forms.ToolStripMenuItem mnuThemeDevUseDir; + private System.Windows.Forms.ToolStripMenuItem mnuThemeDevUseUrl; } } \ No newline at end of file diff --git a/EPUBium Desktop/FrmChangeResource.cs b/EPUBium Desktop/FrmChangeResource.cs index b486f39..a1df4ec 100644 --- a/EPUBium Desktop/FrmChangeResource.cs +++ b/EPUBium Desktop/FrmChangeResource.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using System.Windows.Forms; using System.IO; +using System.Net; namespace EPUBium_Desktop { @@ -227,14 +228,82 @@ private void btnUse_Click(object sender, EventArgs e) } } - private void btnRestart_Click(object sender, EventArgs e) + private void btnThemeDev_Click(object sender, EventArgs e) + { + mnuDevMode.Show(btnThemeDev, 0, btnThemeDev.Height); + } + + private void mnuThemeDevUseDir_Click(object sender, EventArgs e) { MessageBox.Show(this, "开发模式可以指定本地的一个目录作为资源包的根目录,应用后刷新生效,重启或点击恢复默认按钮可还原。"); if (openFileDialog1.ShowDialog(this) == DialogResult.OK) { + Program.HtDocs.Overrides?.Dispose(); Program.HtDocs.Overrides = new LocalDirRoot(Path.GetDirectoryName(openFileDialog1.FileName)); MessageBox.Show(this, "主题包已应用。在界面上右键刷新生效"); } } + + private void mnuThemeDevUseUrl_Click(object sender, EventArgs e) + { + MessageBox.Show(this, "开发模式可以指定一个URL作为资源包的根目录,应用后刷新生效,重启或点击恢复默认按钮可还原。"); + string url = InputDialog.Input(this, "请输入url根目录",Properties.Settings.Default.devLastUrl ?? ""); + if (url != null) + { + if (url.StartsWith("http") && url.Contains("://")) + { + Program.HtDocs.Overrides?.Dispose(); + Program.HtDocs.Overrides = new UrlPackFile(url); + Properties.Settings.Default.devLastUrl = url; + Properties.Settings.Default.Save(); + MessageBox.Show(this, "主题包已应用。在界面上右键刷新生效"); + } + else + { + MessageBox.Show("无效的URL路径"); + } + } + } + } + + class UrlPackFile : IPakFile + { + + private string urlRoot; + + public UrlPackFile(string urlRoot) + { + if (urlRoot.EndsWith("/")) + { + urlRoot = urlRoot.Substring(0, urlRoot.Length - 1); + } + this.urlRoot = urlRoot; + } + + public IPakFile Overrides { get; set; } + + public void Dispose() + { + try + { + webClient.Dispose(); + }catch { } + } + private WebClient webClient = new WebClient(); + public Stream OpenRead(string path) + { + if (path.StartsWith("/")) + { + path = path.Substring(1); + } + string url = urlRoot + "/" + path; + try + { + return webClient.OpenRead(url); + }catch + { + return null; + } + } } } diff --git a/EPUBium Desktop/FrmChangeResource.resx b/EPUBium Desktop/FrmChangeResource.resx index ef2938d..3080ed1 100644 --- a/EPUBium Desktop/FrmChangeResource.resx +++ b/EPUBium Desktop/FrmChangeResource.resx @@ -136,7 +136,7 @@ True - + Qk32AgAAAAAAADYAAAAoAAAADgAAABAAAAABABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACEgoTGw8bGw8bGw8bGw8bGw8bGw8bG @@ -162,4 +162,7 @@ 17, 17 + + 281, 17 + \ No newline at end of file diff --git a/EPUBium Desktop/InputDialog.cs b/EPUBium Desktop/InputDialog.cs new file mode 100644 index 0000000..667e1e9 --- /dev/null +++ b/EPUBium Desktop/InputDialog.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace EPUBium_Desktop +{ + public partial class InputDialog : Form + { + public InputDialog() + { + InitializeComponent(); + } + + + + public static string Input(Form owner, String hint,string prefilled = "") { + bool ownerToplevel = owner.TopMost; + String text = ""; + InputDialog form = new InputDialog(); + form.Text = hint; + form.textBox1.Text = prefilled; + if (form.ShowDialog(owner) == DialogResult.OK) { + text = form.textBox1.Text; + } + else + { + text = null; + } + owner.TopMost = ownerToplevel; + return text; + } + + + private void button2_Click(object sender, EventArgs e) + { + + string t = ""; + try + { + t= Clipboard.GetText().Trim().Replace("\r","").Replace("\n",""); + } + catch + { + t = ""; + } + if(t != null && t.Length > 0) + { + textBox1.Text = t; + } + } + + private void textBox1_TextChanged(object sender, EventArgs e) + { + if (textBox1.Text.Contains("\n")) + { + textBox1.Text = textBox1.Text.Replace("\n", "").Replace("\r", ""); + DialogResult = DialogResult.OK; + } + } + + private void InputDialog_Load(object sender, EventArgs e) + { + + } + } +} diff --git a/EPUBium Desktop/InputDialog.designer.cs b/EPUBium Desktop/InputDialog.designer.cs new file mode 100644 index 0000000..b8f3710 --- /dev/null +++ b/EPUBium Desktop/InputDialog.designer.cs @@ -0,0 +1,131 @@ +namespace EPUBium_Desktop +{ + partial class InputDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.textBox1 = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.panel1 = new System.Windows.Forms.Panel(); + this.button2 = new System.Windows.Forms.Button(); + this.tableLayoutPanel1.SuspendLayout(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // textBox1 + // + this.textBox1.AcceptsReturn = true; + this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBox1.Location = new System.Drawing.Point(0, 0); + this.textBox1.Margin = new System.Windows.Forms.Padding(6); + this.textBox1.Multiline = true; + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(505, 45); + this.textBox1.TabIndex = 0; + this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); + // + // button1 + // + this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; + this.button1.Dock = System.Windows.Forms.DockStyle.Fill; + this.button1.Location = new System.Drawing.Point(427, 73); + this.button1.Margin = new System.Windows.Forms.Padding(6); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(161, 40); + this.button1.TabIndex = 1; + this.button1.Text = "确定"; + this.button1.UseVisualStyleBackColor = true; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 2; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70.93552F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 29.06449F)); + this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.button1, 1, 2); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(24, 24); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 3; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 43.11377F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 13.77246F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 43.11377F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(594, 119); + this.tableLayoutPanel1.TabIndex = 2; + // + // panel1 + // + this.tableLayoutPanel1.SetColumnSpan(this.panel1, 2); + this.panel1.Controls.Add(this.textBox1); + this.panel1.Controls.Add(this.button2); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(3, 3); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(588, 45); + this.panel1.TabIndex = 0; + // + // button2 + // + this.button2.Dock = System.Windows.Forms.DockStyle.Right; + this.button2.Location = new System.Drawing.Point(505, 0); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(83, 45); + this.button2.TabIndex = 0; + this.button2.Text = "粘贴"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // InputDialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(642, 167); + this.Controls.Add(this.tableLayoutPanel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Margin = new System.Windows.Forms.Padding(6); + this.Name = "InputDialog"; + this.Padding = new System.Windows.Forms.Padding(24); + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "请输入URL"; + this.Load += new System.EventHandler(this.InputDialog_Load); + this.tableLayoutPanel1.ResumeLayout(false); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button button2; + } +} \ No newline at end of file diff --git a/EPUBium Desktop/InputDialog.resx b/EPUBium Desktop/InputDialog.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/EPUBium Desktop/InputDialog.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/EPUBium Desktop/Properties/Settings.Designer.cs b/EPUBium Desktop/Properties/Settings.Designer.cs index 06f7659..ef6a78c 100644 --- a/EPUBium Desktop/Properties/Settings.Designer.cs +++ b/EPUBium Desktop/Properties/Settings.Designer.cs @@ -91,5 +91,17 @@ public bool EnableWindowsFormsHighDpiAutoResizing { return ((bool)(this["EnableWindowsFormsHighDpiAutoResizing"])); } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("http://localhost:8080")] + public string devLastUrl { + get { + return ((string)(this["devLastUrl"])); + } + set { + this["devLastUrl"] = value; + } + } } } diff --git a/EPUBium Desktop/Properties/Settings.settings b/EPUBium Desktop/Properties/Settings.settings index 27c4025..1ae596a 100644 --- a/EPUBium Desktop/Properties/Settings.settings +++ b/EPUBium Desktop/Properties/Settings.settings @@ -20,5 +20,8 @@ True + + http://localhost:8080 + \ No newline at end of file diff --git a/EPUBium Desktop/Settings.cs b/EPUBium Desktop/Settings.cs new file mode 100644 index 0000000..f5bfa38 --- /dev/null +++ b/EPUBium Desktop/Settings.cs @@ -0,0 +1,28 @@ +namespace EPUBium_Desktop.Properties { + + + // 通过此类可以处理设置类的特定事件: + // 在更改某个设置的值之前将引发 SettingChanging 事件。 + // 在更改某个设置的值之后将引发 PropertyChanged 事件。 + // 在加载设置值之后将引发 SettingsLoaded 事件。 + // 在保存设置值之前将引发 SettingsSaving 事件。 + internal sealed partial class Settings { + + public Settings() { + // // 若要为保存和更改设置添加事件处理程序,请取消注释下列行: + // + // this.SettingChanging += this.SettingChangingEventHandler; + // + // this.SettingsSaving += this.SettingsSavingEventHandler; + // + } + + private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { + // 在此处添加用于处理 SettingChangingEvent 事件的代码。 + } + + private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { + // 在此处添加用于处理 SettingsSaving 事件的代码。 + } + } +} diff --git a/EPUBium Desktop/htdocs.pak b/EPUBium Desktop/htdocs.pak index 3a26a6b..6009f9d 100644 Binary files a/EPUBium Desktop/htdocs.pak and b/EPUBium Desktop/htdocs.pak differ