diff --git a/.editorconfig b/.editorconfig index b672861277..07441ba765 100644 --- a/.editorconfig +++ b/.editorconfig @@ -121,9 +121,12 @@ dotnet_style_predefined_type_for_member_access = true # IDE0049, IDE-only counterpart of StyleCopAnalyzers - SA1121: UseBuiltInTypeAlias. dotnet_style_predefined_type_for_locals_parameters_members = true -# Use expression body if a local function is a single line. +# Use expression body for some items if on a single line. csharp_style_expression_bodied_local_functions = when_on_single_line +# This rule is buggy and not enforced for builds. ':warning' will at least enforce it in the IDE. +csharp_style_expression_bodied_lambdas = when_on_single_line:warning + # Remove unused parameters on non public methods, ignore unused parameters on public methods. dotnet_code_quality_unused_parameters = non_public @@ -216,6 +219,9 @@ dotnet_diagnostic.IDE0051.severity = warning # Remove unread private member. dotnet_diagnostic.IDE0052.severity = warning +# Use expression body for lambdas. +dotnet_diagnostic.IDE0053.severity = warning + # Use compound assignment. dotnet_diagnostic.IDE0054.severity = warning diff --git a/OpenRA.Game/FieldLoader.cs b/OpenRA.Game/FieldLoader.cs index b26156d9ae..4bf6b7ba2c 100644 --- a/OpenRA.Game/FieldLoader.cs +++ b/OpenRA.Game/FieldLoader.cs @@ -56,14 +56,10 @@ namespace OpenRA } public static Func InvalidValueAction = (s, t, f) => - { throw new YamlException($"FieldLoader: Cannot parse `{s}` into `{f}.{t}` "); - }; public static Action UnknownFieldAction = (s, f) => - { throw new NotImplementedException($"FieldLoader: Missing field `{s}` on `{f.Name}`"); - }; static readonly ConcurrentCache TypeLoadInfo = new ConcurrentCache(BuildTypeLoadInfo); diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index ea82c7c45e..aac4761267 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -65,7 +65,7 @@ namespace OpenRA { var newConnection = new NetworkConnection(endpoint); if (recordReplay) - newConnection.StartRecording(() => { return TimestampedFilename(); }); + newConnection.StartRecording(() => TimestampedFilename()); var om = new OrderManager(newConnection); JoinInner(om); @@ -618,10 +618,7 @@ namespace OpenRA if (orderManager.TryTick()) { - Sync.RunUnsynced(world, () => - { - world.OrderGenerator.Tick(world); - }); + Sync.RunUnsynced(world, () => world.OrderGenerator.Tick(world)); world.Tick(); diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index 918a31854e..12eaa25b39 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -336,7 +336,7 @@ namespace OpenRA.Server if (Settings.RecordReplays && Type == ServerType.Dedicated) { - recorder = new ReplayRecorder(() => { return Game.TimestampedFilename(extra: "-Server"); }); + recorder = new ReplayRecorder(() => Game.TimestampedFilename(extra: "-Server")); // We only need one handshake to initialize the replay. // Add it now, then ignore the redundant handshakes from each client diff --git a/OpenRA.Mods.Common/DiscordService.cs b/OpenRA.Mods.Common/DiscordService.cs index 3a912cbc4d..6e7bae32a0 100644 --- a/OpenRA.Mods.Common/DiscordService.cs +++ b/OpenRA.Mods.Common/DiscordService.cs @@ -97,10 +97,7 @@ namespace OpenRA.Mods.Common return; var server = args.Secret.Split('|'); - Game.RunAfterTick(() => - { - Game.RemoteDirectConnect(new ConnectionTarget(server[0], int.Parse(server[1]))); - }); + Game.RunAfterTick(() => Game.RemoteDirectConnect(new ConnectionTarget(server[0], int.Parse(server[1])))); } void SetStatus(DiscordState state, string details = null, string secret = null, int? players = null, int? slots = null) diff --git a/OpenRA.Mods.Common/Effects/FlashTarget.cs b/OpenRA.Mods.Common/Effects/FlashTarget.cs index 2c09aba5b6..379607a1f5 100644 --- a/OpenRA.Mods.Common/Effects/FlashTarget.cs +++ b/OpenRA.Mods.Common/Effects/FlashTarget.cs @@ -36,10 +36,7 @@ namespace OpenRA.Mods.Common.Effects this.interval = interval; tick = -delay; - target.World.RemoveAll(effect => - { - return effect is FlashTarget flashTarget && flashTarget.target == target; - }); + target.World.RemoveAll(effect => effect is FlashTarget flashTarget && flashTarget.target == target); } public FlashTarget(Actor target, Color color, float alpha = 0.5f, int count = 2, int interval = 2, int delay = 0) diff --git a/OpenRA.Mods.Common/Traits/Buildings/FreeActor.cs b/OpenRA.Mods.Common/Traits/Buildings/FreeActor.cs index ba779af564..6ab2e642d9 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/FreeActor.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/FreeActor.cs @@ -47,10 +47,7 @@ namespace OpenRA.Mods.Common.Traits return true; }, - (actor, value) => - { - actor.ReplaceInit(new FreeActorInit(this, value), this); - }); + (actor, value) => actor.ReplaceInit(new FreeActorInit(this, value), this)); } public override object Create(ActorInitializer init) { return new FreeActor(init, this); } diff --git a/OpenRA.Mods.Common/Traits/Cargo.cs b/OpenRA.Mods.Common/Traits/Cargo.cs index 81079727d5..a165fef67f 100644 --- a/OpenRA.Mods.Common/Traits/Cargo.cs +++ b/OpenRA.Mods.Common/Traits/Cargo.cs @@ -125,9 +125,7 @@ namespace OpenRA.Mods.Common.Traits checkTerrainType = info.UnloadTerrainTypes.Count > 0; currentAdjacentCells = new CachedTransform>(loc => - { - return Util.AdjacentCells(self.World, Target.FromActor(self)).Where(c => loc != c); - }); + Util.AdjacentCells(self.World, Target.FromActor(self)).Where(c => loc != c)); var runtimeCargoInit = init.GetOrDefault(info); var cargoInit = init.GetOrDefault(info); diff --git a/OpenRA.Mods.Common/Traits/Conditions/GrantConditionOnDeploy.cs b/OpenRA.Mods.Common/Traits/Conditions/GrantConditionOnDeploy.cs index 66648cfa2e..1c338a5ddb 100644 --- a/OpenRA.Mods.Common/Traits/Conditions/GrantConditionOnDeploy.cs +++ b/OpenRA.Mods.Common/Traits/Conditions/GrantConditionOnDeploy.cs @@ -81,9 +81,7 @@ namespace OpenRA.Mods.Common.Traits return false; }, (actor, value) => - { - actor.ReplaceInit(new DeployStateInit(value ? DeployState.Deployed : DeployState.Undeployed)); - }); + actor.ReplaceInit(new DeployStateInit(value ? DeployState.Deployed : DeployState.Undeployed))); } public override object Create(ActorInitializer init) { return new GrantConditionOnDeploy(init, this); } diff --git a/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs b/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs index e5a8d3c4e4..469f5a45be 100644 --- a/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs +++ b/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs @@ -252,7 +252,7 @@ namespace OpenRA.Mods.Common.Traits MarkFailed(player, id); } - public event Action ObjectiveAdded = (player, inhibitAnnouncement) => { player.HasObjectives = true; }; + public event Action ObjectiveAdded = (player, inhibitAnnouncement) => player.HasObjectives = true; public void ResolveOrder(Actor self, Order order) { diff --git a/OpenRA.Mods.Common/Traits/ReloadAmmoPool.cs b/OpenRA.Mods.Common/Traits/ReloadAmmoPool.cs index 2b80a69651..854eae9946 100644 --- a/OpenRA.Mods.Common/Traits/ReloadAmmoPool.cs +++ b/OpenRA.Mods.Common/Traits/ReloadAmmoPool.cs @@ -61,9 +61,7 @@ namespace OpenRA.Mods.Common.Traits base.Created(self); self.World.AddFrameEndTask(w => - { - remainingTicks = Util.ApplyPercentageModifiers(Info.Delay, modifiers.Select(m => m.GetReloadAmmoModifier())); - }); + remainingTicks = Util.ApplyPercentageModifiers(Info.Delay, modifiers.Select(m => m.GetReloadAmmoModifier()))); } void INotifyAttack.Attacking(Actor self, in Target target, Armament a, Barrel barrel) diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/AirstrikePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/AirstrikePower.cs index 986f65b68c..7c29706f55 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/AirstrikePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/AirstrikePower.cs @@ -230,10 +230,7 @@ namespace OpenRA.Mods.Common.Traits if (beacon == null) return; - Self.World.AddFrameEndTask(w => - { - w.Remove(beacon); - }); + Self.World.AddFrameEndTask(w => w.Remove(beacon)); } } } diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs index 1be3fab5d6..b5e7ba1c11 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs @@ -204,10 +204,7 @@ namespace OpenRA.Mods.Common.Traits Info.BeaconDelay, info.FlightDelay - info.BeaconRemoveAdvance); - self.World.AddFrameEndTask(w => - { - w.Add(beacon); - }); + self.World.AddFrameEndTask(w => w.Add(beacon)); } } diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/ParatroopersPower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/ParatroopersPower.cs index 94a14b3715..c1fe2469bf 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/ParatroopersPower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/ParatroopersPower.cs @@ -283,10 +283,7 @@ namespace OpenRA.Mods.Common.Traits if (beacon == null) return; - Self.World.AddFrameEndTask(w => - { - w.Remove(beacon); - }); + Self.World.AddFrameEndTask(w => w.Remove(beacon)); } } } diff --git a/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs b/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs index 55f01a9510..af3e7c9a84 100644 --- a/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs @@ -284,10 +284,7 @@ namespace OpenRA.Mods.Common.Traits for (var i = (byte)SubCell.First; i < map.Grid.SubCellOffsets.Length; i++) { - var blocked = previews.Any(p => - { - return p.Footprint.TryGetValue(cell, out var s) && s == (SubCell)i; - }); + var blocked = previews.Any(p => p.Footprint.TryGetValue(cell, out var s) && s == (SubCell)i); if (!blocked) return (SubCell)i; diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractZeroBraneStudioLuaAPI.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractZeroBraneStudioLuaAPI.cs index 18ef6aa823..3435f22d89 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractZeroBraneStudioLuaAPI.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractZeroBraneStudioLuaAPI.cs @@ -86,15 +86,11 @@ namespace OpenRA.Mods.Common.UtilityCommands Console.WriteLine(" },"); } - var actorProperties = utility.ModData.ObjectCreator.GetTypesImplementing().SelectMany(cg => - { - return ScriptMemberWrapper.WrappableMembers(cg); - }); + var actorProperties = utility.ModData.ObjectCreator.GetTypesImplementing() + .SelectMany(ScriptMemberWrapper.WrappableMembers); - var scriptProperties = utility.ModData.ObjectCreator.GetTypesImplementing().SelectMany(cg => - { - return ScriptMemberWrapper.WrappableMembers(cg); - }); + var scriptProperties = utility.ModData.ObjectCreator.GetTypesImplementing() + .SelectMany(ScriptMemberWrapper.WrappableMembers); var properties = actorProperties.Concat(scriptProperties); foreach (var property in properties.OrderBy(m => m.Name)) diff --git a/OpenRA.Mods.Common/Widgets/ConfirmationDialogs.cs b/OpenRA.Mods.Common/Widgets/ConfirmationDialogs.cs index 40fd4c02b1..65a8a8ee6d 100644 --- a/OpenRA.Mods.Common/Widgets/ConfirmationDialogs.cs +++ b/OpenRA.Mods.Common/Widgets/ConfirmationDialogs.cs @@ -94,10 +94,7 @@ namespace OpenRA.Mods.Common.Widgets { otherButton.Visible = true; otherButton.Bounds.Y += headerHeight; - otherButton.OnClick = () => - { - onOther(); - }; + otherButton.OnClick = onOther; if (!string.IsNullOrEmpty(otherText)) { diff --git a/OpenRA.Mods.Common/Widgets/Logic/AssetBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/AssetBrowserLogic.cs index 1650e12d8a..a0dace6949 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/AssetBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/AssetBrowserLogic.cs @@ -452,7 +452,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic { var item = ScrollItemWidget.Setup(template, () => currentFilename == filepath && currentPackage == package, - () => { LoadAsset(package, filepath); }); + () => LoadAsset(package, filepath)); var label = item.Get("TITLE"); WidgetUtils.TruncateLabelToTooltip(label, filepath); diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/MapEditorTabsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/MapEditorTabsLogic.cs index 0b5f40acb9..fa042987f9 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/MapEditorTabsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/MapEditorTabsLogic.cs @@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic { var tab = tabContainer.Get(buttonId); tab.IsHighlighted = () => menuType == tabType; - tab.OnClick = () => { menuType = tabType; }; + tab.OnClick = () => menuType = tabType; var container = widget.Parent.Get(tabId); container.IsVisible = () => menuType == tabType; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/NewMapLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/NewMapLogic.cs index 16d8699174..35241e32ae 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/NewMapLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/NewMapLogic.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic { var item = ScrollItemWidget.Setup(template, () => tilesetDropDown.Text == option, - () => { tilesetDropDown.Text = option; }); + () => tilesetDropDown.Text = option); item.Get("LABEL").GetText = () => option; return item; } diff --git a/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs index 576bc37d03..84e2a045b0 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs @@ -113,7 +113,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var saveButton = panel.Get("SAVE_BUTTON"); saveButton.IsDisabled = () => string.IsNullOrWhiteSpace(saveTextField.Text); - saveButton.OnClick = () => { Save(world); }; + saveButton.OnClick = () => Save(world); saveButton.IsVisible = () => true; var saveWidgets = panel.Get("SAVE_WIDGETS"); @@ -127,7 +127,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var loadButton = panel.Get("LOAD_BUTTON"); loadButton.IsVisible = () => true; loadButton.IsDisabled = () => selectedSave == null; - loadButton.OnClick = () => { Load(); }; + loadButton.OnClick = Load; } if (Directory.Exists(baseSavePath)) diff --git a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs index bfb40e2ff0..9b7e5a5aa7 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs @@ -333,9 +333,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic catch (Exception e) { Game.RunAfterTick(() => // run on the main thread - { - SetNewsStatus(modData.Translation.GetString(NewsRetrivalFailed, Translation.Arguments("message", e.Message))); - }); + SetNewsStatus(modData.Translation.GetString(NewsRetrivalFailed, Translation.Arguments("message", e.Message)))); } }); } diff --git a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs index 012420cf04..559fbac833 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs @@ -434,10 +434,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic { var fsPlayer = fullscreenVideoPlayer.Get("PLAYER"); fullscreenVideoPlayer.Visible = true; - PlayVideo(fsPlayer, missionData.StartVideo, PlayingVideo.GameStart, () => - { - Game.CreateAndStartLocalServer(selectedMap.Uid, orders); - }); + PlayVideo(fsPlayer, missionData.StartVideo, PlayingVideo.GameStart, + () => Game.CreateAndStartLocalServer(selectedMap.Uid, orders)); } else Game.CreateAndStartLocalServer(selectedMap.Uid, orders); diff --git a/OpenRA.Mods.Common/Widgets/Logic/MusicPlayerLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MusicPlayerLogic.cs index 06a7fd694b..d31f54e727 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MusicPlayerLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MusicPlayerLogic.cs @@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic pauseButton.IsVisible = () => Game.Sound.MusicPlaying; var stopButton = panel.Get("BUTTON_STOP"); - stopButton.OnClick = () => { musicPlaylist.Stop(); }; + stopButton.OnClick = musicPlaylist.Stop; stopButton.IsDisabled = NoMusic; var nextButton = panel.Get("BUTTON_NEXT"); diff --git a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs index a2e11b6746..6cf3d303c3 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs @@ -148,7 +148,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var watch = panel.Get("WATCH_BUTTON"); watch.IsDisabled = () => selectedReplay == null || map.Status != MapStatus.Available; - watch.OnClick = () => { WatchReplay(); }; + watch.OnClick = WatchReplay; var mapPreviewRoot = panel.Get("MAP_PREVIEW_ROOT"); mapPreviewRoot.IsVisible = () => selectedReplay != null; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Settings/HotkeysSettingsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Settings/HotkeysSettingsLogic.cs index 557b8efdbc..4265572520 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Settings/HotkeysSettingsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Settings/HotkeysSettingsLogic.cs @@ -68,10 +68,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var hotkeyValidColor = ChromeMetrics.Get("HotkeyColor"); var hotkeyInvalidColor = ChromeMetrics.Get("HotkeyColorInvalid"); - remapButton.GetColor = () => - { - return hd.HasDuplicates ? hotkeyInvalidColor : hotkeyValidColor; - }; + remapButton.GetColor = () => hd.HasDuplicates ? hotkeyInvalidColor : hotkeyValidColor; if (selectedHotkeyDefinition == hd) { @@ -253,9 +250,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic hotkeyEntryWidget.IsValid = () => isHotkeyValid; hotkeyEntryWidget.OnLoseFocus = ValidateHotkey; hotkeyEntryWidget.OnEscKey = _ => - { hotkeyEntryWidget.Key = modData.Hotkeys[selectedHotkeyDefinition.Name].GetValue(); - }; hotkeyEntryWidget.IsDisabled = () => selectedHotkeyDefinition.Readonly; validHotkeyEntryWidth = hotkeyEntryWidget.Bounds.Width; diff --git a/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs b/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs index a16dc3d707..07738edb88 100644 --- a/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs @@ -285,10 +285,7 @@ namespace OpenRA.Mods.Common.Widgets public void ScrollToItem(string itemKey, bool smooth = false) { - var item = Children.FirstOrDefault(c => - { - return c is ScrollItemWidget si && si.ItemKey == itemKey; - }); + var item = Children.FirstOrDefault(c => c is ScrollItemWidget si && si.ItemKey == itemKey); if (item != null) ScrollToItem(item, smooth); @@ -296,10 +293,7 @@ namespace OpenRA.Mods.Common.Widgets public void ScrollToSelectedItem() { - var item = Children.FirstOrDefault(c => - { - return c is ScrollItemWidget si && si.IsSelected(); - }); + var item = Children.FirstOrDefault(c => c is ScrollItemWidget si && si.IsSelected()); if (item != null) ScrollToItem(item); diff --git a/OpenRA.Platforms.Default/ThreadedGraphicsContext.cs b/OpenRA.Platforms.Default/ThreadedGraphicsContext.cs index d93f624180..5af33c8251 100644 --- a/OpenRA.Platforms.Default/ThreadedGraphicsContext.cs +++ b/OpenRA.Platforms.Default/ThreadedGraphicsContext.cs @@ -106,8 +106,8 @@ namespace OpenRA.Platforms.Default var t = (ValueTuple)tuple; context.EnableScissor(t.Item1, t.Item2, t.Item3, t.Item4); }; - doSetBlendMode = mode => { context.SetBlendMode((BlendMode)mode); }; - doSetVSync = enabled => { context.SetVSyncEnabled((bool)enabled); }; + doSetBlendMode = mode => context.SetBlendMode((BlendMode)mode); + doSetVSync = enabled => context.SetVSyncEnabled((bool)enabled); Monitor.Pulse(syncObject); }