-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
608 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace BuilderTests | ||
{ | ||
using FluentAssertions; | ||
using InnoSetup.ScriptBuilder; | ||
using Xunit; | ||
|
||
public class CodeTests | ||
{ | ||
[Fact] | ||
public void Test() | ||
{ | ||
var iss = BuilderUtils.CreateBuilder(builder => builder.Code | ||
.CreateEntry("code1") | ||
.CreateEntry("code2")) | ||
.ToString(); | ||
iss.Should().Be("\r\n[Code]\r\ncode1\r\ncode2\r\n"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace InnoSetup.ScriptBuilder | ||
{ | ||
using System.IO; | ||
using System.Text; | ||
|
||
public class CodeBuilder : IBuilder | ||
{ | ||
private readonly StringBuilder _data = new(); | ||
|
||
public string SectionName => "Code"; | ||
|
||
public CodeBuilder CreateEntry(string script) | ||
{ | ||
_data.AppendLine(script); | ||
return this; | ||
} | ||
|
||
public void Write(TextWriter writer) | ||
{ | ||
if (_data.Length == 0) | ||
return; | ||
writer.WriteLine($"\r\n[{SectionName}]"); | ||
writer.Write(_data); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
source/InnoSetup.ScriptBuilder/Model/SetupSection/Architectures.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace InnoSetup.ScriptBuilder.Model.SetupSection | ||
{ | ||
using System; | ||
|
||
[Flags] | ||
public enum Architectures | ||
{ | ||
X86 = 1, | ||
X64 = 1 << 1, | ||
Arm64 = 1 << 2, | ||
Ia64 = 1 << 3, | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
source/InnoSetup.ScriptBuilder/Model/SetupSection/ArchitecturesInstallIn64BitMode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace InnoSetup.ScriptBuilder.Model.SetupSection | ||
{ | ||
using System; | ||
|
||
[Flags] | ||
public enum ArchitecturesInstallIn64BitMode | ||
{ | ||
X64 = 1 << 1, | ||
Arm64 = 1 << 2, | ||
Ia64 = 1 << 3, | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
source/InnoSetup.ScriptBuilder/Model/SetupSection/BackColorDirection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace InnoSetup.ScriptBuilder.Model.SetupSection | ||
{ | ||
public enum BackColorDirection | ||
{ | ||
TopToBottom, | ||
LeftToRight | ||
} | ||
} |
Oops, something went wrong.