-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml.cs
62 lines (58 loc) · 2.11 KB
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.Configuration;
using System.Windows;
using System.Windows.Media;
using Elysium;
using RCS.K2.NFLN.Helpers;
using RCS.K2.NFLN.Models;
using RCS.K2.NFLN.Properties;
using RCS.K2.NFLN.Services;
using RCS.K2.NFLN.UI;
namespace RCS.K2.NFLN
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App
{
public VizEngine VizPgm { get; set; }
public Config TheConfig { get; set; }
public SelectedUser User { get; set; }
public SignInWindow SignInWindow { get; set; }
//private MainWindow mainWindow { get; set; }
private FeedbackCoordinator _feedback;
private void StartupHandler(object sender, StartupEventArgs e)
{
this.Apply(Theme.Dark, AccentBrushes.Sky, Brushes.White);
PrepareForTheShow();
}
/// <summary>
/// It creates all the necessary object for the model to be loaded
/// </summary>
private void PrepareForTheShow()
{
SettingsHelper.InitializeSettings();
TheConfig = new Config(ConfigurationManager.AppSettings["VizIp"],
Convert.ToInt32(ConfigurationManager.AppSettings["VizPort"]),
"",
Convert.ToInt32(ConfigurationManager.AppSettings["FeedbackPort"]));
VizPgm = new VizEngine(TheConfig.EngineIp, TheConfig.EnginePort);
User = new SelectedUser();
CurrentSession.Config = TheConfig;
CurrentSession.VizEngine = VizPgm;
CurrentSession.User = User;
CurrentSession.Player = new ClipPlayerServiceAgent();
_feedback = new FeedbackCoordinator(TheConfig);
SignInWindow = new SignInWindow();
//mainWindow = new MainWindow();
}
public void Application_Exit(object sender, ExitEventArgs e)
{
CurrentSession.Player.EndServerSession();
_feedback.StopListening();
Settings.Default.Save();
VizPgm.DisconnectFromEngine();
Console.WriteLine(@"ENGINE DISCONNECTED");
}
}
}