Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionPool" /> class.
        /// </summary>
        /// <param name="settingsRepository">The settings repository.</param>
        /// <param name="buildProviderStrategy">The build provider strategy.</param>
        public ConnectionPool(IConnectionSettingsRepository settingsRepository, IBuildProviderStrategy buildProviderStrategy)
        {
            Ensure.That(settingsRepository).IsNotNull();
            Ensure.That(buildProviderStrategy).IsNotNull();

            _buildProviderStrategy = buildProviderStrategy;
            _connections           = new Dictionary <Guid, Connection>();
            _observers             = new HashSet <IObserver <Notification <IConnection>[]> >();
            _subscription          = settingsRepository.Subscribe(this);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionsListViewModel" /> class.
        /// </summary>
        /// <param name="application">The application.</param>
        /// <param name="connectionViewModelStrategy">The connection view model strategy.</param>
        /// <param name="connectionSettingsRepository">The connection settings repository.</param>
        public ConnectionsListViewModel(
            IApp application,
            IConnectionViewModelStrategy connectionViewModelStrategy,
            IConnectionSettingsRepository connectionSettingsRepository)
        {
            Ensure.That(application).IsNotNull();
            Ensure.That(connectionViewModelStrategy).IsNotNull();
            Ensure.That(connectionSettingsRepository).IsNotNull();

            _application = application;
            _connectionViewModelStrategy = connectionViewModelStrategy;
            _connections  = new BindableCollection <IConnectionViewModel>();
            _subscription = connectionSettingsRepository.Subscribe(this);
        }