Skip to content

Commit 0c55b86

Browse files
committed
cli added for debugging purposes
1 parent 2636471 commit 0c55b86

31 files changed

+269
-69
lines changed

AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar.AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[assembly: System.Reflection.AssemblyCompanyAttribute("AccordaGUItar")]
1515
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
1616
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
17-
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+aa2f59693ba199c1c97ede6c668daceb30f44ea4")]
17+
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2636471e9e1f62663094d03ef969c32c0883980b")]
1818
[assembly: System.Reflection.AssemblyProductAttribute("AccordaGUItar")]
1919
[assembly: System.Reflection.AssemblyTitleAttribute("AccordaGUItar")]
2020
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f2be71a1ef2589e0a0dccc1a3141779699ed6b1320df7ab8a93364a6fa80a198
1+
0c22ad80bc6595adc321c553a7548c42f5f936ce52c8e195c05145048abade5b

AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar.g.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ public partial class AccordaGUI : MahApps.Metro.Controls.MetroWindow, System.Win
7979
/// InitializeComponent
8080
/// </summary>
8181
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
82-
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "8.0.2.0")]
82+
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "8.0.3.0")]
8383
public void InitializeComponent() {
8484
if (_contentLoaded) {
8585
return;
8686
}
8787
_contentLoaded = true;
88-
System.Uri resourceLocater = new System.Uri("/AccordaGUItar;component/accordaguitar.xaml", System.UriKind.Relative);
88+
System.Uri resourceLocater = new System.Uri("/AccordaGUItar;V1.0.0.0;component/accordaguitar.xaml", System.UriKind.Relative);
8989

9090
#line 1 "..\..\..\AccordaGUItar.xaml"
9191
System.Windows.Application.LoadComponent(this, resourceLocater);
@@ -95,7 +95,7 @@ public void InitializeComponent() {
9595
}
9696

9797
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
98-
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "8.0.2.0")]
98+
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "8.0.3.0")]
9999
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
100100
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
101101
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]

AccordaGUItar/obj/Debug/net8.0-windows7.0/AccordaGUItar_MarkupCompile.cache

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AccordaGUItar
2-
2+
1.0.0.0
33

44
winexe
55
C#
@@ -12,9 +12,9 @@ TRACE;DEBUG;NET;NET8_0;NETCOREAPP
1212
C:\Users\Giacomo\source\repos\accorda\AccordaGUItar\App.xaml
1313
1-1812784380
1414

15-
6791824736
16-
218529696958
15+
8-1335952047
16+
2181090816813
1717
AccordaGUItar.xaml;
1818

19-
False
19+
True
2020

Binary file not shown.

