Browse Subversion Repository
Contents of /CacheManageWindow.cs
Parent Directory
| Revision Log
Revision 9 -
( show annotations)
( download)
Thu Feb 24 14:12:19 2011 UTC
(13 years, 2 months ago)
by aqua877
File size: 1547 byte(s)
エラー報告機能の実装
| 1 |
using System; |
| 2 |
using System.Collections.Generic; |
| 3 |
using System.ComponentModel; |
| 4 |
using System.Data; |
| 5 |
using System.Drawing; |
| 6 |
using System.Linq; |
| 7 |
using System.Text; |
| 8 |
using System.Windows.Forms; |
| 9 |
using System.Diagnostics; |
| 10 |
|
| 11 |
namespace Aqua877.WinApp.IronLivetube |
| 12 |
{ |
| 13 |
public partial class CacheManageWindow : Form |
| 14 |
{ |
| 15 |
public CacheManageWindow() |
| 16 |
{ |
| 17 |
InitializeComponent(); |
| 18 |
|
| 19 |
this.RefreshStatus(); |
| 20 |
} |
| 21 |
|
| 22 |
private void RunGCButton_Click(object sender, EventArgs e) |
| 23 |
{ |
| 24 |
GC.Collect(); |
| 25 |
this.RefreshStatus(); |
| 26 |
} |
| 27 |
|
| 28 |
private void CleanCachesButton_Click(object sender, EventArgs e) |
| 29 |
{ |
| 30 |
var result = MessageBox.Show( |
| 31 |
"キャッシュのクリーンを実行すると、現在キャッシングされているデータがすべて削除されます。\nメモリ使用量は少なくなりますが、現在開発中の機能につき動作が不安定になるおそれがあります。実行しますか?", |
| 32 |
"警告", |
| 33 |
MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2 |
| 34 |
); |
| 35 |
|
| 36 |
if (result == System.Windows.Forms.DialogResult.OK) |
| 37 |
{ |
| 38 |
GlobalValues.CallCleanCaches(); |
| 39 |
this.RefreshStatus(); |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
private void RefreshStatus() |
| 44 |
{ |
| 45 |
this.CachingCommentsCountLabel.Text = GlobalValues.CachingComments.ToString(); |
| 46 |
this.CachingThumbnailsCountLabel.Text = GlobalValues.CachingThumbnails.ToString(); |
| 47 |
this.UsingMemoriesCountLabel.Text = String.Format("{0:f1}KB", (Process.GetCurrentProcess().WorkingSet64 / 1024).ToString()); |
| 48 |
} |
| 49 |
|
| 50 |
|
| 51 |
} |
| 52 |
} |
|