diff --git a/CHANGELOG.md b/CHANGELOG.md index d11e246..6e2928a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Improvements - Allow using external gesture handling alongside InputHandler through ExternalGestureHandling - Discard old data when updating a StaticSpriteBatch - **Drastically improved StaticSpriteBatch batching performance** +- Multi-target net452, making MLEM compatible with MonoGame for consoles Fixes - Fixed TokenizedString handling trailing spaces incorrectly in the last line of non-left aligned text @@ -36,6 +37,7 @@ Improvements - Allow elements to auto-adjust their size even when their children are aligned oddly - Close other dropdowns when opening a dropdown - Generified UiMarkdownParser by adding abstract UiParser +- Multi-target net452, making MLEM compatible with MonoGame for consoles Fixes - Fixed parents of elements that prevent spill not being notified properly @@ -51,10 +53,19 @@ Additions Improvements - Allow data texture atlas pivots and offsets to be negative - Made RuntimeTexturePacker restore texture region name and pivot when packing +- Multi-target net452, making MLEM compatible with MonoGame for consoles Fixes - Fixed data texture atlases not allowing most characters in their region names +## MLEM.Extended +Improvements +- Multi-target net452, making MLEM compatible with MonoGame for consoles + +## MLEM.Startup +Improvements +- Multi-target net452, making MLEM compatible with MonoGame for consoles + ## 6.0.0 ### MLEM diff --git a/Demos.DesktopGL/Demos.DesktopGL.FNA.csproj b/Demos.DesktopGL/Demos.DesktopGL.FNA.csproj index 7933bf0..d2d77ce 100644 --- a/Demos.DesktopGL/Demos.DesktopGL.FNA.csproj +++ b/Demos.DesktopGL/Demos.DesktopGL.FNA.csproj @@ -7,6 +7,7 @@ MLEM Desktop Demos Demos.DesktopGL $(DefineConstants);FNA + MSB3270 DesktopGL diff --git a/Demos/Demos.FNA.csproj b/Demos/Demos.FNA.csproj index 6d088d2..0b64091 100644 --- a/Demos/Demos.FNA.csproj +++ b/Demos/Demos.FNA.csproj @@ -4,6 +4,7 @@ netstandard2.0 Demos $(DefineConstants);FNA + MSB3270 diff --git a/FontStashSharp b/FontStashSharp index 38849f3..6e6fc60 160000 --- a/FontStashSharp +++ b/FontStashSharp @@ -1 +1 @@ -Subproject commit 38849f3ac2887c14b8fa1c69c17468032e5233e1 +Subproject commit 6e6fc608bee0d4e7b2944f7c686ca0d28896e195 diff --git a/MLEM.Data/Json/JsonTypeSafeGenericDataHolder.cs b/MLEM.Data/Json/JsonTypeSafeGenericDataHolder.cs index d3cbbbe..39f2d1c 100644 --- a/MLEM.Data/Json/JsonTypeSafeGenericDataHolder.cs +++ b/MLEM.Data/Json/JsonTypeSafeGenericDataHolder.cs @@ -12,6 +12,8 @@ namespace MLEM.Data.Json { [DataContract] public class JsonTypeSafeGenericDataHolder : IGenericDataHolder { + private static readonly string[] EmptyStrings = new string[0]; + [DataMember(EmitDefaultValue = false)] private Dictionary data; @@ -35,9 +37,9 @@ namespace MLEM.Data.Json { } /// - public IReadOnlyCollection GetDataKeys() { + public IEnumerable GetDataKeys() { if (this.data == null) - return Array.Empty(); + return JsonTypeSafeGenericDataHolder.EmptyStrings; return this.data.Keys; } diff --git a/MLEM.Data/MLEM.Data.FNA.csproj b/MLEM.Data/MLEM.Data.FNA.csproj index b247ae1..aa7d556 100644 --- a/MLEM.Data/MLEM.Data.FNA.csproj +++ b/MLEM.Data/MLEM.Data.FNA.csproj @@ -1,11 +1,11 @@  - netstandard2.0;net6.0 + net452;netstandard2.0;net6.0 true true MLEM.Data $(DefineConstants);FNA - NU1701 + NU1701;MSB3270 @@ -33,7 +33,8 @@ all - + + all diff --git a/MLEM.Data/MLEM.Data.csproj b/MLEM.Data/MLEM.Data.csproj index 109e6ff..12fe703 100644 --- a/MLEM.Data/MLEM.Data.csproj +++ b/MLEM.Data/MLEM.Data.csproj @@ -1,6 +1,6 @@  - netstandard2.0;net6.0 + net452;netstandard2.0;net6.0 true true NU1701 diff --git a/MLEM.Extended/MLEM.Extended.FNA.csproj b/MLEM.Extended/MLEM.Extended.FNA.csproj index 7357d76..fccb966 100644 --- a/MLEM.Extended/MLEM.Extended.FNA.csproj +++ b/MLEM.Extended/MLEM.Extended.FNA.csproj @@ -5,6 +5,7 @@ true MLEM.Extended $(DefineConstants);FNA + NU1702;MSB3270 @@ -22,10 +23,10 @@ - + all - + all diff --git a/MLEM.FNA.sln b/MLEM.FNA.sln index acdea53..07a328b 100644 --- a/MLEM.FNA.sln +++ b/MLEM.FNA.sln @@ -16,9 +16,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.FNA", "Tests\Tests.FN EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MLEM.Extended.FNA", "MLEM.Extended\MLEM.Extended.FNA.csproj", "{A5B22930-DF4B-4A62-93ED-A6549F7B666B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNA.Core", "FNA\FNA.Core.csproj", "{06459F72-CEAA-4B45-B2B1-708FC28D04F8}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNA", "FNA\FNA.csproj", "{35253CE1-C864-4CD3-8249-4D1319748E8F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontStashSharp.FNA.Core", "FontStashSharp\src\XNA\FontStashSharp.FNA.Core.csproj", "{0B410591-3AED-4C82-A07A-516FF493709B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontStashSharp.FNA", "FontStashSharp\src\XNA\FontStashSharp.FNA.csproj", "{39249E92-EBF2-4951-A086-AB4951C3CCE1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNA.Core", "FNA\FNA.Core.csproj", "{E33D9B9B-DDC7-4488-BCCF-76625AF80B4D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -58,13 +60,17 @@ Global {A5B22930-DF4B-4A62-93ED-A6549F7B666B}.Debug|Any CPU.Build.0 = Debug|Any CPU {A5B22930-DF4B-4A62-93ED-A6549F7B666B}.Release|Any CPU.ActiveCfg = Release|Any CPU {A5B22930-DF4B-4A62-93ED-A6549F7B666B}.Release|Any CPU.Build.0 = Release|Any CPU - {06459F72-CEAA-4B45-B2B1-708FC28D04F8}.Debug|Any CPU.ActiveCfg = Debug|x64 - {06459F72-CEAA-4B45-B2B1-708FC28D04F8}.Debug|Any CPU.Build.0 = Debug|x64 - {06459F72-CEAA-4B45-B2B1-708FC28D04F8}.Release|Any CPU.ActiveCfg = Release|x64 - {06459F72-CEAA-4B45-B2B1-708FC28D04F8}.Release|Any CPU.Build.0 = Release|x64 - {0B410591-3AED-4C82-A07A-516FF493709B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0B410591-3AED-4C82-A07A-516FF493709B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0B410591-3AED-4C82-A07A-516FF493709B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0B410591-3AED-4C82-A07A-516FF493709B}.Release|Any CPU.Build.0 = Release|Any CPU + {35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|Any CPU.Build.0 = Release|Any CPU + {39249E92-EBF2-4951-A086-AB4951C3CCE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39249E92-EBF2-4951-A086-AB4951C3CCE1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39249E92-EBF2-4951-A086-AB4951C3CCE1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39249E92-EBF2-4951-A086-AB4951C3CCE1}.Release|Any CPU.Build.0 = Release|Any CPU + {E33D9B9B-DDC7-4488-BCCF-76625AF80B4D}.Debug|Any CPU.ActiveCfg = Debug|x64 + {E33D9B9B-DDC7-4488-BCCF-76625AF80B4D}.Debug|Any CPU.Build.0 = Debug|x64 + {E33D9B9B-DDC7-4488-BCCF-76625AF80B4D}.Release|Any CPU.ActiveCfg = Release|x64 + {E33D9B9B-DDC7-4488-BCCF-76625AF80B4D}.Release|Any CPU.Build.0 = Release|x64 EndGlobalSection EndGlobal diff --git a/MLEM.Startup/MLEM.Startup.FNA.csproj b/MLEM.Startup/MLEM.Startup.FNA.csproj index 2ff3745..898c256 100644 --- a/MLEM.Startup/MLEM.Startup.FNA.csproj +++ b/MLEM.Startup/MLEM.Startup.FNA.csproj @@ -1,11 +1,12 @@  - netstandard2.0;net6.0 + net452;netstandard2.0;net6.0 true true MLEM.Startup $(DefineConstants);FNA + MSB3270 @@ -21,11 +22,11 @@ - + - + all diff --git a/MLEM.Startup/MLEM.Startup.csproj b/MLEM.Startup/MLEM.Startup.csproj index 871862c..f7f863d 100644 --- a/MLEM.Startup/MLEM.Startup.csproj +++ b/MLEM.Startup/MLEM.Startup.csproj @@ -1,7 +1,7 @@  - netstandard2.0;net6.0 + net452;netstandard2.0;net6.0 true true @@ -19,7 +19,7 @@ - + diff --git a/MLEM.Templates/MLEM.Templates.csproj b/MLEM.Templates/MLEM.Templates.csproj index d3a5f13..f321339 100644 --- a/MLEM.Templates/MLEM.Templates.csproj +++ b/MLEM.Templates/MLEM.Templates.csproj @@ -1,7 +1,7 @@  - netstandard2.0;net6.0 + net452;netstandard2.0;net6.0 true false content diff --git a/MLEM.Ui/Elements/TextField.cs b/MLEM.Ui/Elements/TextField.cs index 9eafbd8..7b39c6f 100644 --- a/MLEM.Ui/Elements/TextField.cs +++ b/MLEM.Ui/Elements/TextField.cs @@ -6,7 +6,9 @@ using MLEM.Input; using MLEM.Misc; using MLEM.Textures; using MLEM.Ui.Style; +#if NETSTANDARD2_0_OR_GREATER || NET6_0_OR_GREATER using TextCopy; +#endif namespace MLEM.Ui.Elements { /// @@ -143,7 +145,11 @@ namespace MLEM.Ui.Elements { /// The text that the text field should contain by default /// Whether the text field should support multi-line editing public TextField(Anchor anchor, Vector2 size, Rule rule = null, GenericFont font = null, string text = null, bool multiline = false) : base(anchor, size) { - this.textInput = new TextInput(null, Vector2.Zero, 1, null, ClipboardService.SetText, ClipboardService.GetText) { + this.textInput = new TextInput(null, Vector2.Zero, 1 + #if NETSTANDARD2_0_OR_GREATER || NET6_0_OR_GREATER + , null, ClipboardService.SetText, ClipboardService.GetText + #endif + ) { OnTextChange = (i, s) => this.OnTextChange?.Invoke(this, s), InputRule = (i, s) => this.InputRule.Invoke(this, s) }; diff --git a/MLEM.Ui/MLEM.Ui.FNA.csproj b/MLEM.Ui/MLEM.Ui.FNA.csproj index b3d713a..21f359e 100644 --- a/MLEM.Ui/MLEM.Ui.FNA.csproj +++ b/MLEM.Ui/MLEM.Ui.FNA.csproj @@ -1,10 +1,11 @@  - netstandard2.0;net6.0 + net452;netstandard2.0;net6.0 true true MLEM.Ui $(DefineConstants);FNA + MSB3270 @@ -20,10 +21,10 @@ - + - + all diff --git a/MLEM.Ui/MLEM.Ui.csproj b/MLEM.Ui/MLEM.Ui.csproj index 7f7727b..301173c 100644 --- a/MLEM.Ui/MLEM.Ui.csproj +++ b/MLEM.Ui/MLEM.Ui.csproj @@ -1,6 +1,6 @@  - netstandard2.0;net6.0 + net452;netstandard2.0;net6.0 true true @@ -18,7 +18,7 @@ - + diff --git a/MLEM.Ui/Parsers/UiParser.cs b/MLEM.Ui/Parsers/UiParser.cs index 570d8e6..f7024fb 100644 --- a/MLEM.Ui/Parsers/UiParser.cs +++ b/MLEM.Ui/Parsers/UiParser.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Net.Http; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MLEM.Formatting; @@ -10,6 +9,12 @@ using MLEM.Textures; using MLEM.Ui.Elements; using MLEM.Ui.Style; +#if NETSTANDARD2_0_OR_GREATER || NET6_0_OR_GREATER +using System.Net.Http; +#else +using System.Net; +#endif + namespace MLEM.Ui.Parsers { /// /// A base class for parsing various types of formatted strings into a set of MLEM.Ui elements with styling for each individual . @@ -148,15 +153,16 @@ namespace MLEM.Ui.Parsers { try { Texture2D tex; if (path.StartsWith("http")) { - using (var client = new HttpClient()) { - using (var src = await client.GetStreamAsync(path)) { - using (var memory = new MemoryStream()) { - // download the full stream before passing it to texture - await src.CopyToAsync(memory); - tex = Texture2D.FromStream(this.GraphicsDevice, memory); - } - } - } + byte[] src; + #if NETSTANDARD2_0_OR_GREATER || NET6_0_OR_GREATER + using (var client = new HttpClient()) + src = await client.GetByteArrayAsync(path); + #else + using (var client = new WebClient()) + src = await client.DownloadDataTaskAsync(path); + #endif + using (var memory = new MemoryStream(src)) + tex = Texture2D.FromStream(this.GraphicsDevice, memory); } else { using (var stream = Path.IsPathRooted(path) ? File.OpenRead(path) : TitleContainer.OpenStream(path)) tex = Texture2D.FromStream(this.GraphicsDevice, stream); diff --git a/MLEM.Ui/UiControls.cs b/MLEM.Ui/UiControls.cs index 8f47cf4..c9b69a2 100644 --- a/MLEM.Ui/UiControls.cs +++ b/MLEM.Ui/UiControls.cs @@ -367,7 +367,7 @@ namespace MLEM.Ui { protected virtual Element GetTabNextElement(bool backward) { if (this.ActiveRoot == null) return null; - var children = this.ActiveRoot.Element.GetChildren(c => !c.IsHidden, true, true).Append(this.ActiveRoot.Element) + var children = this.ActiveRoot.Element.GetChildren(c => !c.IsHidden, true, true).Concat(Enumerable.Repeat(this.ActiveRoot.Element, 1)) // we can't add these checks to GetChildren because it ignores false grandchildren .Where(c => c.CanBeSelected && c.AutoNavGroup == this.SelectedElement?.AutoNavGroup); if (this.SelectedElement?.Root != this.ActiveRoot) { @@ -402,7 +402,7 @@ namespace MLEM.Ui { protected virtual Element GetGamepadNextElement(Direction2 direction) { if (this.ActiveRoot == null) return null; - var children = this.ActiveRoot.Element.GetChildren(c => !c.IsHidden, true, true).Append(this.ActiveRoot.Element) + var children = this.ActiveRoot.Element.GetChildren(c => !c.IsHidden, true, true).Concat(Enumerable.Repeat(this.ActiveRoot.Element, 1)) // we can't add these checks to GetChildren because it ignores false grandchildren .Where(c => c.CanBeSelected && c.AutoNavGroup == this.SelectedElement?.AutoNavGroup); if (this.SelectedElement?.Root != this.ActiveRoot) { diff --git a/MLEM/Extensions/CollectionExtensions.cs b/MLEM/Extensions/CollectionExtensions.cs index db1f238..0f92f0c 100644 --- a/MLEM/Extensions/CollectionExtensions.cs +++ b/MLEM/Extensions/CollectionExtensions.cs @@ -25,7 +25,7 @@ namespace MLEM.Extensions { public static IEnumerable> Combinations(this IEnumerable> things) { var combos = Enumerable.Repeat(Enumerable.Empty(), 1); foreach (var t in things) - combos = combos.SelectMany(c => t.Select(c.Append)); + combos = combos.SelectMany(c => t.Select(o => c.Concat(Enumerable.Repeat(o, 1)))); return combos; } @@ -47,7 +47,7 @@ namespace MLEM.Extensions { public static IEnumerable> IndexCombinations(this IEnumerable> things) { var combos = Enumerable.Repeat(Enumerable.Empty(), 1); foreach (var t in things) - combos = combos.SelectMany(c => t.Select((o, i) => c.Append(i))); + combos = combos.SelectMany(c => t.Select((o, i) => c.Concat(Enumerable.Repeat(i, 1)))); return combos; } diff --git a/MLEM/Input/InputHandler.cs b/MLEM/Input/InputHandler.cs index af2110c..20e2bc5 100644 --- a/MLEM/Input/InputHandler.cs +++ b/MLEM/Input/InputHandler.cs @@ -20,6 +20,8 @@ namespace MLEM.Input { #else private static readonly int MaximumGamePadCount = GamePad.MaximumGamePadCount; #endif + private static readonly TouchLocation[] EmptyTouchLocations = new TouchLocation[0]; + private static readonly GenericInput[] EmptyGenericInputs = new GenericInput[0]; /// /// Contains all of the gestures that have finished during the last update call. @@ -83,20 +85,20 @@ namespace MLEM.Input { /// An array of all , and values that are currently down. /// Additionally, or can be used to determine the amount of time that a given input has been down for. /// - public GenericInput[] InputsDown { get; private set; } = Array.Empty(); + public GenericInput[] InputsDown { get; private set; } = InputHandler.EmptyGenericInputs; /// /// An array of all , and that are currently considered pressed. /// An input is considered pressed if it was up in the last update, and is up in the current one. /// - public GenericInput[] InputsPressed { get; private set; } = Array.Empty(); + public GenericInput[] InputsPressed { get; private set; } = InputHandler.EmptyGenericInputs; /// /// Contains the touch state from the last update call /// - public TouchCollection LastTouchState { get; private set; } = new TouchCollection(Array.Empty()); + public TouchCollection LastTouchState { get; private set; } = new TouchCollection(InputHandler.EmptyTouchLocations); /// /// Contains the current touch state /// - public TouchCollection TouchState { get; private set; } = new TouchCollection(Array.Empty()); + public TouchCollection TouchState { get; private set; } = new TouchCollection(InputHandler.EmptyTouchLocations); /// /// Contains the , but with the taken into account. /// @@ -281,7 +283,7 @@ namespace MLEM.Input { this.LastTouchState = this.TouchState; this.LastViewportTouchState = this.ViewportTouchState; - this.TouchState = active ? TouchPanel.GetState() : new TouchCollection(Array.Empty()); + this.TouchState = active ? TouchPanel.GetState() : new TouchCollection(InputHandler.EmptyTouchLocations); if (this.TouchState.Count > 0 && this.ViewportOffset != Point.Zero) { this.ViewportTouchState = new List(); foreach (var touch in this.TouchState) { @@ -302,8 +304,8 @@ namespace MLEM.Input { } if (this.inputsDownAccum.Count <= 0 && this.inputsDown.Count <= 0) { - this.InputsPressed = Array.Empty(); - this.InputsDown = Array.Empty(); + this.InputsPressed = InputHandler.EmptyGenericInputs; + this.InputsDown = InputHandler.EmptyGenericInputs; } else { // handle pressed inputs var pressed = new List(); diff --git a/MLEM/Input/Keybind.cs b/MLEM/Input/Keybind.cs index e4f0b8c..b4c01e6 100644 --- a/MLEM/Input/Keybind.cs +++ b/MLEM/Input/Keybind.cs @@ -13,8 +13,10 @@ namespace MLEM.Input { [DataContract] public class Keybind : IComparable, IComparable { + private static readonly Combination[] EmptyCombinations = new Combination[0]; + [DataMember] - private Combination[] combinations = Array.Empty(); + private Combination[] combinations = Keybind.EmptyCombinations; /// /// Creates a new keybind and adds the given key and modifiers using @@ -42,7 +44,7 @@ namespace MLEM.Input { /// The modifier keys that have to be held down. /// This keybind, for chaining public Keybind Add(GenericInput key, params GenericInput[] modifiers) { - this.combinations = this.combinations.Append(new Combination(key, modifiers)).ToArray(); + this.combinations = this.combinations.Concat(Enumerable.Repeat(new Combination(key, modifiers), 1)).ToArray(); return this; } @@ -61,7 +63,7 @@ namespace MLEM.Input { /// The modifier keys that have to be held down. /// This keybind, for chaining. public Keybind Insert(int index, GenericInput key, params GenericInput[] modifiers) { - this.combinations = this.combinations.Take(index).Append(new Combination(key, modifiers)).Concat(this.combinations.Skip(index)).ToArray(); + this.combinations = this.combinations.Take(index).Concat(Enumerable.Repeat(new Combination(key, modifiers), 1)).Concat(this.combinations.Skip(index)).ToArray(); return this; } @@ -77,7 +79,7 @@ namespace MLEM.Input { /// /// This keybind, for chaining public Keybind Clear() { - this.combinations = Array.Empty(); + this.combinations = Keybind.EmptyCombinations; return this; } @@ -349,7 +351,7 @@ namespace MLEM.Input { /// The function to use for determining the display name of a . If this is null, the generic input's default method is used. /// A human-readable string representing this combination public string ToString(string joiner, Func inputName = null) { - return string.Join(joiner, this.Modifiers.Append(this.Key).Select(i => inputName?.Invoke(i) ?? i.ToString())); + return string.Join(joiner, this.Modifiers.Concat(Enumerable.Repeat(this.Key, 1)).Select(i => inputName?.Invoke(i) ?? i.ToString())); } /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. diff --git a/MLEM/MLEM.FNA.csproj b/MLEM/MLEM.FNA.csproj index 4f4ccdd..75b89a2 100644 --- a/MLEM/MLEM.FNA.csproj +++ b/MLEM/MLEM.FNA.csproj @@ -1,10 +1,11 @@  - netstandard2.0;net6.0 + net452;netstandard2.0;net6.0 true true MLEM $(DefineConstants);FNA + MSB3270 @@ -20,9 +21,11 @@ - + all + + diff --git a/MLEM/MLEM.csproj b/MLEM/MLEM.csproj index ac55ac3..ac0df57 100644 --- a/MLEM/MLEM.csproj +++ b/MLEM/MLEM.csproj @@ -1,6 +1,6 @@  - netstandard2.0;net6.0 + net452;netstandard2.0;net6.0 true true @@ -21,6 +21,8 @@ all + + diff --git a/MLEM/Misc/GenericDataHolder.cs b/MLEM/Misc/GenericDataHolder.cs index 14decf2..b224b55 100644 --- a/MLEM/Misc/GenericDataHolder.cs +++ b/MLEM/Misc/GenericDataHolder.cs @@ -11,6 +11,8 @@ namespace MLEM.Misc { [DataContract] public class GenericDataHolder : IGenericDataHolder { + private static readonly string[] EmptyStrings = new string[0]; + [DataMember(EmitDefaultValue = false)] private Dictionary data; @@ -34,9 +36,9 @@ namespace MLEM.Misc { } /// - public IReadOnlyCollection GetDataKeys() { + public IEnumerable GetDataKeys() { if (this.data == null) - return Array.Empty(); + return GenericDataHolder.EmptyStrings; return this.data.Keys; } @@ -67,7 +69,7 @@ namespace MLEM.Misc { /// Returns all of the generic data that this object stores. /// /// The generic data on this object - IReadOnlyCollection GetDataKeys(); + IEnumerable GetDataKeys(); } } diff --git a/Tests/Tests.FNA.csproj b/Tests/Tests.FNA.csproj index e032b51..4f5001d 100644 --- a/Tests/Tests.FNA.csproj +++ b/Tests/Tests.FNA.csproj @@ -4,6 +4,7 @@ nunit Tests $(DefineConstants);FNA + MSB3270