AccordaGUItar/obj/Debug/net8.0-windows7.0/App.g.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public partial class App : System.Windows.Application {
4747
/// InitializeComponent
4848
/// </summary>
4949
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
50-
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "8.0.2.0")]
50+
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "8.0.3.0")]
5151
public void InitializeComponent() {
5252
if (_contentLoaded) {
5353
return;
@@ -59,7 +59,7 @@ public void InitializeComponent() {
5959

6060
#line default
6161
#line hidden
62-
System.Uri resourceLocater = new System.Uri("/AccordaGUItar;component/app.xaml", System.UriKind.Relative);
62+
System.Uri resourceLocater = new System.Uri("/AccordaGUItar;V1.0.0.0;component/app.xaml", System.UriKind.Relative);
6363

6464
#line 1 "..\..\..\App.xaml"
6565
System.Windows.Application.LoadComponent(this, resourceLocater);
@@ -73,7 +73,7 @@ public void InitializeComponent() {
7373
/// </summary>
7474
[System.STAThreadAttribute()]
7575
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
76-
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "8.0.2.0")]
76+
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "8.0.3.0")]
7777
public static void Main() {
7878
AccordaGUItar.App app = new AccordaGUItar.App();
7979
app.InitializeComponent();

accorda-cli/Resource1.Designer.cs

+63
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

accorda-cli/Resource1.resx

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<root>
3+
<!--
4+
Microsoft ResX Schema
5+
6+
Version 1.3
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
11+
associated with the data types.
12+
13+
Example:
14+
15+
... ado.net/XML headers & schema ...
16+
<resheader name="resmimetype">text/microsoft-resx</resheader>
17+
<resheader name="version">1.3</resheader>
18+
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19+
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20+
<data name="Name1">this is my long string</data>
21+
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22+
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23+
[base64 mime encoded serialized .NET Framework object]
24+
</data>
25+
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26+
[base64 mime encoded string representing a byte array form of the .NET Framework object]
27+
</data>
28+
29+
There are any number of "resheader" rows that contain simple
30+
name/value pairs.
31+
32+
Each data row contains a name, and value. The row also contains a
33+
type or mimetype. Type corresponds to a .NET class that support
34+
text/value conversion through the TypeConverter architecture.
35+
Classes that don't support this are serialized and stored with the
36+
mimetype set.
37+
38+
The mimetype is used for serialized objects, and tells the
39+
ResXResourceReader how to depersist the object. This is currently not
40+
extensible. For a given mimetype the value must be set accordingly:
41+
42+
Note - application/x-microsoft.net.object.binary.base64 is the format
43+
that the ResXResourceWriter will generate, however the reader can
44+
read any of the formats listed below.
45+
46+
mimetype: application/x-microsoft.net.object.binary.base64
47+
value : The object must be serialized with
48+
: System.Serialization.Formatters.Binary.BinaryFormatter
49+
: and then encoded with base64 encoding.
50+
51+
mimetype: application/x-microsoft.net.object.soap.base64
52+
value : The object must be serialized with
53+
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
54+
: and then encoded with base64 encoding.
55+
56+
mimetype: application/x-microsoft.net.object.bytearray.base64
57+
value : The object must be serialized into a byte array
58+
: using a System.ComponentModel.TypeConverter
59+
: and then encoded with base64 encoding.
60+
-->
61+
62+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63+
<xsd:element name="root" msdata:IsDataSet="true">
64+
<xsd:complexType>
65+
<xsd:choice maxOccurs="unbounded">
66+
<xsd:element name="data">
67+
<xsd:complexType>
68+
<xsd:sequence>
69+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
70+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
71+
</xsd:sequence>
72+
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
73+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
74+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
75+
</xsd:complexType>
76+
</xsd:element>
77+
<xsd:element name="resheader">
78+
<xsd:complexType>
79+
<xsd:sequence>
80+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
81+
</xsd:sequence>
82+
<xsd:attribute name="name" type="xsd:string" use="required" />
83+
</xsd:complexType>
84+
</xsd:element>
85+
</xsd:choice>
86+
</xsd:complexType>
87+
</xsd:element>
88+
</xsd:schema>
89+
<resheader name="resmimetype">
90+
<value>text/microsoft-resx</value>
91+
</resheader>
92+
<resheader name="version">
93+
<value>1.3</value>
94+
</resheader>
95+
<resheader name="reader">
96+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
97+
</resheader>
98+
<resheader name="writer">
99+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
100+
</resheader>
101+
</root>

accorda-cli/accorda-cli.cs

+39-18
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
using System;
1+
using System.Reflection;
22
using Spectre.Console;
33

4-
class Program
4+
internal class Program
55
{
6-
static void Main(string[] args)
6+
private static void Main(string[] args)
77
{
88
while (true)
99
{
1010
AnsiConsole.Clear();
1111
PrintHeader();
1212
PrintMenu();
13-
var choice = PromptInput();
13+
string choice = PromptInput();
1414
ProcessChoice(choice);
1515
}
1616
}
1717

18-
static void PrintHeader()
18+
private static void PrintHeader()
1919
{
2020
AnsiConsole.WriteLine();
2121
AnsiConsole.WriteLine("[bold underline green]Guitar Tuner[/]");
2222
AnsiConsole.WriteLine();
2323
}
2424

25-
static void PrintMenu()
25+
private static void PrintMenu()
2626
{
2727
AnsiConsole.WriteLine("[yellow]Select an option:[/]");
28-
AnsiConsole.WriteLine(" [yellow]1[/] - Tune Guitar");
29-
AnsiConsole.WriteLine(" [yellow]2[/] - Read License");
30-
AnsiConsole.WriteLine(" [yellow]3[/] - Exit");
28+
AnsiConsole.WriteLine("[yellow]1[/] - Tune Guitar");
29+
AnsiConsole.WriteLine("[yellow]2[/] - Read License");
30+
AnsiConsole.WriteLine("[yellow]3[/] - Exit");
3131
AnsiConsole.WriteLine();
3232
}
3333

34-
static string PromptInput()
34+
private static string PromptInput()
3535
{
3636
return AnsiConsole.Prompt(new TextPrompt<string>("Enter your choice:")
3737
.InvalidChoiceMessage("[red]Invalid choice[/]")
3838
.DefaultValue("1"));
3939
}
4040

41-
static void ProcessChoice(string choice)
41+
private static void ProcessChoice(string choice)
4242
{
4343
switch (choice.ToLower())
4444
{
@@ -57,7 +57,7 @@ static void ProcessChoice(string choice)
5757
}
5858
}
5959

60-
static void TuneGuitar()
60+
private static void TuneGuitar()
6161
{
6262
// Implementare la logica per l'accordatura della chitarra
6363
AnsiConsole.WriteLine("[yellow]Tuning guitar...[/]");
@@ -66,19 +66,40 @@ static void TuneGuitar()
6666
AnsiConsole.WriteLine("[green]Guitar tuned successfully![/]");
6767
AnsiConsole.WriteLine();
6868
AnsiConsole.WriteLine("[yellow]Press any key to continue...[/]");
69-
Console.ReadKey();
69+
_ = Console.ReadKey();
7070
}
7171

72-
static void ReadLicense()
72+
private static void ReadLicense()
7373
{
74+
string resourceName = "LICENSE"; // Sostituisci con il nome corretto
75+
76+
// Ottieni l'assembly corrente
77+
var assembly = Assembly.GetExecutingAssembly();
78+
79+
// Leggi il contenuto del file di licenza
80+
string licenseText = string.Empty;
81+
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
82+
{
83+
if (stream == null)
84+
{
85+
Console.WriteLine("File di licenza non trovato.");
86+
return;
87+
}
88+
89+
using (StreamReader reader = new StreamReader(stream))
90+
{
91+
licenseText = reader.ReadToEnd();
92+
}
93+
}
94+
95+
7496
// Leggere il testo della licenza dal file o da una risorsa
75-
string licenseText = "License text goes here...";
7697
AnsiConsole.WriteLine();
77-
AnsiConsole.WriteLine("[bold underline]License[/]");
98+
AnsiConsole.WriteLine("[bold underline]Licenza[/]");
7899
AnsiConsole.WriteLine(licenseText);
79100
AnsiConsole.WriteLine();
80-
AnsiConsole.WriteLine("[yellow]Press any key to continue...[/]");
81-
Console.ReadKey();
101+
AnsiConsole.WriteLine("[yellow]Premere per chiudere la licenza.[/]");
102+
_ = Console.ReadKey();
82103
}
83104
}
84105

0 commit comments

Comments
 (0)