Code restyling.

This commit is contained in:
2020-02-29 18:03:35 +00:00
parent 4ea327f0c6
commit f7e173710e
855 changed files with 43605 additions and 38045 deletions

View File

@@ -29,6 +29,7 @@
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System;
using System.Reflection;
using System.Threading.Tasks;
@@ -41,12 +42,12 @@ using Microsoft.EntityFrameworkCore;
namespace Aaru.XamMac
{
class Program
internal class Program
{
internal static bool Verbose;
internal static bool Debug;
internal static string AssemblyCopyright;
internal static string AssemblyTitle;
internal static bool Verbose;
internal static bool Debug;
internal static string AssemblyCopyright;
internal static string AssemblyTitle;
internal static AssemblyInformationalVersionAttribute AssemblyVersion;
[STAThread]
@@ -54,38 +55,47 @@ namespace Aaru.XamMac
{
object[] attributes = typeof(Program).Assembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
AssemblyTitle = ((AssemblyTitleAttribute)attributes[0]).Title;
attributes = typeof(Program).Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
attributes = typeof(Program).Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
AssemblyVersion =
Attribute.GetCustomAttribute(typeof(Program).Assembly, typeof(AssemblyInformationalVersionAttribute)) as
AssemblyInformationalVersionAttribute;
AssemblyCopyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
Settings.Settings.LoadSettings();
DicContext ctx = DicContext.Create(Settings.Settings.LocalDbPath);
var ctx = AaruContext.Create(Settings.Settings.LocalDbPath);
ctx.Database.Migrate();
ctx.SaveChanges();
// TODO: Update database on GUI
DicContext mctx = DicContext.Create(Settings.Settings.MasterDbPath);
var mctx = AaruContext.Create(Settings.Settings.MasterDbPath);
mctx.Database.Migrate();
mctx.SaveChanges();
Statistics.LoadStats();
if (Settings.Settings.Current.Stats != null && Settings.Settings.Current.Stats.ShareStats)
Task.Run(() => { Statistics.SubmitStats(); });
foreach (string arg in args)
switch (arg.ToLowerInvariant())
if(Settings.Settings.Current.Stats != null &&
Settings.Settings.Current.Stats.ShareStats)
Task.Run(() =>
{
Statistics.SubmitStats();
});
foreach(string arg in args)
switch(arg.ToLowerInvariant())
{
case "-v":
case "--verbose":
Verbose = true;
break;
case "-d":
case "--debug":
Debug = true;
break;
}