mirror of
https://github.com/ZuneDev/ZuneUIXTools.git
synced 2026-07-27 13:11:59 -07:00
Add if-elseif-else sample with multiple conditions
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
using Microsoft.Iris;
|
||||
using Microsoft.Iris.DecompXml;
|
||||
using Microsoft.Iris.Markup;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UIX.Test.Fixtures;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
@@ -22,10 +17,12 @@ public class DecompileControlFlow
|
||||
markupSystemFixture.SetupDebug(output);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task IfElseIfElse()
|
||||
[Theory]
|
||||
[InlineData("cfa_if-elseif-else01")]
|
||||
[InlineData("cfa_if-elseif-else02")]
|
||||
public async Task IfElseIfElse(string fileNameWithoutExtension)
|
||||
{
|
||||
using TempFile uixFile = new($"cfa_if-elseif-else.uix", ".uix");
|
||||
using TempFile uixFile = new($"{fileNameWithoutExtension}.uix", ".uix");
|
||||
await uixFile.InitAsync();
|
||||
|
||||
var uibPathEx = Path.ChangeExtension(uixFile.Path, ".uib");
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<UIX xmlns="http://schemas.microsoft.com/2007/uix"
|
||||
xmlns:iris="assembly://UIX/Microsoft.Iris">
|
||||
<UI Name="Default">
|
||||
<Locals>
|
||||
<iris:Command Name="SelectCommand"/>
|
||||
</Locals>
|
||||
<Content>
|
||||
<Text Color="Red">
|
||||
<Content>Howdy from Microsoft.Iris!</Content>
|
||||
</Text>
|
||||
</Content>
|
||||
|
||||
<Scripts>
|
||||
<Script>
|
||||
int x = 5;
|
||||
|
||||
if (x < 10 || x == 20)
|
||||
{
|
||||
x = x + 1;
|
||||
}
|
||||
else if (x > 50)
|
||||
{
|
||||
x = x + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = x + 3;
|
||||
}
|
||||
</Script>
|
||||
</Scripts>
|
||||
</UI>
|
||||
</UIX>
|
||||
Generated
+12
-2
@@ -63,9 +63,19 @@ namespace UIX.Test {
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] cfa_if_elseif_else_uix {
|
||||
internal static byte[] cfa_if_elseif_else01_uix {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("cfa_if-elseif-else.uix", resourceCulture);
|
||||
object obj = ResourceManager.GetObject("cfa_if-elseif-else01.uix", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] cfa_if_elseif_else02_uix {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("cfa_if-elseif-else02.uix", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,8 +118,11 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="cfa_if-elseif-else.uix" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\cfa_if-elseif-else.uix;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<data name="cfa_if-elseif-else01.uix" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\cfa_if-elseif-else01.uix;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="cfa_if-elseif-else02.uix" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\cfa_if-elseif-else02.uix;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="testA.uix" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>Resources\testA.uix;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
|
||||
Reference in New Issue
Block a user