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 |
|
---|
9 | namespace HeuristicLab.Hive.Client.Core.ClientConsoleService {
|
---|
10 | public class ClientConsoleCommunicator: IClientConsoleCommunicator {
|
---|
11 | #region IClientConsoleCommunicator Members
|
---|
12 |
|
---|
13 | public StatusCommons GetStatusInfos() {
|
---|
14 | lock (Core.Locker) {
|
---|
15 | return ConfigManager.Instance.GetStatusForClientConsole();
|
---|
16 | }
|
---|
17 | }
|
---|
18 |
|
---|
19 | public ConnectionContainer GetConnection() {
|
---|
20 | return new ConnectionContainer{IPAdress = WcfService.Instance.ServerIP, Port = WcfService.Instance.ServerPort } ;
|
---|
21 | }
|
---|
22 |
|
---|
23 | public void SetConnection(ConnectionContainer container) {
|
---|
24 | ConfigManager.Instance.SetServerIPAndPort(container);
|
---|
25 | WcfService.Instance.Connect(container.IPAdress, container.Port);
|
---|
26 | }
|
---|
27 |
|
---|
28 | public void Disconnect() {
|
---|
29 | WcfService.Instance.Disconnect();
|
---|
30 | }
|
---|
31 |
|
---|
32 | public ConnectionContainer GetCurrentConnection() {
|
---|
33 | return new ConnectionContainer { IPAdress = WcfService.Instance.ServerIP, Port = WcfService.Instance.ServerPort };
|
---|
34 | }
|
---|
35 |
|
---|
36 | #endregion
|
---|
37 | }
|
---|
38 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.