Browse Source

commit: max buffer

HOME 3 years ago
parent
commit
68d467d538

+ 31 - 14
StrangeFileCopy/MainForm.Designer.cs

@@ -51,6 +51,7 @@
             this.BufSizeMbLabel = new System.Windows.Forms.Label();
             this.BufSizeLabel = new System.Windows.Forms.Label();
             this.UiUpdateTimer = new System.Windows.Forms.Timer(this.components);
+            this.MaxCheckBox = new System.Windows.Forms.CheckBox();
             this.ConfigGroupBox.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.ReOpenSizeUnDown)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.BufSizeUpDown)).BeginInit();
@@ -62,7 +63,7 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.TotalProgressBar.Location = new System.Drawing.Point(75, 221);
             this.TotalProgressBar.Name = "TotalProgressBar";
-            this.TotalProgressBar.Size = new System.Drawing.Size(474, 23);
+            this.TotalProgressBar.Size = new System.Drawing.Size(485, 23);
             this.TotalProgressBar.TabIndex = 0;
             // 
             // ReOpenProgressBar
@@ -71,7 +72,7 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.ReOpenProgressBar.Location = new System.Drawing.Point(75, 192);
             this.ReOpenProgressBar.Name = "ReOpenProgressBar";
-            this.ReOpenProgressBar.Size = new System.Drawing.Size(474, 23);
+            this.ReOpenProgressBar.Size = new System.Drawing.Size(485, 23);
             this.ReOpenProgressBar.TabIndex = 0;
             // 
             // FromLabel
@@ -90,7 +91,7 @@
             this.FromTextBox.Location = new System.Drawing.Point(75, 77);
             this.FromTextBox.Name = "FromTextBox";
             this.FromTextBox.ReadOnly = true;
-            this.FromTextBox.Size = new System.Drawing.Size(393, 21);
+            this.FromTextBox.Size = new System.Drawing.Size(404, 21);
             this.FromTextBox.TabIndex = 0;
             this.FromTextBox.DragDrop += new System.Windows.Forms.DragEventHandler(this.FromTextBox_DragDrop);
             this.FromTextBox.DragEnter += new System.Windows.Forms.DragEventHandler(this.FromTextBox_DragEnter);
@@ -103,7 +104,7 @@
             this.ToTextBox.Location = new System.Drawing.Point(75, 104);
             this.ToTextBox.Name = "ToTextBox";
             this.ToTextBox.ReadOnly = true;
-            this.ToTextBox.Size = new System.Drawing.Size(393, 21);
+            this.ToTextBox.Size = new System.Drawing.Size(404, 21);
             this.ToTextBox.TabIndex = 1;
             this.ToTextBox.DragDrop += new System.Windows.Forms.DragEventHandler(this.ToTextBox_DragDrop);
             this.ToTextBox.DragEnter += new System.Windows.Forms.DragEventHandler(this.ToTextBox_DragEnter);
@@ -119,7 +120,7 @@
             // FireButton
             // 
             this.FireButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.FireButton.Location = new System.Drawing.Point(474, 77);
+            this.FireButton.Location = new System.Drawing.Point(485, 77);
             this.FireButton.Name = "FireButton";
             this.FireButton.Size = new System.Drawing.Size(75, 48);
             this.FireButton.TabIndex = 2;
@@ -151,7 +152,7 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.BufProgressBar.Location = new System.Drawing.Point(75, 163);
             this.BufProgressBar.Name = "BufProgressBar";
-            this.BufProgressBar.Size = new System.Drawing.Size(474, 23);
+            this.BufProgressBar.Size = new System.Drawing.Size(485, 23);
             this.BufProgressBar.TabIndex = 0;
             // 
             // BufLabel
@@ -185,6 +186,7 @@
             // 
             this.ConfigGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
+            this.ConfigGroupBox.Controls.Add(this.MaxCheckBox);
             this.ConfigGroupBox.Controls.Add(this.FlushCheckBox);
             this.ConfigGroupBox.Controls.Add(this.ReOpenSizeUnDown);
             this.ConfigGroupBox.Controls.Add(this.ReOpenGbLabel);
@@ -194,7 +196,7 @@
             this.ConfigGroupBox.Controls.Add(this.BufSizeLabel);
             this.ConfigGroupBox.Location = new System.Drawing.Point(12, 12);
             this.ConfigGroupBox.Name = "ConfigGroupBox";
-            this.ConfigGroupBox.Size = new System.Drawing.Size(537, 59);
+            this.ConfigGroupBox.Size = new System.Drawing.Size(548, 59);
             this.ConfigGroupBox.TabIndex = 4;
             this.ConfigGroupBox.TabStop = false;
             this.ConfigGroupBox.Text = "Config";
