Skip to content

Commit

Permalink
Implementaciones para la 0.9.5
Browse files Browse the repository at this point in the history
- Se agregan los timers y opciones para la funcionalidad de recarga de datos en un tiempo determinado.
- Soporte para idioma inglés; se agregan las variables correspondientes y se habilita la localización en todos los forms.
- Nuevo controlador de excepciones no controladas, derivado de otros de mis desarrollos.
- Versión y año actualizados en la información de ensamblado.
- Arreglos varios en el diseño.
  • Loading branch information
elstef41 committed Jan 24, 2024
1 parent b29bd3d commit 6b0b6df
Show file tree
Hide file tree
Showing 17 changed files with 15,365 additions and 7,032 deletions.
58 changes: 55 additions & 3 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows.Forms;
using System.Globalization;
using System.Resources;

namespace syinfo
{
Expand All @@ -10,11 +13,60 @@ static class Program
/// Punto de entrada principal para la aplicación.
/// </summary>
[STAThread]
// Detección de compatiblidad
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
ResourceManager rm = new ResourceManager(typeof(syinfo));
string version_so = System.Environment.OSVersion.Version.Major.ToString() + "." + System.Environment.OSVersion.Version.Minor.ToString();
if (System.Environment.OSVersion.Version.Major <= 5)
{
MessageBox.Show(rm.GetString("s_error_no_compatible"), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
}
else
{
Application.EnableVisualStyles();
Application.ThreadException += new ThreadExceptionEventHandler(UIThreadException);
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new syinfo());
}

}

// Controlador de excepciones casero
private static void UIThreadException(object sender, ThreadExceptionEventArgs e)
{
try
{
excpt exception = new excpt(e.Exception.ToString());
exception.TopMost = true;
exception.ShowDialog();
Application.Exit();
}
catch
{
try
{
excpt exception = new excpt(e.Exception.ToString());
exception.TopMost = true;
exception.ShowDialog();
Application.Exit();
}
finally
{
Application.Exit();
}
}
Application.Exit();
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
excpt exception = new excpt(e.ExceptionObject.ToString());
exception.TopMost = true;
exception.ShowDialog();
Application.Exit();
}
}
}
8 changes: 4 additions & 4 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
[assembly: AssemblyTitle("syinfo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("elstef41")]
[assembly: AssemblyProduct("elstef41 Syinfo")]
[assembly: AssemblyCopyright("2022 elstef41")]
[assembly: AssemblyCopyright("2022-2024 elstef41")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// Puede especificar todos los valores o establecer como predeterminados los números de versión de compilación y de revisión
// mediante el asterisco ('*'), como se muestra a continuación:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.0.0")]
[assembly: AssemblyFileVersion("0.9.0.0")]
[assembly: AssemblyVersion("0.9.5.0")]
[assembly: AssemblyFileVersion("0.9.5.0")]
20 changes: 13 additions & 7 deletions Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
using System.Windows.Forms;
using System.Text;
using System.Resources;
using System.Globalization;

namespace syinfo
{
class Strings
class strings
{
public static string sy_repositorio = "https://github.com/elstef41/syinfo";
public static ResourceManager rm = new ResourceManager(typeof(syinfo));
public string obtenerVersion()
{
string s = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major.ToString() + "." + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString() + "." + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build.ToString();
Expand All @@ -16,29 +19,32 @@ public string obtenerVersion()

public string ver()
{
string osver = System.Environment.OSVersion.Version.Major.ToString() + "." + System.Environment.OSVersion.Version.Minor.ToString();
string osver = System.Environment.OSVersion.Version.Major.ToString() + "." + System.Environment.OSVersion.Version.Minor.ToString() + "." + System.Environment.OSVersion.Version.Build.ToString();
switch (osver)
{
case "5.1":
case "6.0":
MessageBox.Show("Syinfo requiere Windows 7 o posterior.", "elstef41 Syinfo", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(rm.GetString("s_error_no_compatible"), "elstef41 Syinfo", MessageBoxButtons.OK, MessageBoxIcon.Error);
return "";
case "6.1":
return "Windows 7";
case "6.2":
return "Windows 8, 8.1, 10 u 11";
return "Windows 8.x/10/11";
case "6.3":
case "6.4":
case "6.5":
case "6.6":
case "6.7":
case "6.8":
case "10.0":
return "Windows 10";
default:
return osver;
}
}

public int minAMs(int i)
{
i = i * 60000;
return i;
}

}
}
98 changes: 15 additions & 83 deletions acercade.Designer.cs

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

2 changes: 1 addition & 1 deletion acercade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace syinfo
{
public partial class acercade : Form
{
Strings st = new Strings();
strings st = new strings();
public acercade()
{
InitializeComponent();
Expand Down
Loading

0 comments on commit 6b0b6df

Please sign in to comment.