Skip to content

Commit

Permalink
refactor: merge ServerForm's parital declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
chsbuffer committed Oct 7, 2020
1 parent adcc6a7 commit 020c2d7
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 5,127 deletions.
139 changes: 0 additions & 139 deletions Netch/Forms/ServerForm.Designer.cs

This file was deleted.

125 changes: 123 additions & 2 deletions Netch/Forms/ServerForm.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
using System;
using System.ComponentModel;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using Netch.Models;
using Netch.Properties;
using Netch.Utils;

namespace Netch.Forms
{
public abstract partial class ServerForm : Form
public abstract class ServerForm : Form
{
protected abstract string TypeName { get; }
protected Server Server { get; set; }
Expand Down Expand Up @@ -191,5 +193,124 @@ private void ControlButton_Click(object sender, EventArgs e)

Close();
}

private IContainer components = null;

protected override void Dispose(bool disposing)
{
if (disposing)
{
components?.Dispose();
}

base.Dispose(disposing);
}

private void InitializeComponent()
{
ConfigurationGroupBox = new GroupBox();
AddressLabel = new Label();
PortTextBox = new TextBox();
AddressTextBox = new TextBox();
RemarkTextBox = new TextBox();
RemarkLabel = new Label();
PortLabel = new Label();
ConfigurationGroupBox.SuspendLayout();
SuspendLayout();
//
// ConfigurationGroupBox
//
ConfigurationGroupBox.AutoSize = true;
ConfigurationGroupBox.AutoSizeMode = AutoSizeMode.GrowAndShrink;
ConfigurationGroupBox.Controls.Add(AddressLabel);
ConfigurationGroupBox.Controls.Add(PortTextBox);
ConfigurationGroupBox.Controls.Add(AddressTextBox);
ConfigurationGroupBox.Controls.Add(RemarkTextBox);
ConfigurationGroupBox.Controls.Add(RemarkLabel);
ConfigurationGroupBox.Controls.Add(PortLabel);
ConfigurationGroupBox.Dock = DockStyle.Fill;
ConfigurationGroupBox.Location = new Point(5, 5);
ConfigurationGroupBox.Name = "ConfigurationGroupBox";
ConfigurationGroupBox.Size = new Size(434, 127);
ConfigurationGroupBox.TabIndex = 0;
ConfigurationGroupBox.TabStop = false;
ConfigurationGroupBox.Text = "Configuration";
//
// AddressLabel
//
AddressLabel.AutoSize = true;
AddressLabel.Location = new Point(10, ControlLineHeight * 2);
AddressLabel.Name = "AddressLabel";
AddressLabel.Size = new Size(56, 17);
AddressLabel.TabIndex = 2;
AddressLabel.Text = "Address";
//
// PortTextBox
//
PortTextBox.Location = new Point(358, ControlLineHeight * 2);
PortTextBox.Name = "PortTextBox";
PortTextBox.Size = new Size(56, 23);
PortTextBox.TabIndex = 5;
PortTextBox.TextAlign = HorizontalAlignment.Center;
//
// AddressTextBox
//
AddressTextBox.Location = new Point(120, ControlLineHeight * 2);
AddressTextBox.Name = "AddressTextBox";
AddressTextBox.Size = new Size(232, 23);
AddressTextBox.TabIndex = 3;
AddressTextBox.TextAlign = HorizontalAlignment.Center;
//
// RemarkTextBox
//
RemarkTextBox.Location = new Point(120, ControlLineHeight);
RemarkTextBox.Name = "RemarkTextBox";
RemarkTextBox.Size = new Size(294, 23);
RemarkTextBox.TabIndex = 1;
RemarkTextBox.TextAlign = HorizontalAlignment.Center;
//
// RemarkLabel
//
RemarkLabel.AutoSize = true;
RemarkLabel.Location = new Point(10, ControlLineHeight);
RemarkLabel.Name = "RemarkLabel";
RemarkLabel.Size = new Size(53, 17);
RemarkLabel.TabIndex = 0;
RemarkLabel.Text = "Remark";
//
// PortLabel
//
PortLabel.AutoSize = true;
PortLabel.Location = new Point(351, ControlLineHeight * 2);
PortLabel.Name = "PortLabel";
PortLabel.Size = new Size(11, 17);
PortLabel.TabIndex = 4;
PortLabel.Text = ":";
//
// ServerForm
//
AutoScaleDimensions = new SizeF(96F, 96F);
AutoScaleMode = AutoScaleMode.Dpi;
AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink;
ClientSize = new Size(444, 137);
Controls.Add(ConfigurationGroupBox);
Font = new Font("微软雅黑", 9F, FontStyle.Regular, GraphicsUnit.Point, (byte) 134);
FormBorderStyle = FormBorderStyle.FixedSingle;
Icon = Icon.FromHandle(Resources.Netch.GetHicon());
Margin = new Padding(3, 4, 3, 4);
MaximizeBox = false;
Name = "ServerForm";
Padding = new Padding(11, 5, 11, 4);
StartPosition = FormStartPosition.CenterScreen;
}

private GroupBox ConfigurationGroupBox;
private Label RemarkLabel;
protected TextBox RemarkTextBox;
private Label PortLabel;
protected TextBox AddressTextBox;
private TextBox PortTextBox;
private Label AddressLabel;
}
}
Loading

0 comments on commit 020c2d7

Please sign in to comment.