Remove ToList call when the returned List is used as an IEnumerable
This commit is contained in:
parent
2900484ad5
commit
c82ff6077a
|
@ -90,7 +90,7 @@ namespace BizHawk.Client.Common
|
|||
if (!Frozen)
|
||||
{
|
||||
var removed = false;
|
||||
foreach (var recent in recentlist.ToList())
|
||||
foreach (var recent in recentlist)
|
||||
{
|
||||
if (string.Compare(newFile, recent, StringComparison.CurrentCultureIgnoreCase) == 0)
|
||||
{
|
||||
|
|
|
@ -119,8 +119,7 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
|
||||
// Add missing displaynames
|
||||
var missingDisplayPaths = Paths.Where(p => p.SystemDisplayName == null).ToList();
|
||||
foreach (PathEntry path in missingDisplayPaths)
|
||||
foreach (var path in Paths.Where(p => p.SystemDisplayName == null))
|
||||
{
|
||||
path.SystemDisplayName = DefaultValues.First(p => p.System == path.System).SystemDisplayName;
|
||||
}
|
||||
|
|
|
@ -41,17 +41,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
VersionLabel.Text = "Version " + mainversion;
|
||||
DateLabel.Text = VersionInfo.RELEASEDATE;
|
||||
|
||||
var cores = Assembly
|
||||
.Load("BizHawk.Emulation.Cores")
|
||||
.GetTypes()
|
||||
foreach (var core in Assembly.Load("BizHawk.Emulation.Cores").GetTypes()
|
||||
.Where(t => typeof(IEmulator).IsAssignableFrom(t))
|
||||
.Select(t => t.GetCustomAttributes(false).OfType<CoreAttribute>().FirstOrDefault())
|
||||
.Where(a => a != null)
|
||||
.Where(a => a.Released)
|
||||
.OrderByDescending(a => a.CoreName.ToLower())
|
||||
.ToList();
|
||||
|
||||
foreach (var core in cores)
|
||||
.OrderByDescending(a => a.CoreName.ToLower()))
|
||||
{
|
||||
CoreInfoPanel.Controls.Add(new BizBoxInfoControl(core)
|
||||
{
|
||||
|
|
|
@ -1374,7 +1374,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (SelectedRows.Any() && LetKeysModifySelection && SelectedRows.First() > 0)
|
||||
{
|
||||
foreach (var row in SelectedRows.ToList())
|
||||
foreach (var row in SelectedRows)
|
||||
{
|
||||
SelectRow(row - 1, true);
|
||||
SelectRow(row, false);
|
||||
|
@ -1385,7 +1385,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (SelectedRows.Any() && LetKeysModifySelection)
|
||||
{
|
||||
foreach (var row in SelectedRows.Reverse().ToList())
|
||||
foreach (var row in SelectedRows.Reverse())
|
||||
{
|
||||
SelectRow(row + 1, true);
|
||||
SelectRow(row, false);
|
||||
|
|
|
@ -347,7 +347,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
type = " (on)";
|
||||
}
|
||||
|
||||
Global.CheatList.ToList().ForEach(x => x.Toggle());
|
||||
foreach (var x in Global.CheatList) x.Toggle();
|
||||
GlobalWin.OSD.AddMessage("Cheats toggled" + type);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public static IEnumerable<string> GetDeviceNames()
|
||||
{
|
||||
return DirectSound.GetDevices().Select(d => d.Description).ToList();
|
||||
return DirectSound.GetDevices().Select(d => d.Description);
|
||||
}
|
||||
|
||||
private int BufferSizeSamples { get; set; }
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
using (XAudio2 device = new XAudio2())
|
||||
{
|
||||
return Enumerable.Range(0, device.DeviceCount).Select(n => device.GetDeviceDetails(n).DisplayName).ToList();
|
||||
return Enumerable.Range(0, device.DeviceCount).Select(n => device.GetDeviceDetails(n).DisplayName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -101,21 +101,20 @@ namespace BizHawk.Client.EmuHawk
|
|||
HotkeyTabControl.TabPages.Clear();
|
||||
|
||||
// Buckets
|
||||
var tabs = Global.Config.HotkeyBindings.Select(x => x.TabGroup).Distinct().ToList();
|
||||
|
||||
foreach (var tab in tabs)
|
||||
foreach (var tab in Global.Config.HotkeyBindings.Select(x => x.TabGroup).Distinct())
|
||||
{
|
||||
var _y = UIHelper.ScaleY(14);
|
||||
var _x = UIHelper.ScaleX(6);
|
||||
|
||||
var tb = new TabPage {Name = tab, Text = tab};
|
||||
|
||||
var bindings = Global.Config.HotkeyBindings.Where(x => x.TabGroup == tab).OrderBy(x => x.Ordinal).ThenBy(x => x.DisplayName).ToList();
|
||||
|
||||
int iwOffsetX = UIHelper.ScaleX(110);
|
||||
int iwOffsetY = UIHelper.ScaleY(-4);
|
||||
int iwWidth = UIHelper.ScaleX(120);
|
||||
foreach (var b in bindings)
|
||||
foreach (var b in Global.Config.HotkeyBindings.Where(x => x.TabGroup == tab)
|
||||
.OrderBy(x => x.Ordinal)
|
||||
.ThenBy(x => x.DisplayName))
|
||||
{
|
||||
var l = new Label
|
||||
{
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
typeof(NES.NESSyncSettings.Region),
|
||||
(string)RegionComboBox.SelectedItem);
|
||||
|
||||
List<byte> oldRam = _syncSettings.InitialWRamStatePattern?.ToList() ?? new List<byte>();
|
||||
var oldRam = _syncSettings.InitialWRamStatePattern ?? Enumerable.Empty<byte>();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(RamPatternOverrideBox.Text))
|
||||
{
|
||||
|
|
|
@ -111,14 +111,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
Width = UIHelper.ScaleX(200), // Initial Left/Width of child controls are based on this size.
|
||||
AutoScroll = true
|
||||
};
|
||||
var paths = pathCollection
|
||||
.Where(p => p.System == systemId)
|
||||
.OrderBy(p => p.Ordinal)
|
||||
.ThenBy(p => p.Type)
|
||||
.ToList();
|
||||
|
||||
var y = UIHelper.ScaleY(14);
|
||||
foreach (var path in paths)
|
||||
foreach (var path in pathCollection.Where(p => p.System == systemId)
|
||||
.OrderBy(p => p.Ordinal)
|
||||
.ThenBy(p => p.Type))
|
||||
{
|
||||
var box = new TextBox
|
||||
{
|
||||
|
@ -243,10 +240,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void DoRomToggle()
|
||||
{
|
||||
AllPathControls
|
||||
.Where(c => c.Name == "ROM")
|
||||
.ToList()
|
||||
.ForEach(control => control.Enabled = !RecentForROMs.Checked);
|
||||
foreach (var control in AllPathControls.Where(c => c.Name == "ROM"))
|
||||
control.Enabled = !RecentForROMs.Checked;
|
||||
}
|
||||
|
||||
private IEnumerable<TextBox> AllPathBoxes
|
||||
|
|
|
@ -306,13 +306,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void MovieView_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||
|
||||
filePaths
|
||||
.Where(path => MovieService.MovieExtensions.Contains(Path.GetExtension(path).Replace(".", "")))
|
||||
.ToList()
|
||||
.ForEach(path => AddMovieToList(path, force: true));
|
||||
|
||||
foreach (var path in ((string[])e.Data.GetData(DataFormats.FileDrop))
|
||||
.Where(path => MovieService.MovieExtensions.Contains(Path.GetExtension(path)?.Replace(".", ""))))
|
||||
AddMovieToList(path, force: true);
|
||||
RefreshMovieList();
|
||||
}
|
||||
|
||||
|
@ -470,11 +466,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void EditMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
MovieView.SelectedIndices
|
||||
.Cast<int>()
|
||||
.SelectAsIndexOf(_movieList)
|
||||
.ToList()
|
||||
.ForEach(movie => System.Diagnostics.Process.Start(movie.Filename));
|
||||
foreach (var movie in MovieView.SelectedIndices.Cast<int>().SelectAsIndexOf(_movieList))
|
||||
System.Diagnostics.Process.Start(movie.Filename);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -438,10 +438,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
CurrentFileName = "";
|
||||
_bestBotAttempt = null;
|
||||
|
||||
ControlProbabilityPanel.Controls
|
||||
.OfType<BotControlsRow>()
|
||||
.ToList()
|
||||
.ForEach(cp => cp.Probability = 0);
|
||||
foreach (var cp in ControlProbabilityPanel.Controls.OfType<BotControlsRow>())
|
||||
cp.Probability = 0;
|
||||
|
||||
FrameLength = 0;
|
||||
MaximizeAddress = 0;
|
||||
|
|
|
@ -478,13 +478,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
Global.CheatList.Insert(index - 1, cheat);
|
||||
}
|
||||
|
||||
var newindices = indices.Select(t => t - 1).ToList();
|
||||
|
||||
CheatListView.SelectedIndices.Clear();
|
||||
foreach (var newi in newindices)
|
||||
{
|
||||
CheatListView.SelectItem(newi, true);
|
||||
}
|
||||
foreach (var index in indices) CheatListView.SelectItem(index - 1, true);
|
||||
|
||||
UpdateMessageLabel();
|
||||
UpdateDialog();
|
||||
|
@ -507,13 +502,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
UpdateMessageLabel();
|
||||
|
||||
var newindices = indices.Select(t => t + 1).ToList();
|
||||
|
||||
CheatListView.SelectedIndices.Clear();
|
||||
foreach (var newi in newindices)
|
||||
{
|
||||
CheatListView.SelectItem(newi, true);
|
||||
}
|
||||
foreach (var index in indices) CheatListView.SelectItem(index + 1, true);
|
||||
|
||||
UpdateDialog();
|
||||
}
|
||||
|
@ -525,7 +515,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void ToggleMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
SelectedCheats.ToList().ForEach(x => x.Toggle());
|
||||
foreach (var x in SelectedCheats) x.Toggle();
|
||||
CheatListView.Refresh();
|
||||
}
|
||||
|
||||
|
|
|
@ -41,46 +41,40 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (Controls.OfType<Panel>().Any(p => p.Name == "FlagPanel"))
|
||||
{
|
||||
Controls
|
||||
foreach (var checkbox in Controls
|
||||
.OfType<Panel>()
|
||||
.First(p => p.Name == "FlagPanel")
|
||||
.Controls
|
||||
.OfType<CheckBox>()
|
||||
.ToList()
|
||||
.ForEach(checkbox =>
|
||||
.OfType<CheckBox>())
|
||||
{
|
||||
if (checkbox.Name == register.Key)
|
||||
{
|
||||
if (checkbox.Name == register.Key)
|
||||
{
|
||||
checkbox.Checked = register.Value.Value == 1;
|
||||
}
|
||||
});
|
||||
checkbox.Checked = register.Value.Value == 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_canSetCpuRegisters)
|
||||
{
|
||||
Controls
|
||||
.OfType<TextBox>()
|
||||
.ToList()
|
||||
.ForEach(textbox =>
|
||||
foreach (var textbox in Controls
|
||||
.OfType<TextBox>())
|
||||
{
|
||||
if (textbox.Name == register.Key)
|
||||
{
|
||||
if (textbox.Name == register.Key)
|
||||
{
|
||||
textbox.Text = register.Value.Value.ToHexString(register.Value.BitSize / 4);
|
||||
}
|
||||
});
|
||||
textbox.Text = register.Value.Value.ToHexString(register.Value.BitSize / 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Controls
|
||||
.OfType<Label>()
|
||||
.ToList()
|
||||
.ForEach(label =>
|
||||
foreach (var label in Controls
|
||||
.OfType<Label>())
|
||||
{
|
||||
if (label.Name == register.Key)
|
||||
{
|
||||
if (label.Name == register.Key)
|
||||
{
|
||||
label.Text = register.Value.Value.ToHexString(register.Value.BitSize / 4);
|
||||
}
|
||||
});
|
||||
label.Text = register.Value.Value.ToHexString(register.Value.BitSize / 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
SetDomain(domain);
|
||||
SetHighlighted(addrList[0]);
|
||||
_secondaryHighlightedAddresses.Clear();
|
||||
_secondaryHighlightedAddresses.AddRange(addrList.Where(addr => addr != addrList[0]).ToList());
|
||||
_secondaryHighlightedAddresses.AddRange(addrList.Where(addr => addr != addrList[0]));
|
||||
ClearNibbles();
|
||||
UpdateValues();
|
||||
MemoryViewerBox.Refresh();
|
||||
|
@ -837,8 +837,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (address >= 0)
|
||||
{
|
||||
// TODO: can't unfreeze address 0??
|
||||
Global.CheatList.RemoveRange(
|
||||
Global.CheatList.Where(x => x.Contains(address)).ToList());
|
||||
Global.CheatList.RemoveRange(Global.CheatList.Where(x => x.Contains(address)));
|
||||
}
|
||||
|
||||
MemoryViewerBox.Refresh();
|
||||
|
|
|
@ -149,8 +149,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (control.Handle == ptr)
|
||||
{
|
||||
var luaEvents = form.ControlEvents.Where(x => x.Control == ptr).ToList();
|
||||
foreach (var luaEvent in luaEvents)
|
||||
foreach (var luaEvent in form.ControlEvents.Where(x => x.Control == ptr))
|
||||
{
|
||||
form.ControlEvents.Remove(luaEvent);
|
||||
}
|
||||
|
|
|
@ -701,7 +701,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private static void UpdateRegisteredFunctionsDialog()
|
||||
{
|
||||
foreach (var form in Application.OpenForms.OfType<LuaRegisteredFunctionsList>().ToList())
|
||||
foreach (var form in Application.OpenForms.OfType<LuaRegisteredFunctionsList>())
|
||||
{
|
||||
form.UpdateValues();
|
||||
}
|
||||
|
@ -919,7 +919,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void PauseScriptMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
SelectedFiles.ToList().ForEach(x => x.TogglePause());
|
||||
foreach (var x in SelectedFiles) x.TogglePause();
|
||||
UpdateDialog();
|
||||
}
|
||||
|
||||
|
@ -932,11 +932,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void EditScriptMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
SelectedFiles.ToList().ForEach(file =>
|
||||
foreach (var file in SelectedFiles)
|
||||
{
|
||||
string pathToLoad = ProcessPath(file.Path);
|
||||
System.Diagnostics.Process.Start(pathToLoad);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveScriptMenuItem_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -45,9 +45,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
private void PopulateListView()
|
||||
{
|
||||
FunctionView.Items.Clear();
|
||||
|
||||
var nlfs = GlobalWin.Tools.LuaConsole.LuaImp.GetRegisteredFunctions().OrderBy(x => x.Event).ThenBy(x => x.Name).ToList();
|
||||
foreach (var nlf in nlfs)
|
||||
|
||||
foreach (var nlf in GlobalWin.Tools.LuaConsole.LuaImp.GetRegisteredFunctions()
|
||||
.OrderBy(x => x.Event)
|
||||
.ThenBy(x => x.Name))
|
||||
{
|
||||
var item = new ListViewItem { Text = nlf.Event };
|
||||
item.SubItems.Add(nlf.Name);
|
||||
|
|
|
@ -185,9 +185,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
try
|
||||
{
|
||||
var fileSelectors = FileSelectors.ToList();
|
||||
|
||||
var names = fileSelectors.Select(f => f.GetName());
|
||||
var names = FileSelectors.Select(f => f.GetName());
|
||||
|
||||
var name = NameBox.Text;
|
||||
|
||||
|
|
|
@ -677,13 +677,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (TasView.AnyRowsSelected)
|
||||
{
|
||||
var wasPaused = Mainform.EmulatorPaused;
|
||||
var framesToInsert = TasView.SelectedRows.ToList();
|
||||
var insertionFrame = Math.Min(TasView.LastSelectedIndex.Value + 1, CurrentTasMovie.InputLogLength);
|
||||
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
||||
|
||||
var inputLog = framesToInsert
|
||||
.Select(frame => CurrentTasMovie.GetInputLogEntry(frame))
|
||||
.ToList();
|
||||
var inputLog = TasView.SelectedRows.Select(frame => CurrentTasMovie.GetInputLogEntry(frame)).ToList();
|
||||
|
||||
CurrentTasMovie.InsertInput(insertionFrame, inputLog);
|
||||
|
||||
|
@ -780,8 +776,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void RemoveMarkersMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
IEnumerable<TasMovieMarker> markers = CurrentTasMovie.Markers.Where(m => TasView.SelectedRows.Contains(m.Frame));
|
||||
foreach (TasMovieMarker m in markers.ToList())
|
||||
foreach (var m in CurrentTasMovie.Markers.Where(m => TasView.SelectedRows.Contains(m.Frame)))
|
||||
{
|
||||
CurrentTasMovie.Markers.Remove(m);
|
||||
}
|
||||
|
|
|
@ -136,10 +136,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public void ClearBoolean()
|
||||
{
|
||||
PadControls
|
||||
.OfType<VirtualPadButton>()
|
||||
.ToList()
|
||||
.ForEach(p => p.Clear());
|
||||
foreach (var p in PadControls.OfType<VirtualPadButton>()) p.Clear();
|
||||
}
|
||||
|
||||
public void Set(IController controller)
|
||||
|
@ -149,28 +146,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public void SetPrevious(IController previous)
|
||||
{
|
||||
PadControls
|
||||
.OfType<VirtualPadAnalogStick>()
|
||||
.ToList()
|
||||
.ForEach(c => c.SetPrevious(previous));
|
||||
foreach (var c in PadControls.OfType<VirtualPadAnalogStick>()) c.SetPrevious(previous);
|
||||
}
|
||||
|
||||
public void BumpAnalog(int? x, int? y)
|
||||
{
|
||||
PadControls
|
||||
.OfType<VirtualPadAnalogStick>()
|
||||
.ToList()
|
||||
.ForEach(a => a.Bump(x, y));
|
||||
|
||||
PadControls
|
||||
.OfType<VirtualPadAnalogButton>()
|
||||
.ToList()
|
||||
.ForEach(a => a.Bump(x));
|
||||
|
||||
PadControls
|
||||
.OfType<VirtualPadTargetScreen>()
|
||||
.ToList()
|
||||
.ForEach(a => a.Bump(x, y));
|
||||
foreach (var a in PadControls.OfType<VirtualPadAnalogStick>()) a.Bump(x, y);
|
||||
foreach (var a in PadControls.OfType<VirtualPadAnalogButton>()) a.Bump(x);
|
||||
foreach (var a in PadControls.OfType<VirtualPadTargetScreen>()) a.Bump(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -876,7 +876,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
InitialLocation = this.ChildPointToScreen(WatchListView)
|
||||
};
|
||||
|
||||
poke.SetWatch(SelectedIndices.Select(t => _searches[t]).ToList());
|
||||
poke.SetWatch(SelectedIndices.Select(t => _searches[t]));
|
||||
poke.ShowHawkDialog();
|
||||
|
||||
UpdateList();
|
||||
|
@ -1512,10 +1512,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void ErrorIconButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var outOfRangeAddresses = _searches.OutOfRangeAddress.ToList();
|
||||
|
||||
SetRemovedMessage(outOfRangeAddresses.Count);
|
||||
|
||||
SetRemovedMessage(_searches.OutOfRangeAddress.Count());
|
||||
UpdateList();
|
||||
ToggleSearchDependentToolBarItems();
|
||||
}
|
||||
|
|
|
@ -915,10 +915,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
Changes();
|
||||
|
||||
var indices = indexes.Select(t => t - 1).ToList();
|
||||
|
||||
WatchListView.SelectedIndices.Clear();
|
||||
foreach (var t in indices)
|
||||
foreach (var t in indexes.Select(t => t - 1))
|
||||
{
|
||||
WatchListView.SelectItem(t, true);
|
||||
}
|
||||
|
@ -941,10 +939,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
_watches.Insert(indices[i] + 1, watch);
|
||||
}
|
||||
|
||||
var newindices = indices.Select(t => t + 1).ToList();
|
||||
|
||||
WatchListView.SelectedIndices.Clear();
|
||||
foreach (var t in newindices)
|
||||
foreach (var t in indices.Select(t => t + 1))
|
||||
{
|
||||
WatchListView.SelectItem(t, true);
|
||||
}
|
||||
|
@ -1298,11 +1294,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void ErrorIconButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var items = _watches
|
||||
.Where(watch => watch.Address >= watch.Domain.Size)
|
||||
.ToList();
|
||||
|
||||
foreach (var item in items)
|
||||
foreach (var item in _watches.Where(watch => watch.Address >= watch.Domain.Size))
|
||||
{
|
||||
_watches.Remove(item);
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ namespace BizHawk.Client.MultiHawk
|
|||
{
|
||||
Global.MovieSession.Movie.Stop();
|
||||
|
||||
foreach (var ew in EmulatorWindows.ToList())
|
||||
foreach (var ew in EmulatorWindows)
|
||||
{
|
||||
ew.ShutDown();
|
||||
}
|
||||
|
@ -1421,7 +1421,7 @@ namespace BizHawk.Client.MultiHawk
|
|||
|
||||
private void CloseAllWindows()
|
||||
{
|
||||
foreach (var ew in EmulatorWindows.ToList())
|
||||
foreach (var ew in EmulatorWindows)
|
||||
{
|
||||
ew.Close();
|
||||
}
|
||||
|
@ -1431,7 +1431,7 @@ namespace BizHawk.Client.MultiHawk
|
|||
|
||||
private void NewSessionMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach (var ew in EmulatorWindows.ToList())
|
||||
foreach (var ew in EmulatorWindows)
|
||||
{
|
||||
ew.Close();
|
||||
}
|
||||
|
|
|
@ -300,13 +300,9 @@ namespace BizHawk.Client.MultiHawk
|
|||
|
||||
private void MovieView_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||
|
||||
filePaths
|
||||
.Where(path => MovieService.MovieExtensions.Contains(Path.GetExtension(path).Replace(".", "")))
|
||||
.ToList()
|
||||
.ForEach(path => AddMovieToList(path, force: true));
|
||||
|
||||
foreach (var path in ((string[])e.Data.GetData(DataFormats.FileDrop))
|
||||
.Where(path => MovieService.MovieExtensions.Contains(Path.GetExtension(path)?.Replace(".", ""))))
|
||||
AddMovieToList(path, force: true);
|
||||
RefreshMovieList();
|
||||
}
|
||||
|
||||
|
@ -459,11 +455,8 @@ namespace BizHawk.Client.MultiHawk
|
|||
|
||||
private void EditMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
MovieView.SelectedIndices
|
||||
.Cast<int>()
|
||||
.SelectAsIndexOf(_movieList)
|
||||
.ToList()
|
||||
.ForEach(movie => System.Diagnostics.Process.Start(movie.Filename));
|
||||
foreach (var movie in MovieView.SelectedIndices.Cast<int>().SelectAsIndexOf(_movieList))
|
||||
System.Diagnostics.Process.Start(movie.Filename);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -58,19 +58,15 @@ namespace BizHawk.Common.BizInvoke
|
|||
|
||||
public DelegateStorage(Type type)
|
||||
{
|
||||
var methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Public)
|
||||
.Select(m => new
|
||||
{
|
||||
Info = m,
|
||||
Attr = m.GetCustomAttributes(true).OfType<BizExportAttribute>().FirstOrDefault()
|
||||
})
|
||||
.Where(a => a.Attr != null)
|
||||
.ToList();
|
||||
|
||||
var typeBuilder = ImplModuleBuilder.DefineType(
|
||||
"Bizhawk.BizExvokeHolder" + type.Name, TypeAttributes.Class | TypeAttributes.Public | TypeAttributes.Sealed);
|
||||
|
||||
foreach (var a in methods)
|
||||
foreach (var a in type.GetMethods(BindingFlags.Instance | BindingFlags.Public)
|
||||
.Select(m => new
|
||||
{
|
||||
Info = m,
|
||||
Attr = m.GetCustomAttributes(true).OfType<BizExportAttribute>().FirstOrDefault()
|
||||
})
|
||||
.Where(a => a.Attr != null))
|
||||
{
|
||||
MethodBuilder unused;
|
||||
var delegateType = BizInvokeUtilities.CreateDelegateType(a.Info, a.Attr.CallingConvention, typeBuilder, out unused).CreateType();
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Common
|
|||
{
|
||||
public ServiceNotApplicableAttribute(params Type[] types)
|
||||
{
|
||||
NotApplicableTypes = types?.ToList() ?? new List<Type>();
|
||||
NotApplicableTypes = types ?? Enumerable.Empty<Type>();
|
||||
}
|
||||
|
||||
public IEnumerable<Type> NotApplicableTypes { get; private set; }
|
||||
|
|
|
@ -1034,13 +1034,9 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
|||
|
||||
public int[] GetVideoBuffer()
|
||||
{
|
||||
// get only lines that have pixel data
|
||||
var lines = ScreenLines.Where(a => a.Pixels.Count > 0).ToList();
|
||||
var height = lines.Count();
|
||||
|
||||
int pos = 0;
|
||||
int lCount = 0;
|
||||
foreach (var l in lines)
|
||||
foreach (var l in ScreenLines.Where(a => a.Pixels.Count > 0)) // get only lines that have pixel data
|
||||
{
|
||||
var lCop = l.Pixels.ToList();
|
||||
var len = l.Pixels.Count;
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
{
|
||||
Name = _game.Name,
|
||||
System = "A26",
|
||||
MetaData = "m=" + _mapper.GetType().ToString().Split('.').ToList().Last(),
|
||||
MetaData = $"m={_mapper.GetType().ToString().Split('.').Last()}",
|
||||
Hash = Rom.HashSHA1(),
|
||||
Region = _game.Region,
|
||||
Status = RomStatus.Unknown
|
||||
|
|
Loading…
Reference in New Issue