OSDN Git Service

Merge branch 'develop'
[strokestylet/CsWin10Desktop3.git] / StrokeStyleT / ユーザ / ユーザ管理.cs
index b958a15..46c44f3 100644 (file)
@@ -10,12 +10,14 @@ namespace SST.ユーザ
        public class ユーザ管理
        {
                public List<ユーザ> ユーザリスト { get; protected set; } = new List<ユーザ>();
+
                public ユーザ 現在選択されているユーザ { get; protected set; } = null;   // 外から設定するにはメソッドを使う。
 
                public ユーザ管理()
                {
-                       this.初期化する();
+                       this._初期化する();
                }
+
                public void ユーザを選択する( string ユーザ名 )
                {
                        var 名前に該当するユーザ = this.ユーザリスト.Find( ( user ) => ( user.名前 == ユーザ名 ) );
@@ -29,10 +31,12 @@ namespace SST.ユーザ
                        // 選択ユーザを変更する。
                        this.現在選択されているユーザ = 名前に該当するユーザ;
                }
+
                public void 最初のユーザを選択する()
                {
                        this.現在選択されているユーザ = ( 0 < this.ユーザリスト.Count ) ? this.ユーザリスト[ this.ユーザリスト.Count - 1 ] : null;
                }
+
                public void 前のユーザを選択する()
                {
                        if( ( null == this.現在選択されているユーザ ) || ( 0 == this.ユーザリスト.Count ) )
@@ -52,6 +56,7 @@ namespace SST.ユーザ
                                this.現在選択されているユーザ = this.ユーザリスト[ index ];
                        }
                }
+
                public void 次のユーザを選択する()
                {
                        if( ( null == this.現在選択されているユーザ ) || ( 0 == this.ユーザリスト.Count ) )
@@ -74,7 +79,7 @@ namespace SST.ユーザ
 
                public void UsersXmlを保存する()
                {
-                       string ファイルパス = FDK.フォルダ.絶対パスに含まれるフォルダ変数を展開して返す( this.UsersXmlファイルパス );
+                       string ファイルパス = FDK.フォルダ.絶対パスに含まれるフォルダ変数を展開して返す( this._UsersXmlファイルパス );
 
                        try
                        {
@@ -104,16 +109,17 @@ namespace SST.ユーザ
                                FDK.Log.ERROR( $"ユーザファイルの保存に失敗しました。{e.Message}[{FDK.フォルダ.絶対パスをフォルダ変数付き絶対パスに変換して返す( ファイルパス )}]" );
                        }
                }
+
                public void UsersXmlを読み込む()
                {
-                       string ファイルパス = FDK.フォルダ.絶対パスに含まれるフォルダ変数を展開して返す( this.UsersXmlファイルパス );
+                       string ファイルパス = FDK.フォルダ.絶対パスに含まれるフォルダ変数を展開して返す( this._UsersXmlファイルパス );
 
-                       this.初期化する();
+                       this._初期化する();
 
                        if( false == File.Exists( ファイルパス ) )
                        {
                                FDK.Log.WARNING( $"ユーザファイルが存在しません。作成します。[{FDK.フォルダ.絶対パスをフォルダ変数付き絶対パスに変換して返す( ファイルパス )}]" );
-                               this.AutoPlayerを追加する();
+                               this._AutoPlayerを追加する();
                                this.UsersXmlを保存する();
                                return;
                        }
@@ -156,17 +162,19 @@ namespace SST.ユーザ
                        // AutoPlayer が存在しないなら、追加する。
                        if( -1 == this.ユーザリスト.FindIndex( ( user ) => user.名前 == Properties.Resources.AUTOPLAYER ) )
                        {
-                               this.AutoPlayerを追加する();
+                               this._AutoPlayerを追加する();
                        }
                }
-               protected readonly string UsersXmlファイルパス = @"$(AppData)\Users.xml";
 
-               private void 初期化する()
+               private readonly string _UsersXmlファイルパス = @"$(AppData)\Users.xml";
+
+               private void _初期化する()
                {
                        this.ユーザリスト.Clear();
                        this.現在選択されているユーザ = null;
                }
-               private void AutoPlayerを追加する()
+
+               private void _AutoPlayerを追加する()
                {
                        var autoPlayer = new ユーザ( Properties.Resources.AUTOPLAYER );
                        autoPlayer.チップの自動演奏を一括設定する( true );