private void TextureChangerForm_Load(object sender, EventArgs e) { _textureChangerOptions = new TextureChangerOptions(); #region SAIのフォルダが未指定のときはユーザに指定してもらう if (_textureChangerOptions.PathToSaiFolder == "") { string temp = this.RequestPathToSaiFolder(); if (temp != "") { _textureChangerOptions.PathToSaiFolder = temp; } else { CenteredMessageBox.Show( this , "SAIのインストール先を設定できませんでした。\n" + "操作先のSAIがわからないため、処理を継続できません。\n"+ "申し訳ありませんが、プログラムの起動を中断します。" , "TexureChanger起動確認" , MessageBoxButtons.OK, MessageBoxIcon.Error); ForceExitProgram = true; Application.Exit(); return; } } //このプログラムの特性上、PathToSaiFolderが空ということは無しの前提で動かす #endregion #region メニューのチェック状態の再構築 SetCheckingForMenuFirstExpandingFolder(); mniPromptToExitProgram.Checked = _textureChangerOptions.PromptToExitProgram; #endregion #region ウィンドウの状況を復元 Rectangle bounds; FormWindowState state; _textureChangerOptions.LoadWindowConditions(out bounds, out state); Bounds = bounds; WindowState = state; splNorthSouth.SplitterDistance = _textureChangerOptions.SplitterDistanceNorthSouth <= splNorthSouth.Panel1MinSize ? splNorthSouth.Panel1MinSize : _textureChangerOptions.SplitterDistanceNorthSouth; splTreeList.SplitterDistance = _textureChangerOptions.SplitterDistanceTreeList <= splTreeList.Panel1MinSize ? splTreeList.Panel1MinSize : _textureChangerOptions.SplitterDistanceTreeList; #endregion #region 起動確認 CenteredMessageBox.Show(this, "SAIに対するテクスチャの設定変更は、直接即座に上書きされます。 \n" + "また、TextureChanger起動中にSAIを起動した場合、\n" + "それまでの状況に関わらずSAIの設定が再読み込みされます。\n" + "\n" + "TextureChangerとSAIはお互いを知らないので、\n" + "SAI起動中にTextureChangerを実行することができません。\n" , "TexureChanger起動確認" , MessageBoxButtons.OK, MessageBoxIcon.Information); #endregion #region SAIの起動中確認とテクスチャ情報の読み込み _saiProcessCheckTimer = new Timer(); _saiProcessCheckTimer.Tick += new EventHandler(SaiProcessCheckTimerHandler); _saiProcessCheckTimer.Interval = 1000; _textureManager = null; SaiProcessCheckTimerHandler(sender, e); #endregion #region エクスプローラの初期表示 trvFolder.InitFolderTreeView(this); trvFolder.DrillToFolder(_textureChangerOptions.FirstExpandingFolder); #endregion #region ステータスバーに編集中のテクスチャのフォルダのフルパスを表示する lblStatus.Text = _textureChangerOptions.LastEditingTextureName + " - " + _textureChangerOptions.PathToSaiFolder + "\\" + _textureManager.GetDirectoryFromConfname(_textureChangerOptions.LastEditingTextureName); #endregion #region アプリケーションの準備ができた時点で更新を確認 if (_textureChangerOptions.CheckUpdateAtStartUp) { HttpUpdater httpUpdater = new HttpUpdater(this); httpUpdater.BeginAsyncCheckAppConfigUpdated(); } #endregion }
private void mniCheckUpdate_Click( object sender, EventArgs e ) { DialogResult res = CenteredMessageBox.Show( this, "オンラインでTextureChangerの更新あるかを確認します。\n" + "更新がある場合、プログラムが終了してインストーラが起動します。\n" + "更新がない場合は特になにもしません。\n" + "よろしいですか?" , "TexureChanger更新を確認" , MessageBoxButtons.OKCancel, MessageBoxIcon.Information ); if (res == DialogResult.Cancel) return; HttpUpdater httpUpdater = new HttpUpdater( this ); httpUpdater.BeginAsyncCheckAppConfigUpdated( ); }