@@ -204,7 +206,7 @@
             this.FlushCheckBox.AutoSize = true;
             this.FlushCheckBox.Checked = true;
             this.FlushCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.FlushCheckBox.Location = new System.Drawing.Point(156, 23);
+            this.FlushCheckBox.Location = new System.Drawing.Point(271, 23);
             this.FlushCheckBox.Name = "FlushCheckBox";
             this.FlushCheckBox.Size = new System.Drawing.Size(54, 16);
             this.FlushCheckBox.TabIndex = 1;
@@ -213,9 +215,9 @@
             // 
             // ReOpenSizeUnDown
             // 
-            this.ReOpenSizeUnDown.Location = new System.Drawing.Point(332, 20);
+            this.ReOpenSizeUnDown.Location = new System.Drawing.Point(462, 20);
             this.ReOpenSizeUnDown.Maximum = new decimal(new int[] {
-            1024,
+            2047,
             0,
             0,
             0});
@@ -235,7 +237,7 @@
             // 
             // ReOpenGbLabel
             // 
-            this.ReOpenGbLabel.Location = new System.Drawing.Point(385, 20);
+            this.ReOpenGbLabel.Location = new System.Drawing.Point(515, 20);
             this.ReOpenGbLabel.Name = "ReOpenGbLabel";
             this.ReOpenGbLabel.Size = new System.Drawing.Size(22, 21);
             this.ReOpenGbLabel.TabIndex = 1;
@@ -245,9 +247,10 @@
             // 
             // BufSizeUpDown
             // 
+            this.BufSizeUpDown.Enabled = false;
             this.BufSizeUpDown.Location = new System.Drawing.Point(75, 20);
             this.BufSizeUpDown.Maximum = new decimal(new int[] {
-            1024,
+            2046,
             0,
             0,
             0});
@@ -267,7 +270,7 @@
             // 
             // ReOpenSizeLabel
             // 
-            this.ReOpenSizeLabel.Location = new System.Drawing.Point(254, 20);
+            this.ReOpenSizeLabel.Location = new System.Drawing.Point(384, 20);
             this.ReOpenSizeLabel.Name = "ReOpenSizeLabel";
             this.ReOpenSizeLabel.Size = new System.Drawing.Size(72, 21);
             this.ReOpenSizeLabel.TabIndex = 1;
@@ -300,11 +303,24 @@
             this.UiUpdateTimer.Enabled = true;
             this.UiUpdateTimer.Tick += new System.EventHandler(this.UiUpdateTimer_Tick);
             // 
+            // MaxCheckBox
+            // 
+            this.MaxCheckBox.AutoSize = true;
+            this.MaxCheckBox.Checked = true;
+            this.MaxCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.MaxCheckBox.Location = new System.Drawing.Point(156, 23);
+            this.MaxCheckBox.Name = "MaxCheckBox";
+            this.MaxCheckBox.Size = new System.Drawing.Size(84, 16);
+            this.MaxCheckBox.TabIndex = 1;
+            this.MaxCheckBox.Text = "Max 2G-56B";
+            this.MaxCheckBox.UseVisualStyleBackColor = true;
+            this.MaxCheckBox.CheckedChanged += new System.EventHandler(this.MaxCheckBox_CheckedChanged);
+            // 
             // MainForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(561, 261);
+            this.ClientSize = new System.Drawing.Size(572, 261);
             this.Controls.Add(this.ConfigGroupBox);
             this.Controls.Add(this.FireButton);
             this.Controls.Add(this.ToTextBox);
@@ -357,6 +373,7 @@
         private System.Windows.Forms.Label ReOpenGbLabel;
         private System.Windows.Forms.Label ReOpenSizeLabel;
         private System.Windows.Forms.Timer UiUpdateTimer;
+        private System.Windows.Forms.CheckBox MaxCheckBox;
     }
 }
 

+ 6 - 1
StrangeFileCopy/MainForm.cs

@@ -28,7 +28,7 @@ namespace StrangeFileCopy
                 return;
             }
 
-            var blkSize = (int)BufSizeUpDown.Value * 1024 * 1024;
+            var blkSize = MaxCheckBox.Checked ? 2147483591 : (int)BufSizeUpDown.Value * 1024 * 1024;
             var reOpenTimes = (int)Math.Ceiling(ReOpenSizeUnDown.Value * 1024 / BufSizeUpDown.Value);
             var flush = FlushCheckBox.Checked;
 
@@ -165,5 +165,10 @@ namespace StrangeFileCopy
                 }));
             }).Start();
         }
+
+        private void MaxCheckBox_CheckedChanged(object sender, EventArgs e)
+        {
+            BufSizeUpDown.Enabled = !MaxCheckBox.Checked;
+        }
     }
 }

+ 1 - 0
StrangeFileCopy/StrangeFileCopy.csproj

@@ -31,6 +31,7 @@
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />