スタイル: コーディング規約に準拠したコードフォーマットの適用(this.の明示、空白スタイルの統一)

- 自インスタンスメンバーアクセスへの this. 付与(28ファイル)
- .editorconfig に準拠したインデント・波括弧・空白スタイルの適用
- UTF-8 (BOMあり)、CRLF改行コード、行末空白除去の整合性検証
This commit is contained in:
armonica committed 2026-10-20 10:14:26 +09:00
1 parent 2fa40c950f
commit ae86b53147
28 files changed
+1362 -1380

No files matched your search

+37 -37
View File
@@ -28,35 +28,35 @@ namespace GameLauncher.Engines.Unity
/// <summary>レジストリの生キー名(例: ClearedLevel_h1378399435)</summary>
public string RawKey
{
get => _rawKey;
set { if (_rawKey != value) { _rawKey = value; OnPropertyChanged(); } }
get => this._rawKey;
set { if (this._rawKey != value) { this._rawKey = value; this.OnPropertyChanged(); } }
}
/// <summary>Unityのハッシュを除去した整形式キー名(例: ClearedLevel)</summary>
public string CleanKey
{
get => _cleanKey;
set { if (_cleanKey != value) { _cleanKey = value; OnPropertyChanged(); } }
get => this._cleanKey;
set { if (this._cleanKey != value) { this._cleanKey = value; this.OnPropertyChanged(); } }
}
/// <summary>値のデータ型</summary>
public PlayerPrefsType Type
{
get => _type;
set { if (_type != value) { _type = value; OnPropertyChanged(); OnPropertyChanged(nameof(TypeDisplay)); } }
get => this._type;
set { if (this._type != value) { this._type = value; this.OnPropertyChanged(); this.OnPropertyChanged(nameof(this.TypeDisplay)); } }
}
/// <summary>実際の値(int, float, string, byte[])</summary>
public object? Value
{
get => _value;
get => this._value;
set
{
if (!Equals(_value, value))
if (!Equals(this._value, value))
{
_value = value;
OnPropertyChanged();
UpdateEditValue();
this._value = value;
this.OnPropertyChanged();
this.UpdateEditValue();
}
}
}
@@ -64,15 +64,15 @@ namespace GameLauncher.Engines.Unity
/// <summary>UI表示・編集用の文字列値</summary>
public string EditValue
{
get => _editValue;
get => this._editValue;
set
{
if (_editValue != value)
if (this._editValue != value)
{
_editValue = value;
_isModified = true;
OnPropertyChanged();
OnPropertyChanged(nameof(IsModified));
this._editValue = value;
this._isModified = true;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.IsModified));
}
}
}
@@ -80,11 +80,11 @@ namespace GameLauncher.Engines.Unity
/// <summary>値が変更されたかどうか</summary>
public bool IsModified
{
get => _isModified;
set { if (_isModified != value) { _isModified = value; OnPropertyChanged(); } }
get => this._isModified;
set { if (this._isModified != value) { this._isModified = value; this.OnPropertyChanged(); } }
}
public string TypeDisplay => Type switch
public string TypeDisplay => this.Type switch
{
PlayerPrefsType.Int => "Int (数値)",
PlayerPrefsType.Float => "Float (小数)",
@@ -95,19 +95,19 @@ namespace GameLauncher.Engines.Unity
private void UpdateEditValue()
{
if (_value == null)
if (this._value == null)
{
_editValue = string.Empty;
this._editValue = string.Empty;
}
else if (_value is byte[] bytes)
else if (this._value is byte[] bytes)
{
try
{
var text = System.Text.Encoding.UTF8.GetString(bytes).TrimEnd('\0');
if (text.All(c => !char.IsControl(c) || c == '\r' || c == '\n' || c == '\t'))
{
_editValue = text;
_type = PlayerPrefsType.String;
this._editValue = text;
this._type = PlayerPrefsType.String;
return;
}
}
@@ -118,21 +118,21 @@ namespace GameLauncher.Engines.Unity
float f = BitConverter.ToSingle(bytes, 0);
if (!float.IsNaN(f) && !float.IsInfinity(f))
{
_editValue = f.ToString("G");
_type = PlayerPrefsType.Float;
this._editValue = f.ToString("G");
this._type = PlayerPrefsType.Float;
return;
}
}
_editValue = BitConverter.ToString(bytes).Replace("-", " ");
this._editValue = BitConverter.ToString(bytes).Replace("-", " ");
}
else
{
_editValue = _value.ToString() ?? string.Empty;
this._editValue = this._value.ToString() ?? string.Empty;
}
_isModified = false;
OnPropertyChanged(nameof(EditValue));
OnPropertyChanged(nameof(IsModified));
this._isModified = false;
this.OnPropertyChanged(nameof(this.EditValue));
this.OnPropertyChanged(nameof(this.IsModified));
}
}
@@ -152,13 +152,13 @@ namespace GameLauncher.Engines.Unity
{
get
{
if (FileSize < 1024) return $"{FileSize} B";
if (FileSize < 1024 * 1024) return $"{FileSize / 1024.0:F1} KB";
return $"{FileSize / (1024.0 * 1024.0):F2} MB";
if (this.FileSize < 1024) return $"{this.FileSize} B";
if (this.FileSize < 1024 * 1024) return $"{this.FileSize / 1024.0:F1} KB";
return $"{this.FileSize / (1024.0 * 1024.0):F2} MB";
}
}
public string LastModifiedDisplay => LastModified.ToString("yyyy/MM/dd HH:mm:ss");
public string LastModifiedDisplay => this.LastModified.ToString("yyyy/MM/dd HH:mm:ss");
}
/// <summary>
@@ -172,6 +172,6 @@ namespace GameLauncher.Engines.Unity
public string BackupType { get; set; } = string.Empty; // "Registry (.reg)" または "ファイル"
public string Note { get; set; } = string.Empty;
public string TimestampDisplay => Timestamp.ToString("yyyy/MM/dd HH:mm:ss");
public string TimestampDisplay => this.Timestamp.ToString("yyyy/MM/dd HH:mm:ss");
}
}