Skip to content

Commit

Permalink
OKEGui/OKEGui/Gui/WizardWindow.xaml.cs: do not make assumption on the…
Browse files Browse the repository at this point in the history
… relative order of various #OKE tags

For example, it's perfectly reasonable to have `#OKE:DEBUG` before `#OKE:INPUTFILE`.

Signed-off-by: akarin <[email protected]>
  • Loading branch information
AkarinVS committed Dec 25, 2021
1 parent 3d42759 commit 52b2c32
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions OKEGui/OKEGui/Gui/WizardWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,28 +185,29 @@ private void WizardFinish(object sender, RoutedEventArgs e)
vsScript = dirTag[0] + dirTag[1] + "r\"" + projectDir + "\"" + dirTag[3];
}

string[] inputTemplate = Constants.inputRegex.Split(vsScript);
string updatedVsScript = vsScript;

// 处理MEMORY标签
if(Constants.memoryRegex.IsMatch(vsScript))
if(Constants.memoryRegex.IsMatch(updatedVsScript))
{
string[] memoryTag = Constants.memoryRegex.Split(inputTemplate[0]);
inputTemplate[0] = memoryTag[0] + memoryTag[1] + eachFreeMemory.ToString() + memoryTag[3];
string[] memoryTag = Constants.memoryRegex.Split(updatedVsScript);
updatedVsScript = memoryTag[0] + memoryTag[1] + eachFreeMemory.ToString() + memoryTag[3];
}

// 处理DEBUG标签
if (Constants.debugRegex.IsMatch(vsScript))
if (Constants.debugRegex.IsMatch(updatedVsScript))
{
string[] debugTag = Constants.debugRegex.Split(inputTemplate[3]);
string[] debugTag = Constants.debugRegex.Split(updatedVsScript);
if (debugTag.Length < 4)
{
// error
System.Windows.MessageBox.Show("Debug标签语法错误!", "新建任务向导", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
inputTemplate[3] = debugTag[0] + debugTag[1] + "None" + debugTag[3];
updatedVsScript = debugTag[0] + debugTag[1] + "None" + debugTag[3];
}


string[] inputTemplate = Constants.inputRegex.Split(updatedVsScript);

// 新建任务
// 1、清理残留文件
Expand Down

0 comments on commit 52b2c32

Please sign in to comment.