Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using HeuristicLab.Hive.Client.Core.ClientConsoleService.Interfaces;
|
---|
6 | using HeuristicLab.Hive.Client.Core.ConfigurationManager;
|
---|
7 | using HeuristicLab.Hive.Client.Communication;
|
---|
8 | using HeuristicLab.Hive.Client.Common;
|
---|
9 | using HeuristicLab.Hive.Contracts;
|
---|
10 | using Calendar;
|
---|
11 |
|
---|
12 | namespace HeuristicLab.Hive.Client.Core.ClientConsoleService {
|
---|
13 | public class ClientConsoleCommunicator: IClientConsoleCommunicator {
|
---|
14 | #region IClientConsoleCommunicator Members
|
---|
15 |
|
---|
16 | public StatusCommons GetStatusInfos() {
|
---|
17 | return ConfigManager.Instance.GetStatusForClientConsole();
|
---|
18 | }
|
---|
19 |
|
---|
20 | public void SetConnection(ConnectionContainer container) {
|
---|
21 | ConfigManager.Instance.SetServerIPAndPort(container);
|
---|
22 | WcfService.Instance.Connect(container.IPAdress, container.Port);
|
---|
23 | }
|
---|
24 |
|
---|
25 | public void Disconnect() {
|
---|
26 | WcfService.Instance.Disconnect();
|
---|
27 | }
|
---|
28 |
|
---|
29 | public ConnectionContainer GetCurrentConnection() {
|
---|
30 | return new ConnectionContainer { IPAdress = WcfService.Instance.ServerIP, Port = WcfService.Instance.ServerPort };
|
---|
31 | }
|
---|
32 |
|
---|
33 | public void ShutdownClient() {
|
---|
34 | MessageQueue.GetInstance().AddMessage(MessageContainer.MessageType.Shutdown);
|
---|
35 | }
|
---|
36 |
|
---|
37 | public void SetUptimeCalendar(List<Appointment> appointments) {
|
---|
38 | UptimeManager.Instance.Appointments = appointments;
|
---|
39 | }
|
---|
40 |
|
---|
41 | public List<Appointment> GetUptimeCalendar() {
|
---|
42 | return UptimeManager.Instance.Appointments;
|
---|
43 | }
|
---|
44 |
|
---|
45 | #endregion
|
---|
46 | }
|
---|
47 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.