Changed code to be compliant to .Net Framework 4.8.

This commit is contained in:
Harrison Deng 2020-02-29 01:53:06 -05:00
parent c5f281c5e0
commit 719ae11cb0
2 changed files with 9 additions and 5 deletions

View File

@ -40,7 +40,7 @@ namespace RecrownedGTK.Tools.CommandProcessor
string command = commandAndArguments; string command = commandAndArguments;
string[] arguments = null; string[] arguments = null;
if (commandAndArguments.Contains(' ')) if (commandAndArguments.Contains(" "))
{ {
command = command.Remove(command.IndexOf(' ')); command = command.Remove(command.IndexOf(' '));
if (!ContainsCommand(command)) throw new ArgumentException("Command not found."); if (!ContainsCommand(command)) throw new ArgumentException("Command not found.");
@ -49,7 +49,7 @@ namespace RecrownedGTK.Tools.CommandProcessor
for (int i = 0; i < argumentsSplit.Length; i++) for (int i = 0; i < argumentsSplit.Length; i++)
{ {
if (argumentsSplit[i].Contains('"') && !argumentsSplit[i].EndsWith('"')) if (argumentsSplit[i].Contains("\"") && !argumentsSplit[i].EndsWith("\""))
{ {
StringBuilder quoteBuilder = new StringBuilder(); StringBuilder quoteBuilder = new StringBuilder();
do do
@ -62,8 +62,8 @@ namespace RecrownedGTK.Tools.CommandProcessor
throw new ArgumentException("Argument is missing terminating \'\"\'"); throw new ArgumentException("Argument is missing terminating \'\"\'");
} }
} while (!argumentsSplit[i].Contains('"')); } while (!argumentsSplit[i].Contains("\""));
quoteBuilder.Append(' '); quoteBuilder.Append(" ");
quoteBuilder.Append(argumentsSplit[i]); quoteBuilder.Append(argumentsSplit[i]);
argumentsList.Add(quoteBuilder.ToString().Replace("\"", "").Trim()); argumentsList.Add(quoteBuilder.ToString().Replace("\"", "").Trim());
} }

View File

@ -86,8 +86,12 @@ namespace RecrownedGTK.Tools.TextureAtlas
masterNode.region.Height = TextureLength; masterNode.region.Height = TextureLength;
Queue<ImageHandler> imageHandlerQueue = new Queue<ImageHandler>(imageHandlers); Queue<ImageHandler> imageHandlerQueue = new Queue<ImageHandler>(imageHandlers);
ImageHandler imageHandler; ImageHandler imageHandler;
while (imageHandlerQueue.TryDequeue(out imageHandler))
while (imageHandlerQueue.Count != 0)
{ {
imageHandler = imageHandlerQueue.Dequeue();
Node activeNode = null; Node activeNode = null;
activeNode = masterNode.InsertImageHandler(imageHandler); activeNode = masterNode.InsertImageHandler(imageHandler);
if (activeNode == null) if (activeNode == null)