Example #1
0
        private async Task CreateClusterAsync()
        {
            var configuration = await _configurationRepository.LoadConfigurationAsync();

            var plugins = _clusterFactoryPluginManager.ReloadPlugins(configuration.PluginDirectory);

            _clusterFactoryPlugin = plugins.FirstOrDefault(plugin => plugin.ClusterId == configuration.ActiveClusterPluginId);
            _cluster = _clusterFactoryPlugin?.ConnectCluster(new ClusterConfiguration {
                PortName = configuration.ClusterPort
            });

            if (_cluster != null)
            {
                _cluster.ConnectionLost += (sender, eventArgs) => CloseClusterConnection();
                _userNotifier.ClusterConnectionChanged(_clusterFactoryPlugin.ClusterName, true);
            }
        }
Example #2
0
 public PluginModel(IClusterFactoryPlugin clusterFactoryPlugin)
 {
     Id   = clusterFactoryPlugin.ClusterId;
     Name = clusterFactoryPlugin.ClusterName;
 }