diff --git a/App.config b/App.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/App.xaml b/App.xaml
new file mode 100644
index 0000000..250340b
--- /dev/null
+++ b/App.xaml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/App.xaml.cs b/App.xaml.cs
new file mode 100644
index 0000000..27024de
--- /dev/null
+++ b/App.xaml.cs
@@ -0,0 +1,8 @@
+using System.Windows;
+
+namespace PettingZoo
+{
+ public partial class App : Application
+ {
+ }
+}
diff --git a/Infrastructure/BaseViewModel.cs b/Infrastructure/BaseViewModel.cs
new file mode 100644
index 0000000..1899ac8
--- /dev/null
+++ b/Infrastructure/BaseViewModel.cs
@@ -0,0 +1,17 @@
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+
+namespace PettingZoo.Infrastructure
+{
+ public class BaseViewModel : INotifyPropertyChanged
+ {
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void RaisePropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ var handler = PropertyChanged;
+ if (handler != null)
+ handler(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+}
diff --git a/Infrastructure/DelegateCommand.cs b/Infrastructure/DelegateCommand.cs
new file mode 100644
index 0000000..f4eb492
--- /dev/null
+++ b/Infrastructure/DelegateCommand.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Windows.Input;
+
+namespace PettingZoo.Infrastructure
+{
+ public class DelegateCommand : ICommand
+ {
+ private readonly Func canExecute;
+ private readonly Action execute;
+
+ public event EventHandler CanExecuteChanged;
+
+
+ public DelegateCommand(Action execute) : this(execute, null)
+ {
+ }
+
+ public DelegateCommand(Action execute, Func canExecute)
+ {
+ this.execute = execute;
+ this.canExecute = canExecute;
+ }
+
+
+ public bool CanExecute(object parameter)
+ {
+ return canExecute == null || canExecute((T)parameter);
+ }
+
+
+ public void Execute(object parameter)
+ {
+ execute((T)parameter);
+ }
+
+
+ public void RaiseCanExecuteChanged()
+ {
+ if (CanExecuteChanged != null)
+ CanExecuteChanged(this, EventArgs.Empty);
+ }
+ }
+
+
+
+ public class DelegateCommand : ICommand
+ {
+ private readonly Func canExecute;
+ private readonly Action execute;
+
+ public event EventHandler CanExecuteChanged;
+
+
+ public DelegateCommand(Action execute) : this(execute, null) { }
+
+ public DelegateCommand(Action execute, Func canExecute)
+ {
+ this.execute = execute;
+ this.canExecute = canExecute;
+ }
+
+
+ public bool CanExecute(object parameter)
+ {
+ return canExecute == null || canExecute();
+ }
+
+
+ public void Execute(object parameter)
+ {
+ execute();
+ }
+
+
+ public void RaiseCanExecuteChanged()
+ {
+ if (CanExecuteChanged != null)
+ CanExecuteChanged(this, EventArgs.Empty);
+ }
+ }
+}
diff --git a/Model/ConnectionInfo.cs b/Model/ConnectionInfo.cs
new file mode 100644
index 0000000..d9e0ae9
--- /dev/null
+++ b/Model/ConnectionInfo.cs
@@ -0,0 +1,11 @@
+namespace PettingZoo.Model
+{
+ public class ConnectionInfo
+ {
+ public string Host { get; set; }
+ public string VirtualHost { get; set; }
+ public int Port { get; set; }
+ public string Username { get; set; }
+ public string Password { get; set; }
+ }
+}
diff --git a/Model/IConnection.cs b/Model/IConnection.cs
new file mode 100644
index 0000000..ac13c83
--- /dev/null
+++ b/Model/IConnection.cs
@@ -0,0 +1,6 @@
+namespace PettingZoo.Model
+{
+ public interface IConnection
+ {
+ }
+}
diff --git a/Model/IConnectionFactory.cs b/Model/IConnectionFactory.cs
new file mode 100644
index 0000000..e1b6bd5
--- /dev/null
+++ b/Model/IConnectionFactory.cs
@@ -0,0 +1,7 @@
+namespace PettingZoo.Model
+{
+ public interface IConnectionFactory
+ {
+ IConnection CreateConnection(ConnectionInfo connectionInfo);
+ }
+}
diff --git a/Model/IConnectionInfoBuilder.cs b/Model/IConnectionInfoBuilder.cs
new file mode 100644
index 0000000..bdd683c
--- /dev/null
+++ b/Model/IConnectionInfoBuilder.cs
@@ -0,0 +1,7 @@
+namespace PettingZoo.Model
+{
+ public interface IConnectionInfoBuilder
+ {
+ ConnectionInfo Build();
+ }
+}
diff --git a/Model/RabbitMQClientConnection.cs b/Model/RabbitMQClientConnection.cs
new file mode 100644
index 0000000..4a7e2cd
--- /dev/null
+++ b/Model/RabbitMQClientConnection.cs
@@ -0,0 +1,10 @@
+namespace PettingZoo.Model
+{
+ public class RabbitMQClientConnection : IConnection
+ {
+ public RabbitMQClientConnection(ConnectionInfo connectionInfo)
+ {
+
+ }
+ }
+}
diff --git a/Model/RabbitMQClientConnectionFactory.cs b/Model/RabbitMQClientConnectionFactory.cs
new file mode 100644
index 0000000..d61aa3e
--- /dev/null
+++ b/Model/RabbitMQClientConnectionFactory.cs
@@ -0,0 +1,10 @@
+namespace PettingZoo.Model
+{
+ public class RabbitMQClientConnectionFactory : IConnectionFactory
+ {
+ public IConnection CreateConnection(ConnectionInfo connectionInfo)
+ {
+ return new RabbitMQClientConnection(connectionInfo);
+ }
+ }
+}
diff --git a/PettingZoo.csproj b/PettingZoo.csproj
new file mode 100644
index 0000000..4baf7a8
--- /dev/null
+++ b/PettingZoo.csproj
@@ -0,0 +1,163 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {24819D09-C747-4356-B686-D9DE9CAA6F59}
+ WinExe
+ Properties
+ PettingZoo
+ PettingZoo
+ v4.5
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ false
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+ PettingZoo.Program
+
+
+
+ packages\SimpleInjector.3.1.5\lib\net45\SimpleInjector.dll
+ True
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ConnectionWindow.xaml
+
+
+ MainWindow.xaml
+ Code
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
+ False
+ Microsoft .NET Framework 4.5 %28x86 and x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1 Client Profile
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+
+
+
\ No newline at end of file
diff --git a/PettingZoo.sln b/PettingZoo.sln
new file mode 100644
index 0000000..125cd4c
--- /dev/null
+++ b/PettingZoo.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.40629.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PettingZoo", "PettingZoo.csproj", "{24819D09-C747-4356-B686-D9DE9CAA6F59}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {24819D09-C747-4356-B686-D9DE9CAA6F59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {24819D09-C747-4356-B686-D9DE9CAA6F59}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {24819D09-C747-4356-B686-D9DE9CAA6F59}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {24819D09-C747-4356-B686-D9DE9CAA6F59}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/PettingZoo.sln.DotSettings b/PettingZoo.sln.DotSettings
new file mode 100644
index 0000000..f8f70cf
--- /dev/null
+++ b/PettingZoo.sln.DotSettings
@@ -0,0 +1,4 @@
+
+ True
+ MQ
+ WPF
\ No newline at end of file
diff --git a/Program.cs b/Program.cs
new file mode 100644
index 0000000..7ad652d
--- /dev/null
+++ b/Program.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Linq;
+using System.Reflection;
+using PettingZoo.Model;
+using PettingZoo.View;
+using SimpleInjector;
+
+namespace PettingZoo
+{
+ static class Program
+ {
+ [STAThread]
+ static void Main()
+ {
+ var container = Bootstrap();
+ RunApplication(container);
+ }
+
+
+ private static Container Bootstrap()
+ {
+ var container = new Container();
+
+ container.Register();
+ container.Register();
+
+ // Automatically register all Window and BaseViewModel descendants
+ foreach (var type in Assembly.GetExecutingAssembly().GetExportedTypes()
+ .Where(t => t.IsSubclassOf(typeof(System.Windows.Window)) ||
+ t.IsSubclassOf(typeof(Infrastructure.BaseViewModel))))
+ {
+ container.Register(type);
+ }
+
+ return container;
+ }
+
+
+ private static void RunApplication(Container container)
+ {
+ var app = new App();
+ var mainWindow = container.GetInstance();
+ app.Run(mainWindow);
+ }
+ }
+}
diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..e1a67f9
--- /dev/null
+++ b/Properties/AssemblyInfo.cs
@@ -0,0 +1,56 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Petting Zoo")]
+[assembly: AssemblyDescription("Petting Zoo - a RabbitMQ message viewer")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("X²Software")]
+[assembly: AssemblyProduct("Petting Zoo")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: GuidAttribute("1739c968-ca2a-4293-b487-bfa193a7caf3")]
diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..087ac86
--- /dev/null
+++ b/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace PettingZoo.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PettingZoo.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Properties/Resources.resx b/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..02fe6eb
--- /dev/null
+++ b/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace PettingZoo.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Properties/Settings.settings b/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/View/ConnectionWindow.xaml b/View/ConnectionWindow.xaml
new file mode 100644
index 0000000..6944ad8
--- /dev/null
+++ b/View/ConnectionWindow.xaml
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/View/ConnectionWindow.xaml.cs b/View/ConnectionWindow.xaml.cs
new file mode 100644
index 0000000..acfc312
--- /dev/null
+++ b/View/ConnectionWindow.xaml.cs
@@ -0,0 +1,33 @@
+using System.Windows;
+using PettingZoo.Model;
+using PettingZoo.ViewModel;
+
+namespace PettingZoo.View
+{
+ public class WindowConnectionInfoBuilder : IConnectionInfoBuilder
+ {
+ public ConnectionInfo Build()
+ {
+ var viewModel = new ConnectionWindowViewModel();
+ var dialog = new ConnectionWindow(viewModel)
+ {
+ Owner = Application.Current.MainWindow
+ };
+
+ if (!dialog.ShowDialog().GetValueOrDefault())
+ return null;
+
+ return viewModel.ConnectionInfo;
+ }
+ }
+
+
+ public partial class ConnectionWindow : Window
+ {
+ public ConnectionWindow(ConnectionWindowViewModel viewModel)
+ {
+ InitializeComponent();
+ DataContext = viewModel;
+ }
+ }
+}
diff --git a/View/MainWindow.xaml b/View/MainWindow.xaml
new file mode 100644
index 0000000..d04f6ee
--- /dev/null
+++ b/View/MainWindow.xaml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/View/MainWindow.xaml.cs b/View/MainWindow.xaml.cs
new file mode 100644
index 0000000..a53ba48
--- /dev/null
+++ b/View/MainWindow.xaml.cs
@@ -0,0 +1,17 @@
+using System.Windows;
+using PettingZoo.ViewModel;
+
+namespace PettingZoo.View
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ public MainWindow(MainBaseViewModel viewModel)
+ {
+ InitializeComponent();
+ DataContext = viewModel;
+ }
+ }
+}
diff --git a/ViewModel/ConnectionWindowViewModel.cs b/ViewModel/ConnectionWindowViewModel.cs
new file mode 100644
index 0000000..5977e2c
--- /dev/null
+++ b/ViewModel/ConnectionWindowViewModel.cs
@@ -0,0 +1,9 @@
+using PettingZoo.Model;
+
+namespace PettingZoo.ViewModel
+{
+ public class ConnectionWindowViewModel
+ {
+ public ConnectionInfo ConnectionInfo { get; set; }
+ }
+}
diff --git a/ViewModel/MainBaseViewModel.cs b/ViewModel/MainBaseViewModel.cs
new file mode 100644
index 0000000..db13eb2
--- /dev/null
+++ b/ViewModel/MainBaseViewModel.cs
@@ -0,0 +1,53 @@
+using System.Windows.Input;
+using PettingZoo.Infrastructure;
+using PettingZoo.Model;
+
+namespace PettingZoo.ViewModel
+{
+ public class MainBaseViewModel : BaseViewModel
+ {
+ private readonly IConnectionInfoBuilder connectionInfoBuilder;
+ private readonly IConnectionFactory connectionFactory;
+
+ private ConnectionInfo connectionInfo;
+ private IConnection connection;
+
+
+ public ConnectionInfo ConnectionInfo {
+ get
+ {
+ return connectionInfo;
+ }
+ private set
+ {
+ if (value != connectionInfo)
+ {
+ connectionInfo = value;
+ RaisePropertyChanged();
+ }
+ }
+ }
+
+ public ICommand ConnectCommand { get; private set; }
+
+
+ public MainBaseViewModel(IConnectionInfoBuilder connectionInfoBuilder, IConnectionFactory connectionFactory)
+ {
+ this.connectionInfoBuilder = connectionInfoBuilder;
+ this.connectionFactory = connectionFactory;
+
+ ConnectCommand = new DelegateCommand(ConnectExecute);
+ }
+
+
+ protected void ConnectExecute()
+ {
+ var newInfo = connectionInfoBuilder.Build();
+ if (newInfo != null)
+ {
+ ConnectionInfo = newInfo;
+ connection = connectionFactory.CreateConnection(connectionInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages.config b/packages.config
new file mode 100644
index 0000000..ab20a9a
--- /dev/null
+++ b/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file