• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

フレンドリネームに" USB "を含むディスクドライブをリフレッシュ


Commit MetaInfo

Revisionc160128a0c3e43494d9b22635afc875f4fcfe716 (tree)
Time2019-10-15 22:06:09
AuthorYasushi Tanaka <tanaka_yasushi2008@yaho...>
CommiterYasushi Tanaka

Log Message

Ver.1.2.0 - ディスク無効化後に1500msスリープする (安定性向上のため)

Change Summary

Incremental Difference

--- a/VCS2010/DiskRefresh/HistoryForm.Designer.cs
+++ b/VCS2010/DiskRefresh/HistoryForm.Designer.cs
@@ -36,7 +36,7 @@
3636 // OKButton
3737 //
3838 this.OKButton.DialogResult = System.Windows.Forms.DialogResult.OK;
39- this.OKButton.Location = new System.Drawing.Point(275, 204);
39+ this.OKButton.Location = new System.Drawing.Point(332, 256);
4040 this.OKButton.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
4141 this.OKButton.Name = "OKButton";
4242 this.OKButton.Size = new System.Drawing.Size(168, 57);
@@ -47,13 +47,13 @@
4747 //
4848 // HistoryTextBox
4949 //
50- this.HistoryTextBox.Location = new System.Drawing.Point(20, 18);
50+ this.HistoryTextBox.Location = new System.Drawing.Point(26, 18);
5151 this.HistoryTextBox.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
5252 this.HistoryTextBox.Multiline = true;
5353 this.HistoryTextBox.Name = "HistoryTextBox";
5454 this.HistoryTextBox.ReadOnly = true;
5555 this.HistoryTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
56- this.HistoryTextBox.Size = new System.Drawing.Size(674, 151);
56+ this.HistoryTextBox.Size = new System.Drawing.Size(783, 206);
5757 this.HistoryTextBox.TabIndex = 1;
5858 this.HistoryTextBox.Text = resources.GetString("HistoryTextBox.Text");
5959 //
@@ -61,7 +61,7 @@
6161 //
6262 this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 18F);
6363 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
64- this.ClientSize = new System.Drawing.Size(717, 285);
64+ this.ClientSize = new System.Drawing.Size(832, 342);
6565 this.Controls.Add(this.HistoryTextBox);
6666 this.Controls.Add(this.OKButton);
6767 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
--- a/VCS2010/DiskRefresh/HistoryForm.resx
+++ b/VCS2010/DiskRefresh/HistoryForm.resx
@@ -118,7 +118,9 @@
118118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119 </resheader>
120120 <data name="HistoryTextBox.Text" xml:space="preserve">
121- <value>【2019/2/25 Ver1.1.0】
121+ <value>【2019/10/12 Ver.1.2.0】
122+・ディスク無効化から有効化するまでの間に1500msスリープするようにした(安定性向上のため)
123+【2019/2/25 Ver.1.1.0】
122124 ・リフレッシュを行う際に、エクスプローラでフォルダが開かれていた場合は自動で閉じる機能を追加(エクスプローラのバグ対策)
123125 ・スケーリングAwareをマニフェストファイルで明示的に指定
124126 【2019/1/5 Ver.1.0.0】
--- a/VCS2010/DiskRefresh/MainForm.cs
+++ b/VCS2010/DiskRefresh/MainForm.cs
@@ -42,6 +42,16 @@ namespace DiskRefresh
4242 /// 無効状態の論理ドライブ名並び
4343 /// </summary>
4444 private string[] disabledLogicalDrives = null;
45+
46+ /// <summary>
47+ /// デバイス無効化後の待ち時間(合計時間)
48+ /// </summary>
49+ private readonly int waitAfterDisabled = 1500;
50+
51+ /// <summary>
52+ /// デバイス無効化後の待ち時間(DoEventsの間隔)
53+ /// </summary>
54+ private readonly int waitAfterDisabledUnit = 50;
4555
4656 /// <summary>
4757 /// コンストラクタ
@@ -141,6 +151,15 @@ namespace DiskRefresh
141151 return;
142152 }
143153
154+ // ここでスリープ
155+ GuideLabel.Text = "USBディスクを無効化しました\nしばらくお待ちください…";
156+ Application.DoEvents();
157+ for (int waitTime = 0; waitTime < waitAfterDisabled; waitTime += waitAfterDisabledUnit)
158+ {
159+ System.Threading.Thread.Sleep(waitAfterDisabledUnit);
160+ Application.DoEvents();
161+ }
162+
144163 // 無効時の論理ドライブ並びを取得
145164 disabledLogicalDrives = getLogicalDrives();
146165