OSDN Git Service

デスクトップに高DPIが設定されたときに拡大率が狂っていた不具合を修正。
[strokestylet/CsWin10Desktop3.git] / FDK24 / ApplicationBase.cs
index f7bbb4d..9c396b9 100644 (file)
@@ -144,53 +144,37 @@ namespace FDK
 
                        #region " アプリケーションを初期化する。"
                        //----------------
-                       try
-                       {
-                               FDK.Log.BeginInfo( "派生クラスを初期化します。" );
-                               this.初期化する();
-                               Debug.Assert( SharpDX.Size2F.Empty != this.設計画面サイズdpx, "初期化メソッド内で設計画面サイズを設定してあること。" );
-                               FDK.Log.Info( $"設計画面サイズ: {this.設計画面サイズdpx}" );
-                               FDK.Log.Info( $"物理画面サイズ: {this.MainForm.ClientSize}" );
-                       }
-                       finally
-                       {
-                               FDK.Log.EndInfo( "派生クラスを初期化しました。" );
-                       }
+                       FDK.Log.BeginInfo( "派生クラスを初期化します。" );
+
+                       this.初期化する();
+                       Debug.Assert( SharpDX.Size2F.Empty != this.設計画面サイズdpx, "初期化メソッド内で設計画面サイズを設定してあること。" );
+
+                       FDK.Log.Info( $"設計画面サイズ: {this.設計画面サイズdpx}" );
+                       FDK.Log.Info( $"物理画面サイズ: {this.MainForm.ClientSize}" );
+
+                       FDK.Log.EndInfo( "派生クラスを初期化しました。" );
                        //----------------
                        #endregion
                        #region " デバイスリソースを作成する。"
                        //----------------
-                       try
-                       {
-                               FDK.Log.BeginInfo( "デバイスリソースを作成します。" );
-                               lock( this.スレッド間同期 )
-                               {
-                                       this.デバイスリソース = new メディア.デバイスリソース();
-                                       this.デバイスリソース.設計画面サイズdpx = this.設計画面サイズdpx;
-                                       this.デバイスリソース.すべてのリソースを作成する( this.MainForm.ClientSize, this.MainForm.Handle );
-                               }
-                       }
-                       finally
+                       FDK.Log.BeginInfo( "デバイスリソースを作成します。" );
+                       lock( this.スレッド間同期 )
                        {
-                               FDK.Log.EndInfo( "デバイスリソースを作成しました。" );
+                               this.デバイスリソース = new メディア.デバイスリソース();
+                               this.デバイスリソース.設計画面サイズdpx = this.設計画面サイズdpx;
+                               this.デバイスリソース.すべてのリソースを作成する( this.MainForm.ClientSize, this.MainForm.Handle );
                        }
+                       FDK.Log.EndInfo( "デバイスリソースを作成しました。" );
                        //----------------
                        #endregion
                        #region " 進行描画スレッドを開始する。"
                        //----------------
-                       try
-                       {
-                               FDK.Log.BeginInfo( "進行描画スレッドを開始します。" );
-                               lock( this.スレッド間同期 )
-                               {
-                                       this.進行描画スレッドのキャンセルトークンソース = new System.Threading.CancellationTokenSource();
-                                       this.進行描画スレッド = Task.Factory.StartNew( () => { this.進行描画スレッド処理(); }, this.進行描画スレッドのキャンセルトークンソース.Token );
-                                       this.進行描画スレッドの起動を完了した.WaitOne();        // スレッドの起動完了通知を待つ。
-                               }
-                       }
-                       finally
+                       FDK.Log.BeginInfo( "進行描画スレッドを開始します。" );
+                       lock( this.スレッド間同期 )
                        {
-                               FDK.Log.EndInfo( "進行描画スレッドを開始しました。" );
+                               this.進行描画スレッドのキャンセルトークンソース = new System.Threading.CancellationTokenSource();
+                               this.進行描画スレッド = Task.Factory.StartNew( () => { this.進行描画スレッド処理(); }, this.進行描画スレッドのキャンセルトークンソース.Token );
+                               this.進行描画スレッドの起動を完了した.WaitOne();        // スレッドの起動完了通知を待つ。
                        }
                        //----------------
                        #endregion
@@ -257,11 +241,13 @@ namespace FDK
                                if( null == this.デバイスリソース )
                                {
                                        FDK.Log.Info( " まだ初期化されてないので、何もしません。" );
+                                       FDK.Log.EndInfo( $"{FDK.Utilities.現在のメソッド名}" );
                                        return;
                                }
                                if( this.MainForm.WindowState == FormWindowState.Minimized )
                                {
                                        FDK.Log.Info( "最小化されました。" );
+                                       FDK.Log.EndInfo( $"{FDK.Utilities.現在のメソッド名}" );
                                        return; // 何もしない
                                }
                                //----------------
@@ -298,7 +284,7 @@ namespace FDK
                        FDK.Log.現在のスレッドに名前をつける( "Main" );
                        FDK.Log.Info( "進行描画スレッドを起動しました。" );
 
-                       this.進行描画スレッドの起動を完了した.Set();    // 起動完了通知 to 生成元
+                       this.進行描画スレッドの起動を完了した.Set();    // 生成元へ起動完了を通知する。
 
                        while( true )
                        {