Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3574. Enabling trim mode breaks program at runtime (v2 only) #3582

Merged
merged 32 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4733685
Add SelfContained project.
BDisp Jul 4, 2024
8523657
Fix WriteConsole having a wrong parameter type.
BDisp Jul 4, 2024
5ca07e1
Add SourceGenerationContext and fix Serialize/Deserialize.
BDisp Jul 4, 2024
62b151e
Add SourceGenerationContext.
BDisp Jul 4, 2024
7647de7
Fix compile warnings.
BDisp Jul 4, 2024
b704b30
Using JsonStringEnumConverter<T> for AOT compatible.
BDisp Jul 4, 2024
b4f83bc
Update project and solution.
BDisp Jul 4, 2024
e8aad38
Some adjustments and add comment.
BDisp Jul 5, 2024
594921b
Fixes Example.
BDisp Jul 5, 2024
edba130
With Debug use the csproj and with Release use the latest nuget package.
BDisp Jul 6, 2024
57cb98a
Add separated publish profiles for Debug and Release.
BDisp Jul 6, 2024
91cbb2b
Add README file to the SelContained project.
BDisp Jul 6, 2024
f72f484
Add link to the ./SelfContained/README.md file.
BDisp Jul 6, 2024
d944528
Add link to the ./CommunityToolkitExample/README.md file.
BDisp Jul 6, 2024
abf11bf
Fixed brooked links.
BDisp Jul 6, 2024
efcd6bc
Fix FSharpExample link.
BDisp Jul 6, 2024
ced6a89
Fixing more links.
BDisp Jul 6, 2024
d31f798
Merge branch 'v2_develop' into v2_3574_self-contained-single-file
BDisp Jul 7, 2024
42ee95b
Fix FSharpExample using the simple example.
BDisp Jul 7, 2024
7a0374d
Merge branch 'v2_develop' into v2_3574_self-contained-single-file
BDisp Jul 7, 2024
3fcd11b
Merge branch 'v2_develop' into v2_3574_self-contained-single-file
BDisp Jul 7, 2024
b43abfd
Merge branch 'v2_develop' into v2_3574_self-contained-single-file
BDisp Jul 7, 2024
e8508cf
Merge branch 'v2_develop' into v2_3574_self-contained-single-file
BDisp Jul 7, 2024
c0d53d8
Merge branch 'v2_develop' into v2_3574_self-contained-single-file
BDisp Jul 7, 2024
267da65
Merge branch 'v2_develop' into v2_3574_self-contained-single-file
BDisp Jul 7, 2024
f974861
Resolving merge conflicts.
BDisp Jul 11, 2024
d8d491a
Resolving merge conflicts.
BDisp Jul 11, 2024
a22f661
Add version ranges.
BDisp Jul 11, 2024
6cc4d54
Fix version ranges.
BDisp Jul 11, 2024
bbce488
Remove JETBRAINS_ANNOTATIONS from project.
BDisp Jul 11, 2024
3b19567
Merge branch 'v2_develop' into v2_3574_self-contained-single-file
BDisp Jul 12, 2024
abdde3a
Remove Terminal.Gui.Analyzers.Internal project from the Terminal.Gui …
BDisp Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Directory.Build.props

This file was deleted.

5 changes: 0 additions & 5 deletions Directory.Build.targets

This file was deleted.

41 changes: 21 additions & 20 deletions Example/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
using System;
using Terminal.Gui;

var app = Application.Run<ExampleWindow> ();

Console.WriteLine ($"Username: {app.UserNameText.Text}");

app.Dispose ();
Application.Run<ExampleWindow> ().Dispose ();

// Before the application exits, reset Terminal.Gui for clean shutdown
Application.Shutdown ();

// To see this output on the screen it must be done after shutdown,
// which restores the previous screen.
Console.WriteLine ($@"Username: {ExampleWindow.UserName}");

// Defines a top-level window with border and title
public class ExampleWindow : Window
{
public TextField UserNameText;
public static string UserName;

public ExampleWindow ()
{
Expand All @@ -27,7 +27,7 @@ public ExampleWindow ()
// Create input components and labels
var usernameLabel = new Label { Text = "Username:" };

UserNameText = new TextField
var userNameText = new TextField
{
// Position text field adjacent to the label
X = Pos.Right (usernameLabel) + 1,
Expand All @@ -46,7 +46,7 @@ public ExampleWindow ()
Secret = true,

// align with the text box above
X = Pos.Left (UserNameText),
X = Pos.Left (userNameText),
Y = Pos.Top (passwordLabel),
Width = Dim.Fill ()
};
Expand All @@ -64,19 +64,20 @@ public ExampleWindow ()

// When login button is clicked display a message popup
btnLogin.Accept += (s, e) =>
{
if (UserNameText.Text == "admin" && passwordText.Text == "password")
{
MessageBox.Query ("Logging In", "Login Successful", "Ok");
Application.RequestStop ();
}
else
{
MessageBox.ErrorQuery ("Logging In", "Incorrect username or password", "Ok");
}
};
{
if (userNameText.Text == "admin" && passwordText.Text == "password")
{
MessageBox.Query ("Logging In", "Login Successful", "Ok");
UserName = userNameText.Text;
Application.RequestStop ();
}
else
{
MessageBox.ErrorQuery ("Logging In", "Incorrect username or password", "Ok");
}
};

// Add the views to the Window
Add (usernameLabel, UserNameText, passwordLabel, passwordText, btnLogin);
Add (usernameLabel, userNameText, passwordLabel, passwordText, btnLogin);
}
}
3 changes: 3 additions & 0 deletions FSharpExample/FSharpExample.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@
<ItemGroup>
<ProjectReference Include="..\Terminal.Gui\Terminal.Gui.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="8.0.300" />
</ItemGroup>
</Project>
Loading
Loading