From ccfde19d2d0b53901bb3caf161e907b782e1671c Mon Sep 17 00:00:00 2001 From: PsychoMark Date: Tue, 12 Jul 2016 16:57:24 +0200 Subject: [PATCH 1/2] Changed Model namespace to Connection, moved bits out to Infrastructure Added Mock connection Fixed AutoScroll failing with high rate message flow --- App.xaml.cs | 7 ++- {Model => Connection}/ConnectionInfo.cs | 2 +- {Model => Connection}/IConnection.cs | 2 +- {Model => Connection}/IConnectionFactory.cs | 2 +- .../IConnectionInfoBuilder.cs | 2 +- {Model => Connection}/MessageInfo.cs | 2 +- Connection/MockConnection.cs | 50 +++++++++++++++++++ Connection/MockConnectionFactory.cs | 17 +++++++ Connection/MockConnectionInfoBuilder.cs | 10 ++++ .../RabbitMQClientConnection.cs | 2 +- .../RabbitMQClientConnectionFactory.cs | 2 +- {Model => Connection}/RabbitMQProperties.cs | 2 +- Infrastructure/ListBoxAutoScroll.cs | 2 +- .../MessageBodyRenderer.cs | 2 +- {Model => Infrastructure}/UserSettings.cs | 2 +- PettingZoo.csproj | 23 +++++---- View/ConnectionWindow.xaml.cs | 3 +- ViewModel/ConnectionViewModel.cs | 2 +- ViewModel/MainViewModel.cs | 8 +-- 19 files changed, 114 insertions(+), 28 deletions(-) rename {Model => Connection}/ConnectionInfo.cs (91%) rename {Model => Connection}/IConnection.cs (96%) rename {Model => Connection}/IConnectionFactory.cs (78%) rename {Model => Connection}/IConnectionInfoBuilder.cs (72%) rename {Model => Connection}/MessageInfo.cs (95%) create mode 100644 Connection/MockConnection.cs create mode 100644 Connection/MockConnectionFactory.cs create mode 100644 Connection/MockConnectionInfoBuilder.cs rename {Model => Connection}/RabbitMQClientConnection.cs (99%) rename {Model => Connection}/RabbitMQClientConnectionFactory.cs (87%) rename {Model => Connection}/RabbitMQProperties.cs (95%) rename {Model => Infrastructure}/MessageBodyRenderer.cs (96%) rename {Model => Infrastructure}/UserSettings.cs (97%) diff --git a/App.xaml.cs b/App.xaml.cs index 4089151..fad383f 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -5,7 +5,8 @@ using System.Reflection; using System.Windows; using System.Windows.Markup; using Newtonsoft.Json; -using PettingZoo.Model; +using PettingZoo.Connection; +using PettingZoo.Infrastructure; using PettingZoo.View; using PettingZoo.ViewModel; using SimpleInjector; @@ -34,6 +35,10 @@ namespace PettingZoo container.Register(); container.Register(); + //container.Register(() => new MockConnectionFactory(10)); + //container.Register(); + + container.Register(); container.Register(); diff --git a/Model/ConnectionInfo.cs b/Connection/ConnectionInfo.cs similarity index 91% rename from Model/ConnectionInfo.cs rename to Connection/ConnectionInfo.cs index 8ba3ba4..ba4abd2 100644 --- a/Model/ConnectionInfo.cs +++ b/Connection/ConnectionInfo.cs @@ -1,4 +1,4 @@ -namespace PettingZoo.Model +namespace PettingZoo.Connection { public class ConnectionInfo { diff --git a/Model/IConnection.cs b/Connection/IConnection.cs similarity index 96% rename from Model/IConnection.cs rename to Connection/IConnection.cs index 394a721..deabd60 100644 --- a/Model/IConnection.cs +++ b/Connection/IConnection.cs @@ -1,6 +1,6 @@ using System; -namespace PettingZoo.Model +namespace PettingZoo.Connection { public enum ConnectionStatus { diff --git a/Model/IConnectionFactory.cs b/Connection/IConnectionFactory.cs similarity index 78% rename from Model/IConnectionFactory.cs rename to Connection/IConnectionFactory.cs index e1b6bd5..adf0655 100644 --- a/Model/IConnectionFactory.cs +++ b/Connection/IConnectionFactory.cs @@ -1,4 +1,4 @@ -namespace PettingZoo.Model +namespace PettingZoo.Connection { public interface IConnectionFactory { diff --git a/Model/IConnectionInfoBuilder.cs b/Connection/IConnectionInfoBuilder.cs similarity index 72% rename from Model/IConnectionInfoBuilder.cs rename to Connection/IConnectionInfoBuilder.cs index bdd683c..3c4e13e 100644 --- a/Model/IConnectionInfoBuilder.cs +++ b/Connection/IConnectionInfoBuilder.cs @@ -1,4 +1,4 @@ -namespace PettingZoo.Model +namespace PettingZoo.Connection { public interface IConnectionInfoBuilder { diff --git a/Model/MessageInfo.cs b/Connection/MessageInfo.cs similarity index 95% rename from Model/MessageInfo.cs rename to Connection/MessageInfo.cs index 7a29779..35de946 100644 --- a/Model/MessageInfo.cs +++ b/Connection/MessageInfo.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace PettingZoo.Model +namespace PettingZoo.Connection { public class MessageInfo { diff --git a/Connection/MockConnection.cs b/Connection/MockConnection.cs new file mode 100644 index 0000000..605cdd7 --- /dev/null +++ b/Connection/MockConnection.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; + +namespace PettingZoo.Connection +{ + public class MockConnection : IConnection + { + private Timer messageTimer; + private bool connected; + + public MockConnection(int interval) + { + messageTimer = new Timer(state => + { + if (!connected) + { + StatusChanged(this, new StatusChangedEventArgs(ConnectionStatus.Connected, "Mock")); + connected = true; + } + + MessageReceived(this, new MessageReceivedEventArgs(new MessageInfo + { + Exchange = "mock", + RoutingKey = "mock.mock", + Timestamp = DateTime.Now, + Body = Encoding.UTF8.GetBytes("Mock!"), + Properties = new Dictionary + { + { "mock", "mock" } + }})); + }, null, interval, interval); + } + + + public void Dispose() + { + if (messageTimer != null) + { + messageTimer.Dispose(); + messageTimer = null; + } + } + + + public event EventHandler StatusChanged; + public event EventHandler MessageReceived; + } +} diff --git a/Connection/MockConnectionFactory.cs b/Connection/MockConnectionFactory.cs new file mode 100644 index 0000000..8e91d1f --- /dev/null +++ b/Connection/MockConnectionFactory.cs @@ -0,0 +1,17 @@ +namespace PettingZoo.Connection +{ + public class MockConnectionFactory : IConnectionFactory + { + private readonly int interval; + + public MockConnectionFactory(int interval) + { + this.interval = interval; + } + + public IConnection CreateConnection(ConnectionInfo connectionInfo) + { + return new MockConnection(interval); + } + } +} diff --git a/Connection/MockConnectionInfoBuilder.cs b/Connection/MockConnectionInfoBuilder.cs new file mode 100644 index 0000000..0c526e5 --- /dev/null +++ b/Connection/MockConnectionInfoBuilder.cs @@ -0,0 +1,10 @@ +namespace PettingZoo.Connection +{ + public class MockConnectionInfoBuilder : IConnectionInfoBuilder + { + public ConnectionInfo Build() + { + return new ConnectionInfo(); + } + } +} diff --git a/Model/RabbitMQClientConnection.cs b/Connection/RabbitMQClientConnection.cs similarity index 99% rename from Model/RabbitMQClientConnection.cs rename to Connection/RabbitMQClientConnection.cs index 0cd573d..85678f7 100644 --- a/Model/RabbitMQClientConnection.cs +++ b/Connection/RabbitMQClientConnection.cs @@ -8,7 +8,7 @@ using PettingZoo.Properties; using RabbitMQ.Client; using RabbitMQ.Client.Events; -namespace PettingZoo.Model +namespace PettingZoo.Connection { public class RabbitMQClientConnection : IConnection { diff --git a/Model/RabbitMQClientConnectionFactory.cs b/Connection/RabbitMQClientConnectionFactory.cs similarity index 87% rename from Model/RabbitMQClientConnectionFactory.cs rename to Connection/RabbitMQClientConnectionFactory.cs index d61aa3e..77cbc78 100644 --- a/Model/RabbitMQClientConnectionFactory.cs +++ b/Connection/RabbitMQClientConnectionFactory.cs @@ -1,4 +1,4 @@ -namespace PettingZoo.Model +namespace PettingZoo.Connection { public class RabbitMQClientConnectionFactory : IConnectionFactory { diff --git a/Model/RabbitMQProperties.cs b/Connection/RabbitMQProperties.cs similarity index 95% rename from Model/RabbitMQProperties.cs rename to Connection/RabbitMQProperties.cs index a8378b5..8d72610 100644 --- a/Model/RabbitMQProperties.cs +++ b/Connection/RabbitMQProperties.cs @@ -1,4 +1,4 @@ -namespace PettingZoo.Model +namespace PettingZoo.Connection { static class RabbitMQProperties { diff --git a/Infrastructure/ListBoxAutoScroll.cs b/Infrastructure/ListBoxAutoScroll.cs index 4d2415c..25d3e00 100644 --- a/Infrastructure/ListBoxAutoScroll.cs +++ b/Infrastructure/ListBoxAutoScroll.cs @@ -109,7 +109,7 @@ namespace PettingZoo.Infrastructure return; } - if (Math.Abs(scrollViewer.VerticalOffset - scrollViewer.ScrollableHeight) < 1) + if (Math.Abs(scrollViewer.VerticalOffset - scrollViewer.ScrollableHeight) <= 1) target.ScrollIntoView(e.NewItems[e.NewItems.Count - 1]); } diff --git a/Model/MessageBodyRenderer.cs b/Infrastructure/MessageBodyRenderer.cs similarity index 96% rename from Model/MessageBodyRenderer.cs rename to Infrastructure/MessageBodyRenderer.cs index 1ba2e62..5030eb2 100644 --- a/Model/MessageBodyRenderer.cs +++ b/Infrastructure/MessageBodyRenderer.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Text; using Newtonsoft.Json; -namespace PettingZoo.Model +namespace PettingZoo.Infrastructure { public class MessageBodyRenderer { diff --git a/Model/UserSettings.cs b/Infrastructure/UserSettings.cs similarity index 97% rename from Model/UserSettings.cs rename to Infrastructure/UserSettings.cs index cefe00b..cd2e5eb 100644 --- a/Model/UserSettings.cs +++ b/Infrastructure/UserSettings.cs @@ -1,4 +1,4 @@ -namespace PettingZoo.Model +namespace PettingZoo.Infrastructure { public interface IUserSettingsSerializer { diff --git a/PettingZoo.csproj b/PettingZoo.csproj index 6b2b336..f0ac76d 100644 --- a/PettingZoo.csproj +++ b/PettingZoo.csproj @@ -113,21 +113,24 @@ App.xaml Code + + + - - - - - - - - - - + + + + + + + + + + diff --git a/View/ConnectionWindow.xaml.cs b/View/ConnectionWindow.xaml.cs index d0e94a0..0b91428 100644 --- a/View/ConnectionWindow.xaml.cs +++ b/View/ConnectionWindow.xaml.cs @@ -1,7 +1,8 @@ using System.Windows; using System.Windows.Input; using AutoMapper; -using PettingZoo.Model; +using PettingZoo.Connection; +using PettingZoo.Infrastructure; using PettingZoo.ViewModel; namespace PettingZoo.View diff --git a/ViewModel/ConnectionViewModel.cs b/ViewModel/ConnectionViewModel.cs index 367eb50..e4da5cb 100644 --- a/ViewModel/ConnectionViewModel.cs +++ b/ViewModel/ConnectionViewModel.cs @@ -1,8 +1,8 @@ using System; using System.Windows.Input; using AutoMapper; +using PettingZoo.Connection; using PettingZoo.Infrastructure; -using PettingZoo.Model; namespace PettingZoo.ViewModel { diff --git a/ViewModel/MainViewModel.cs b/ViewModel/MainViewModel.cs index e392b36..6fe8ef1 100644 --- a/ViewModel/MainViewModel.cs +++ b/ViewModel/MainViewModel.cs @@ -4,8 +4,8 @@ using System.Collections.ObjectModel; using System.Threading; using System.Threading.Tasks; using System.Windows.Input; +using PettingZoo.Connection; using PettingZoo.Infrastructure; -using PettingZoo.Model; using PettingZoo.Properties; namespace PettingZoo.ViewModel @@ -188,13 +188,13 @@ namespace PettingZoo.ViewModel if (args != null) switch (args.Status) { - case Model.ConnectionStatus.Connecting: + case Connection.ConnectionStatus.Connecting: return String.Format(Resources.StatusConnecting, args.Context); - case Model.ConnectionStatus.Connected: + case Connection.ConnectionStatus.Connected: return String.Format(Resources.StatusConnected, args.Context); - case Model.ConnectionStatus.Error: + case Connection.ConnectionStatus.Error: return String.Format(Resources.StatusError, args.Context); } From 5cdf8903d408d0545614c4a1399cae14f7439ac2 Mon Sep 17 00:00:00 2001 From: PsychoMark Date: Tue, 12 Jul 2016 16:57:24 +0200 Subject: [PATCH 2/2] Revert "Changed Model namespace to Connection, moved bits out to Infrastructure" This reverts commit ccfde19d2d0b53901bb3caf161e907b782e1671c. --- App.xaml.cs | 7 +-- Connection/MockConnection.cs | 50 ------------------- Connection/MockConnectionFactory.cs | 17 ------- Connection/MockConnectionInfoBuilder.cs | 10 ---- Infrastructure/ListBoxAutoScroll.cs | 2 +- {Connection => Model}/ConnectionInfo.cs | 2 +- {Connection => Model}/IConnection.cs | 2 +- {Connection => Model}/IConnectionFactory.cs | 2 +- .../IConnectionInfoBuilder.cs | 2 +- .../MessageBodyRenderer.cs | 2 +- {Connection => Model}/MessageInfo.cs | 2 +- .../RabbitMQClientConnection.cs | 2 +- .../RabbitMQClientConnectionFactory.cs | 2 +- {Connection => Model}/RabbitMQProperties.cs | 2 +- {Infrastructure => Model}/UserSettings.cs | 2 +- PettingZoo.csproj | 23 ++++----- View/ConnectionWindow.xaml.cs | 3 +- ViewModel/ConnectionViewModel.cs | 2 +- ViewModel/MainViewModel.cs | 8 +-- 19 files changed, 28 insertions(+), 114 deletions(-) delete mode 100644 Connection/MockConnection.cs delete mode 100644 Connection/MockConnectionFactory.cs delete mode 100644 Connection/MockConnectionInfoBuilder.cs rename {Connection => Model}/ConnectionInfo.cs (91%) rename {Connection => Model}/IConnection.cs (96%) rename {Connection => Model}/IConnectionFactory.cs (78%) rename {Connection => Model}/IConnectionInfoBuilder.cs (72%) rename {Infrastructure => Model}/MessageBodyRenderer.cs (96%) rename {Connection => Model}/MessageInfo.cs (95%) rename {Connection => Model}/RabbitMQClientConnection.cs (99%) rename {Connection => Model}/RabbitMQClientConnectionFactory.cs (87%) rename {Connection => Model}/RabbitMQProperties.cs (95%) rename {Infrastructure => Model}/UserSettings.cs (97%) diff --git a/App.xaml.cs b/App.xaml.cs index fad383f..4089151 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -5,8 +5,7 @@ using System.Reflection; using System.Windows; using System.Windows.Markup; using Newtonsoft.Json; -using PettingZoo.Connection; -using PettingZoo.Infrastructure; +using PettingZoo.Model; using PettingZoo.View; using PettingZoo.ViewModel; using SimpleInjector; @@ -35,10 +34,6 @@ namespace PettingZoo container.Register(); container.Register(); - //container.Register(() => new MockConnectionFactory(10)); - //container.Register(); - - container.Register(); container.Register(); diff --git a/Connection/MockConnection.cs b/Connection/MockConnection.cs deleted file mode 100644 index 605cdd7..0000000 --- a/Connection/MockConnection.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading; - -namespace PettingZoo.Connection -{ - public class MockConnection : IConnection - { - private Timer messageTimer; - private bool connected; - - public MockConnection(int interval) - { - messageTimer = new Timer(state => - { - if (!connected) - { - StatusChanged(this, new StatusChangedEventArgs(ConnectionStatus.Connected, "Mock")); - connected = true; - } - - MessageReceived(this, new MessageReceivedEventArgs(new MessageInfo - { - Exchange = "mock", - RoutingKey = "mock.mock", - Timestamp = DateTime.Now, - Body = Encoding.UTF8.GetBytes("Mock!"), - Properties = new Dictionary - { - { "mock", "mock" } - }})); - }, null, interval, interval); - } - - - public void Dispose() - { - if (messageTimer != null) - { - messageTimer.Dispose(); - messageTimer = null; - } - } - - - public event EventHandler StatusChanged; - public event EventHandler MessageReceived; - } -} diff --git a/Connection/MockConnectionFactory.cs b/Connection/MockConnectionFactory.cs deleted file mode 100644 index 8e91d1f..0000000 --- a/Connection/MockConnectionFactory.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace PettingZoo.Connection -{ - public class MockConnectionFactory : IConnectionFactory - { - private readonly int interval; - - public MockConnectionFactory(int interval) - { - this.interval = interval; - } - - public IConnection CreateConnection(ConnectionInfo connectionInfo) - { - return new MockConnection(interval); - } - } -} diff --git a/Connection/MockConnectionInfoBuilder.cs b/Connection/MockConnectionInfoBuilder.cs deleted file mode 100644 index 0c526e5..0000000 --- a/Connection/MockConnectionInfoBuilder.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace PettingZoo.Connection -{ - public class MockConnectionInfoBuilder : IConnectionInfoBuilder - { - public ConnectionInfo Build() - { - return new ConnectionInfo(); - } - } -} diff --git a/Infrastructure/ListBoxAutoScroll.cs b/Infrastructure/ListBoxAutoScroll.cs index 25d3e00..4d2415c 100644 --- a/Infrastructure/ListBoxAutoScroll.cs +++ b/Infrastructure/ListBoxAutoScroll.cs @@ -109,7 +109,7 @@ namespace PettingZoo.Infrastructure return; } - if (Math.Abs(scrollViewer.VerticalOffset - scrollViewer.ScrollableHeight) <= 1) + if (Math.Abs(scrollViewer.VerticalOffset - scrollViewer.ScrollableHeight) < 1) target.ScrollIntoView(e.NewItems[e.NewItems.Count - 1]); } diff --git a/Connection/ConnectionInfo.cs b/Model/ConnectionInfo.cs similarity index 91% rename from Connection/ConnectionInfo.cs rename to Model/ConnectionInfo.cs index ba4abd2..8ba3ba4 100644 --- a/Connection/ConnectionInfo.cs +++ b/Model/ConnectionInfo.cs @@ -1,4 +1,4 @@ -namespace PettingZoo.Connection +namespace PettingZoo.Model { public class ConnectionInfo { diff --git a/Connection/IConnection.cs b/Model/IConnection.cs similarity index 96% rename from Connection/IConnection.cs rename to Model/IConnection.cs index deabd60..394a721 100644 --- a/Connection/IConnection.cs +++ b/Model/IConnection.cs @@ -1,6 +1,6 @@ using System; -namespace PettingZoo.Connection +namespace PettingZoo.Model { public enum ConnectionStatus { diff --git a/Connection/IConnectionFactory.cs b/Model/IConnectionFactory.cs similarity index 78% rename from Connection/IConnectionFactory.cs rename to Model/IConnectionFactory.cs index adf0655..e1b6bd5 100644 --- a/Connection/IConnectionFactory.cs +++ b/Model/IConnectionFactory.cs @@ -1,4 +1,4 @@ -namespace PettingZoo.Connection +namespace PettingZoo.Model { public interface IConnectionFactory { diff --git a/Connection/IConnectionInfoBuilder.cs b/Model/IConnectionInfoBuilder.cs similarity index 72% rename from Connection/IConnectionInfoBuilder.cs rename to Model/IConnectionInfoBuilder.cs index 3c4e13e..bdd683c 100644 --- a/Connection/IConnectionInfoBuilder.cs +++ b/Model/IConnectionInfoBuilder.cs @@ -1,4 +1,4 @@ -namespace PettingZoo.Connection +namespace PettingZoo.Model { public interface IConnectionInfoBuilder { diff --git a/Infrastructure/MessageBodyRenderer.cs b/Model/MessageBodyRenderer.cs similarity index 96% rename from Infrastructure/MessageBodyRenderer.cs rename to Model/MessageBodyRenderer.cs index 5030eb2..1ba2e62 100644 --- a/Infrastructure/MessageBodyRenderer.cs +++ b/Model/MessageBodyRenderer.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Text; using Newtonsoft.Json; -namespace PettingZoo.Infrastructure +namespace PettingZoo.Model { public class MessageBodyRenderer { diff --git a/Connection/MessageInfo.cs b/Model/MessageInfo.cs similarity index 95% rename from Connection/MessageInfo.cs rename to Model/MessageInfo.cs index 35de946..7a29779 100644 --- a/Connection/MessageInfo.cs +++ b/Model/MessageInfo.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace PettingZoo.Connection +namespace PettingZoo.Model { public class MessageInfo { diff --git a/Connection/RabbitMQClientConnection.cs b/Model/RabbitMQClientConnection.cs similarity index 99% rename from Connection/RabbitMQClientConnection.cs rename to Model/RabbitMQClientConnection.cs index 85678f7..0cd573d 100644 --- a/Connection/RabbitMQClientConnection.cs +++ b/Model/RabbitMQClientConnection.cs @@ -8,7 +8,7 @@ using PettingZoo.Properties; using RabbitMQ.Client; using RabbitMQ.Client.Events; -namespace PettingZoo.Connection +namespace PettingZoo.Model { public class RabbitMQClientConnection : IConnection { diff --git a/Connection/RabbitMQClientConnectionFactory.cs b/Model/RabbitMQClientConnectionFactory.cs similarity index 87% rename from Connection/RabbitMQClientConnectionFactory.cs rename to Model/RabbitMQClientConnectionFactory.cs index 77cbc78..d61aa3e 100644 --- a/Connection/RabbitMQClientConnectionFactory.cs +++ b/Model/RabbitMQClientConnectionFactory.cs @@ -1,4 +1,4 @@ -namespace PettingZoo.Connection +namespace PettingZoo.Model { public class RabbitMQClientConnectionFactory : IConnectionFactory { diff --git a/Connection/RabbitMQProperties.cs b/Model/RabbitMQProperties.cs similarity index 95% rename from Connection/RabbitMQProperties.cs rename to Model/RabbitMQProperties.cs index 8d72610..a8378b5 100644 --- a/Connection/RabbitMQProperties.cs +++ b/Model/RabbitMQProperties.cs @@ -1,4 +1,4 @@ -namespace PettingZoo.Connection +namespace PettingZoo.Model { static class RabbitMQProperties { diff --git a/Infrastructure/UserSettings.cs b/Model/UserSettings.cs similarity index 97% rename from Infrastructure/UserSettings.cs rename to Model/UserSettings.cs index cd2e5eb..cefe00b 100644 --- a/Infrastructure/UserSettings.cs +++ b/Model/UserSettings.cs @@ -1,4 +1,4 @@ -namespace PettingZoo.Infrastructure +namespace PettingZoo.Model { public interface IUserSettingsSerializer { diff --git a/PettingZoo.csproj b/PettingZoo.csproj index f0ac76d..6b2b336 100644 --- a/PettingZoo.csproj +++ b/PettingZoo.csproj @@ -113,24 +113,21 @@ App.xaml Code - - - - - - - - - - - - - + + + + + + + + + + diff --git a/View/ConnectionWindow.xaml.cs b/View/ConnectionWindow.xaml.cs index 0b91428..d0e94a0 100644 --- a/View/ConnectionWindow.xaml.cs +++ b/View/ConnectionWindow.xaml.cs @@ -1,8 +1,7 @@ using System.Windows; using System.Windows.Input; using AutoMapper; -using PettingZoo.Connection; -using PettingZoo.Infrastructure; +using PettingZoo.Model; using PettingZoo.ViewModel; namespace PettingZoo.View diff --git a/ViewModel/ConnectionViewModel.cs b/ViewModel/ConnectionViewModel.cs index e4da5cb..367eb50 100644 --- a/ViewModel/ConnectionViewModel.cs +++ b/ViewModel/ConnectionViewModel.cs @@ -1,8 +1,8 @@ using System; using System.Windows.Input; using AutoMapper; -using PettingZoo.Connection; using PettingZoo.Infrastructure; +using PettingZoo.Model; namespace PettingZoo.ViewModel { diff --git a/ViewModel/MainViewModel.cs b/ViewModel/MainViewModel.cs index 6fe8ef1..e392b36 100644 --- a/ViewModel/MainViewModel.cs +++ b/ViewModel/MainViewModel.cs @@ -4,8 +4,8 @@ using System.Collections.ObjectModel; using System.Threading; using System.Threading.Tasks; using System.Windows.Input; -using PettingZoo.Connection; using PettingZoo.Infrastructure; +using PettingZoo.Model; using PettingZoo.Properties; namespace PettingZoo.ViewModel @@ -188,13 +188,13 @@ namespace PettingZoo.ViewModel if (args != null) switch (args.Status) { - case Connection.ConnectionStatus.Connecting: + case Model.ConnectionStatus.Connecting: return String.Format(Resources.StatusConnecting, args.Context); - case Connection.ConnectionStatus.Connected: + case Model.ConnectionStatus.Connected: return String.Format(Resources.StatusConnected, args.Context); - case Connection.ConnectionStatus.Error: + case Model.ConnectionStatus.Error: return String.Format(Resources.StatusError, args.Context); }