diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs index 3c4d80eb0e..1d88955e17 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs @@ -50,14 +50,14 @@ namespace BizHawk.Client.EmuHawk using (var g = CreateGraphics()) using (var LCK = Gdi.LockGraphics(g)) { - _charSize = Gdi.MeasureString("A", this.Font);//TODO make this a property so changing it updates other values. + _charSize = Gdi.MeasureString("A", this.Font); // TODO make this a property so changing it updates other values. } UpdateCellSize(); ColumnWidth = CellWidth; ColumnHeight = CellHeight + 2; - //TODO Figure out how to use the width and height properties of the scrollbars instead of 17 + // TODO Figure out how to use the width and height properties of the scrollbars instead of 17 VBar = new VScrollBar { Location = new Point(Width - 17, 0), @@ -506,18 +506,16 @@ namespace BizHawk.Client.EmuHawk } } - // TODO: make IEnumerable, IList is for legacy support [Browsable(false)] [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)] - public IList SelectedRows + public IEnumerable SelectedRows { get { return SelectedItems .Where(cell => cell.RowIndex.HasValue) .Select(cell => cell.RowIndex.Value) - .Distinct() - .ToList(); + .Distinct(); } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs index d7519818a3..1b05a81056 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs @@ -277,7 +277,7 @@ namespace BizHawk.Client.EmuHawk { var frame = TasView.CurrentCell.RowIndex.Value; var buttonName = TasView.CurrentCell.Column.Name; - if (TasView.SelectedRows.IndexOf(frame) != -1 && (buttonName == MarkerColumnName || buttonName == FrameColumnName)) + if (TasView.SelectedRows.ToList().IndexOf(frame) != -1 && (buttonName == MarkerColumnName || buttonName == FrameColumnName)) { RightClickMenu.Show(TasView, e.X, e.Y); } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index c76a4a19a7..3445ce3398 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -450,13 +450,13 @@ namespace BizHawk.Client.EmuHawk var list = TasView.SelectedRows; string message = "Selected: "; - if (list.Count > 0) + if (list.Any()) { - message += list.Count + " rows 0 col, Clipboard: "; + message += list.Count() + " rows 0 col, Clipboard: "; } else { - message += list.Count + " none, Clipboard: "; + message += list.Count() + " none, Clipboard: "; } message += _tasClipboard.Any() ? _tasClipboard.Count.ToString() + " rows 0 col": "empty"; @@ -698,8 +698,9 @@ namespace BizHawk.Client.EmuHawk if (TasView.SelectedRows.Any()) { _tasClipboard.Clear(); - var list = TasView.SelectedRows; + var list = TasView.SelectedRows.ToList(); var sb = new StringBuilder(); + for (var i = 0; i < list.Count; i++) { var input = _currentTasMovie.GetInputState(list[i]);