Example #1
0
        private void Initialize()
        {
            AppDomain.CurrentDomain.AssemblyResolve += SbmqmDomain_AssemblyResolve;
            _monitorState = new SbmqmMonitorState();

            Config = SystemConfig.Load();

            Config.StartCount += 1;

            _mgr = ServiceBusFactory.CreateManager(Config.MessageBus, Config.MessageBusQueueType);
            _mgr.ErrorOccured += System_ErrorOccured;
            _mgr.ItemsChanged += System_ItemsChanged;

            _mgr.Initialize(Config.MonitorServer, Config.MonitorQueues.Select(mq => new Queue(mq.Name, mq.Type, mq.Color)).ToArray(), _monitorState);

            CanSendCommand       = (_mgr as ISendCommand) != null;
            CanViewSubscriptions = (_mgr as IViewSubscriptions) != null;

            _history = new CommandHistoryManager(Config);

            AppInfo = new ApplicationInfo(Config.Id, Assembly.GetEntryAssembly());
        }
        private void CreateServiceBusManager(string serviceBus, string version, string queueType)
        {
            _mgr = ServiceBusFactory.CreateManager(serviceBus, version, queueType);
            _mgr.ErrorOccured   += System_ErrorOccured;
            _mgr.WarningOccured += System_WarningOccured;
            _mgr.ItemsChanged   += System_ItemsChanged;

            var cmdSender = (_mgr as ISendCommand);

            if (cmdSender != null)
            {
                cmdSender.CommandContentFormat = Config.CurrentServer.CommandContentType;
            }

            lock (_itemsLock)
                _items.Clear();

            _mgr.Initialize(Config.CurrentServer.ConnectionSettings, Config.MonitorQueues.Select(mq => new Queue(mq.Name, mq.Type, mq.Color)).ToArray(), _monitorState);

            CanSendCommand       = (_mgr as ISendCommand) != null;
            CanViewSubscriptions = (_mgr as IViewSubscriptions) != null;

            _serviceBusHistory.Add(ServiceBusInfo.Create(serviceBus, version, queueType));
        }
        private void CreateServiceBusManager(string serviceBus, string version, string queueType)
        {
            _mgr = ServiceBusFactory.CreateManager(serviceBus, version, queueType);
              _mgr.ErrorOccured += System_ErrorOccured;
              _mgr.WarningOccured += System_WarningOccured;
              _mgr.ItemsChanged += System_ItemsChanged;

              var cmdSender = ( _mgr as ISendCommand );
              if( cmdSender != null )
            cmdSender.CommandContentFormat = Config.CurrentServer.CommandContentType;

              lock( _itemsLock )
            _items.Clear();

              _mgr.Initialize(Config.CurrentServer.ConnectionSettings, Config.MonitorQueues.Select(mq => new Queue(mq.Name, mq.Type, mq.Color)).ToArray(), _monitorState);

              CanSendCommand = ( _mgr as ISendCommand ) != null;
              CanViewSubscriptions = ( _mgr as IViewSubscriptions ) != null;

              _serviceBusHistory.Add(ServiceBusInfo.Create(serviceBus, version, queueType));
        }
        private void Initialize()
        {
            AppDomain.CurrentDomain.AssemblyResolve += SbmqmDomain_AssemblyResolve;
              _monitorState = new SbmqmMonitorState();

              Config = SystemConfig.Load();

              Config.StartCount += 1;

              _mgr = ServiceBusFactory.CreateManager(Config.MessageBus, Config.MessageBusQueueType);
              _mgr.ErrorOccured += System_ErrorOccured;
              _mgr.WarningOccured += System_WarningOccured;
              _mgr.ItemsChanged += System_ItemsChanged;

              _mgr.Initialize(Config.MonitorServer, Config.MonitorQueues.Select(mq => new Queue(mq.Name, mq.Type, mq.Color)).ToArray(), _monitorState);

              CanSendCommand = ( _mgr as ISendCommand ) != null;
              CanViewSubscriptions = ( _mgr as IViewSubscriptions ) != null;

              _history = new CommandHistoryManager(Config);

              AppInfo = new ApplicationInfo(Config.Id, Assembly.GetEntryAssembly());
        }