make WatchList constants not all caps

This commit is contained in:
adelikat 2020-03-04 18:43:31 -06:00
parent 888a5225fe
commit a84fca5f8f
4 changed files with 51 additions and 51 deletions

View File

@ -312,7 +312,7 @@ namespace BizHawk.Client.Common.RamSearchEngine
_isSorted = false;
switch (column)
{
case WatchList.ADDRESS:
case WatchList.Address:
if (!reverse)
{
_isSorted = true;
@ -320,13 +320,13 @@ namespace BizHawk.Client.Common.RamSearchEngine
_watchList = _watchList.OrderBy(w => w.Address, reverse).ToList();
break;
case WatchList.VALUE:
case WatchList.Value:
_watchList = _watchList.OrderBy(w => GetValue(w.Address), reverse).ToList();
break;
case WatchList.PREV:
case WatchList.Prev:
_watchList = _watchList.OrderBy(w => w.Previous, reverse).ToList();
break;
case WatchList.CHANGES:
case WatchList.ChangesCol:
if (_settings.IsDetailed())
{
_watchList = _watchList
@ -336,7 +336,7 @@ namespace BizHawk.Client.Common.RamSearchEngine
}
break;
case WatchList.DIFF:
case WatchList.Diff:
_watchList = _watchList.OrderBy(w => GetValue(w.Address) - w.Previous, reverse).ToList();
break;
}

View File

@ -21,14 +21,14 @@ namespace BizHawk.Client.Common
{
#region Fields
public const string ADDRESS = "AddressColumn";
public const string VALUE = "ValueColumn";
public const string PREV = "PrevColumn";
public const string CHANGES = "ChangesColumn";
public const string DIFF = "DiffColumn";
public const string TYPE = "TypeColumn";
public const string DOMAIN = "DomainColumn";
public const string NOTES = "NotesColumn";
public const string Address = "AddressColumn";
public const string Value = "ValueColumn";
public const string Prev = "PrevColumn";
public const string ChangesCol = "ChangesColumn";
public const string Diff = "DiffColumn";
public const string Type = "TypeColumn";
public const string Domain = "DomainColumn";
public const string Notes = "NotesColumn";
private static readonly Dictionary<string, IComparer<Watch>> WatchComparers;
@ -48,14 +48,14 @@ namespace BizHawk.Client.Common
// Initialize mapping of columns to comparers for sorting.
WatchComparers = new Dictionary<string, IComparer<Watch>>
{
{ ADDRESS, new WatchAddressComparer() },
{ VALUE, new WatchValueComparer() },
{ PREV, new WatchPreviousValueComparer() },
{ CHANGES, new WatchChangeCountComparer() },
{ DIFF, new WatchValueDifferenceComparer() },
{ TYPE, new WatchFullDisplayTypeComparer() },
{ DOMAIN, new WatchDomainComparer() },
{ NOTES, new WatchNoteComparer() }
{ Address, new WatchAddressComparer() },
{ Value, new WatchValueComparer() },
{ Prev, new WatchPreviousValueComparer() },
{ ChangesCol, new WatchChangeCountComparer() },
{ Diff, new WatchValueDifferenceComparer() },
{ Type, new WatchFullDisplayTypeComparer() },
{ Domain, new WatchDomainComparer() },
{ Notes, new WatchNoteComparer() }
};
}

View File

@ -201,19 +201,19 @@ namespace BizHawk.Client.EmuHawk
var columnName = column.Name;
switch (columnName)
{
case WatchList.ADDRESS:
case WatchList.Address:
text = _searches[index].AddressString;
break;
case WatchList.VALUE:
case WatchList.Value:
text = _searches[index].ValueString;
break;
case WatchList.PREV:
case WatchList.Prev:
text = _searches[index].PreviousStr;
break;
case WatchList.CHANGES:
case WatchList.ChangesCol:
text = _searches[index].ChangeCount.ToString();
break;
case WatchList.DIFF:
case WatchList.Diff:
text = _searches[index].Diff;
break;
}
@ -772,7 +772,7 @@ namespace BizHawk.Client.EmuHawk
DifferentByBox.Enabled = true;
ClearChangeCountsToolBarItem.Enabled = true;
WatchListView.AllColumns[WatchList.CHANGES].Visible = true;
WatchListView.AllColumns[WatchList.ChangesCol].Visible = true;
ChangesMenuItem.Checked = true;
ColumnToggleCallback();
@ -788,7 +788,7 @@ namespace BizHawk.Client.EmuHawk
.Single(t => t.Name == "GeneratedColumnsSubMenu"); // TODO - make name a constant
return subMenu.DropDownItems
.Cast<ToolStripMenuItem>()
.Single(t => t.Name == WatchList.CHANGES);
.Single(t => t.Name == WatchList.ChangesCol);
}
}
@ -811,7 +811,7 @@ namespace BizHawk.Client.EmuHawk
PreviousValueRadio.Checked = true;
}
WatchListView.AllColumns[WatchList.CHANGES].Visible = false;
WatchListView.AllColumns[WatchList.ChangesCol].Visible = false;
ChangesMenuItem.Checked = false;
ColumnToggleCallback();
@ -964,11 +964,11 @@ namespace BizHawk.Client.EmuHawk
{
Columns = new List<RollColumn>
{
new RollColumn { Text = "Address", Name = WatchList.ADDRESS, Visible = true, UnscaledWidth = 60, Type = ColumnType.Text },
new RollColumn { Text = "Value", Name = WatchList.VALUE, Visible = true, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Prev", Name = WatchList.PREV, Visible = true, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Changes", Name = WatchList.CHANGES, Visible = true, UnscaledWidth = 60, Type = ColumnType.Text },
new RollColumn { Text = "Diff", Name = WatchList.DIFF, Visible = false, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Address", Name = WatchList.Address, Visible = true, UnscaledWidth = 60, Type = ColumnType.Text },
new RollColumn { Text = "Value", Name = WatchList.Value, Visible = true, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Prev", Name = WatchList.Prev, Visible = true, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Changes", Name = WatchList.ChangesCol, Visible = true, UnscaledWidth = 60, Type = ColumnType.Text },
new RollColumn { Text = "Diff", Name = WatchList.Diff, Visible = false, UnscaledWidth = 59, Type = ColumnType.Text },
};
PreviewMode = true;

View File

@ -79,14 +79,14 @@ namespace BizHawk.Client.EmuHawk
{
Columns = new List<RollColumn>
{
new RollColumn { Text = "Address", Name = WatchList.ADDRESS, Visible = true, UnscaledWidth = 60, Type = ColumnType.Text },
new RollColumn { Text = "Value", Name = WatchList.VALUE, Visible = true, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Prev", Name = WatchList.PREV, Visible = false, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Changes", Name = WatchList.CHANGES, Visible = true, UnscaledWidth = 60, Type = ColumnType.Text },
new RollColumn { Text = "Diff", Name = WatchList.DIFF, Visible = false, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Type", Name = WatchList.TYPE, Visible = false, UnscaledWidth = 55, Type = ColumnType.Text },
new RollColumn { Text = "Domain", Name = WatchList.DOMAIN, Visible = true, UnscaledWidth = 55, Type = ColumnType.Text },
new RollColumn { Text = "Notes", Name = WatchList.NOTES, Visible = true, UnscaledWidth = 128, Type = ColumnType.Text }
new RollColumn { Text = "Address", Name = WatchList.Address, Visible = true, UnscaledWidth = 60, Type = ColumnType.Text },
new RollColumn { Text = "Value", Name = WatchList.Value, Visible = true, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Prev", Name = WatchList.Prev, Visible = false, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Changes", Name = WatchList.ChangesCol, Visible = true, UnscaledWidth = 60, Type = ColumnType.Text },
new RollColumn { Text = "Diff", Name = WatchList.Diff, Visible = false, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Type", Name = WatchList.Type, Visible = false, UnscaledWidth = 55, Type = ColumnType.Text },
new RollColumn { Text = "Domain", Name = WatchList.Domain, Visible = true, UnscaledWidth = 55, Type = ColumnType.Text },
new RollColumn { Text = "Notes", Name = WatchList.Notes, Visible = true, UnscaledWidth = 128, Type = ColumnType.Text }
};
}
@ -599,7 +599,7 @@ namespace BizHawk.Client.EmuHawk
if (_watches[index].IsSeparator)
{
if (column.Name == WatchList.ADDRESS)
if (column.Name == WatchList.Address)
{
text = _watches[index].Notes;
}
@ -609,32 +609,32 @@ namespace BizHawk.Client.EmuHawk
switch (column.Name)
{
case WatchList.ADDRESS:
case WatchList.Address:
text = _watches[index].AddressString;
break;
case WatchList.VALUE:
case WatchList.Value:
text = _watches[index].ValueString;
break;
case WatchList.PREV:
case WatchList.Prev:
text = _watches[index].PreviousStr;
break;
case WatchList.CHANGES:
case WatchList.ChangesCol:
if (!_watches[index].IsSeparator)
{
text = _watches[index].ChangeCount.ToString();
}
break;
case WatchList.DIFF:
case WatchList.Diff:
text = _watches[index].Diff;
break;
case WatchList.TYPE:
case WatchList.Type:
text = ComputeDisplayType(_watches[index]);
break;
case WatchList.DOMAIN:
case WatchList.Domain:
text = _watches[index].Domain.Name;
break;
case WatchList.NOTES:
case WatchList.Notes:
text = _watches[index].Notes;
break;
}