Skip to content

Commit

Permalink
Merge pull request #59 from IronyProject/roman_fwk_upgrade
Browse files Browse the repository at this point in the history
Upgrading to .net 8;
  • Loading branch information
rivantsov authored Jan 8, 2024
2 parents b8330ef + 95c7824 commit 106ffe4
Show file tree
Hide file tree
Showing 48 changed files with 2,724 additions and 4,067 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.bak
*.orig
*.nupkg
*.snupkg
/**/bin
/**/obj
/.vs
Expand Down
22 changes: 22 additions & 0 deletions Common.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project>
<PropertyGroup>
<Version>1.5.0</Version>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
<FileVersion>1.5.0.0</FileVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>

<AssemblyName>$(MSBuildProjectName)</AssemblyName>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<LangVersion>10.0</LangVersion>
<NoWarn>1701;1702;1591</NoWarn>
<PackageProjectUrl>https://github.com/IronyProject/Irony</PackageProjectUrl>
<RepositoryUrl>https://github.com/IronyProject/Irony</RepositoryUrl>
<Copyright>Irony Project</Copyright>
<Authors>Roman Ivantsov</Authors>

<RunAnalyzersDuringLiveAnalysis>False</RunAnalyzersDuringLiveAnalysis>
<RunAnalyzersDuringBuild>False</RunAnalyzersDuringBuild>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>

</PropertyGroup>
</Project>
21 changes: 17 additions & 4 deletions Irony.GrammarExplorer/030.Irony.GrammarExplorer.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<RootNamespace>Irony.GrammarExplorer</RootNamespace>
<AssemblyName>Irony.GrammarExplorer</AssemblyName>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;CA1416</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>1701;1702;CA1416</NoWarn>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Irony.WinForms\035.Irony.WinForms.csproj" />
<ProjectReference Include="..\Irony\010.Irony.csproj" />
<ProjectReference Include="..\Irony.Interpreter\015.Irony.Interpreter.csproj" />
<ProjectReference Include="..\Irony.Samples\020.Irony.Samples.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Windows.Forms" />
<Compile Update="ConsoleTextBox.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Update="fmShowException.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup>

</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions Irony.GrammarExplorer/ConsoleTextBox.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Irony.Interpreter;
using Irony.Parsing;

namespace Irony.GrammarExplorer {

/// <summary>
/// TextBox with for console emulation.
/// Implements <see cref="IConsoleAdapter"/> interface.
/// </summary>
/// <remarks><see cref="IConsoleAdapter"/> implementation is thread-safe.</remarks>
[ToolboxItem(true)]
public partial class ConsoleTextBox : TextBox, IConsoleAdapter {
private bool _canceled;

/// <summary>
/// Initializes a new instance of the <see cref="ConsoleTextBox" /> class.
/// </summary>
public ConsoleTextBox() {
InitializeComponent();
}


protected override void OnHandleDestroyed(EventArgs e) {
base.OnHandleDestroyed(e);
Canceled = true;
}

[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool Canceled {
get { return _canceled; }
set {
_canceled = value;
}
}

public void Write(string text) {
this.Text += Environment.NewLine + text;
}

public void WriteLine(string text) {
Write(text + Environment.NewLine);
}

public void SetTextStyle(ConsoleTextStyle style) {
}

public int Read() {
throw new NotSupportedException();
}

public string ReadLine() {
if (!InvokeRequired) {
Focus();
return Console.ReadLine();
}
return Invoke(new Func<string>(Console.ReadLine)) as string;
}

public void SetTitle(string title) {
throw new NotSupportedException();
}

public string GetOutput() {
return Text;
}
}
}
Loading

0 comments on commit 106ffe4

Please sign in to comment.