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[] arguments = null;
if (commandAndArguments.Contains(' '))
if (commandAndArguments.Contains(" "))
{
command = command.Remove(command.IndexOf(' '));
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++)
{
if (argumentsSplit[i].Contains('"') && !argumentsSplit[i].EndsWith('"'))
if (argumentsSplit[i].Contains("\"") && !argumentsSplit[i].EndsWith("\""))
{
StringBuilder quoteBuilder = new StringBuilder();
do
@ -62,8 +62,8 @@ namespace RecrownedGTK.Tools.CommandProcessor
throw new ArgumentException("Argument is missing terminating \'\"\'");
}
} while (!argumentsSplit[i].Contains('"'));
quoteBuilder.Append(' ');
} while (!argumentsSplit[i].Contains("\""));
quoteBuilder.Append(" ");
quoteBuilder.Append(argumentsSplit[i]);
argumentsList.Add(quoteBuilder.ToString().Replace("\"", "").Trim());
}

View File

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