public SelectQueueDialog(IServiceBusDiscovery discovery, ServerConfig3 serverCfg, string[] queueNames) { InitializeComponent(); _disc = discovery; _serverSettings = serverCfg.ConnectionSettings; Topmost = SbmqSystem.UIState.AlwaysOnTop; var qItems = queueNames.Select(n => new QueueListItem() { Name = n, Access = QueueAccess.Unknown }).ToList(); lbQueues.ItemsSource = qItems; BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += (s, e) => { foreach( var q in qItems ) { if( _disc.CanAccessQueue(_serverSettings, q.Name) ) q.Access = QueueAccess.RW; else { q.Access = QueueAccess.None; } } }; bw.RunWorkerCompleted += (s, e) => { lbQueues.Items.Refresh(); }; bw.RunWorkerAsync(); }
private void UpdateServiceBus(string messageBus = null, string version = null, string queueType = null) { if (messageBus == null) { var sb = _managerTypes.First(x => x.DisplayName == (string)cbServiceBus.SelectedValue); messageBus = sb.Name; version = sb.Version; } if (queueType == null) { queueType = cbTransport.SelectedValue as string; } if (messageBus != null && queueType != null) { _discoverySvc = _sys.GetDiscoveryService(messageBus, version, queueType); parameters.Children.Clear(); foreach (var prm in _discoverySvc.ServerConnectionParameters) { var value = (Result.Server != null ? Result.Server.ConnectionSettings.GetValue(prm.SchemaName, prm.DefaultValue) : null); var ctl = new ServerConnectionParamControl(prm, value); ctl.ValueChanged += ctl_ValueChanged; ctl.LostFocus += ctl_LostFocus; parameters.Children.Add(ctl); } } }
private IServiceBusDiscovery GetDiscoveryService() { if (_disc == null) { _disc = _sys.GetDiscoveryService(); } return(_disc); }
public SelectQueueDialog(IServiceBusDiscovery discovery, string server, string[] queueNames) { InitializeComponent(); _disc = discovery; _server = server; Topmost = SbmqSystem.UIState.AlwaysOnTop; lbQueues.ItemsSource = queueNames; }
public SelectQueueDialog(IServiceBusDiscovery discovery, string server, string[] queueNames) { InitializeComponent(); _disc = discovery; _server = server; Topmost = SbmqSystem.UIState.AlwaysOnTop; var qItems = queueNames.Select(n => new QueueListItem() { Name = n, Access = QueueAccess.Unknown }).ToList(); lbQueues.ItemsSource = qItems; BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += (s, e) => { foreach (var q in qItems) { if (_disc.CanAccessQueue(_server, q.Name)) { q.Access = QueueAccess.RW; } else { q.Access = QueueAccess.None; } } }; bw.RunWorkerCompleted += (s, e) => { lbQueues.Items.Refresh(); }; bw.RunWorkerAsync(); }
private IServiceBusDiscovery GetDiscoveryService() { if( _disc == null ) _disc = _sys.GetDiscoveryService(); return _disc; }
private void UpdateServiceBus(string messageBus = null, string version = null, string queueType = null) { if( messageBus == null ) { var sb = _managerTypes.First(x => x.DisplayName == (string)cbServiceBus.SelectedValue); messageBus = sb.Name; version = sb.Version; } if( queueType == null ) queueType = cbTransport.SelectedValue as string; if( messageBus != null && queueType != null ) { _discoverySvc = _sys.GetDiscoveryService(messageBus, version, queueType); parameters.Children.Clear(); foreach( var prm in _discoverySvc.ServerConnectionParameters ) { var value = ( Result.Server != null ? Result.Server.ConnectionSettings.GetValue(prm.SchemaName, prm.DefaultValue) : null ); var ctl = new ServerConnectionParamControl(prm, value); ctl.ValueChanged += ctl_ValueChanged; ctl.LostFocus += ctl_LostFocus; parameters.Children.Add(ctl); } } }