mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-08 20:34:05 +02:00
Add App to TweetLib.Core
This commit is contained in:
parent
6c65d0771d
commit
da706d7ed8
@ -52,12 +52,13 @@ static class Program{
|
||||
public static ConfigManager Config { get; }
|
||||
|
||||
static Program(){
|
||||
Lib.Initialize();
|
||||
|
||||
Reporter = new Reporter(ErrorLogFilePath);
|
||||
Reporter.SetupUnhandledExceptionHandler("TweetDuck Has Failed :(");
|
||||
|
||||
Config = new ConfigManager();
|
||||
|
||||
Lib.Initialize(new App.Builder{
|
||||
});
|
||||
}
|
||||
|
||||
[STAThread]
|
||||
|
25
lib/TweetLib.Core/App.cs
Normal file
25
lib/TweetLib.Core/App.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using TweetLib.Core.Application;
|
||||
|
||||
namespace TweetLib.Core{
|
||||
public sealed class App{
|
||||
|
||||
// Builder
|
||||
|
||||
public sealed class Builder{
|
||||
|
||||
// Validation
|
||||
|
||||
internal void Initialize(){
|
||||
}
|
||||
|
||||
private T Validate<T>(T obj, string name){
|
||||
if (obj == null){
|
||||
throw new InvalidOperationException("Missing property " + name + " on the provided App.");
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -8,7 +8,7 @@ public static class Lib{
|
||||
|
||||
public static CultureInfo Culture { get; private set; }
|
||||
|
||||
public static void Initialize(){
|
||||
public static void Initialize(App.Builder app){
|
||||
Culture = CultureInfo.CurrentCulture;
|
||||
|
||||
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
|
||||
@ -17,6 +17,8 @@ public static void Initialize(){
|
||||
#if DEBUG
|
||||
CultureInfo.DefaultThreadCurrentUICulture = Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-us"); // force english exceptions
|
||||
#endif
|
||||
|
||||
app.Initialize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user