コード例 #1
0
        public void TestInitialize()
        {
            ScreenFactory     = Substitute.For <IScreenFactory>();
            WindowManager     = Substitute.For <IWindowManagerEx>();
            QueueExplorer     = Substitute.For <IQueueExplorerViewModel>();
            EndpointExplorer  = Substitute.For <IEndpointExplorerViewModel>();
            MessageList       = Substitute.For <IMessageListViewModel>();
            NetworkOperations = Substitute.For <INetworkOperations>();
            ExceptionHandler  = Substitute.For <IExceptionHandler>();
            StatusbarManager  = Substitute.For <StatusBarManager>();
            EventAggregator   = Substitute.For <IEventAggregator>();
            MessageFlow       = Substitute.For <IMessageFlowViewModel>();
            MessageBodyView   = Substitute.For <IMessageBodyViewModel>();
            MessageProperties = Substitute.For <IMessagePropertiesViewModel>();
            View               = Substitute.For <IShellViewStub>();
            SettingsProvider   = Substitute.For <ISettingsProvider>();
            LicenseManager     = Substitute.For <ILicenseManager>();
            LogWindow          = Substitute.For <ILogWindowViewModel>();
            ConnectToViewModel = Substitute.For <ConnectToMachineViewModel>(NetworkOperations);
            SettingsProvider.GetSettings <ProfilerSettings>().Returns(DefaultAppSetting());
            App   = Substitute.For <IAppCommands>();
            shell = new ShellViewModel(App, ScreenFactory, WindowManager, QueueExplorer, EndpointExplorer, MessageList,
                                       StatusbarManager, EventAggregator, LicenseManager, MessageFlow, MessageBodyView,
                                       SettingsProvider, MessageProperties, LogWindow);

            ScreenFactory.CreateScreen <ConnectToMachineViewModel>().Returns(ConnectToViewModel);

            shell.AttachView(View, null);
        }
コード例 #2
0
        public void TestInitialize()
        {
            ScreenFactory     = Substitute.For <IScreenFactory>();
            WindowManager     = Substitute.For <IWindowManagerEx>();
            QueueExplorer     = Substitute.For <IQueueExplorerViewModel>();
            EndpointExplorer  = Substitute.For <IEndpointExplorerViewModel>();
            MessageList       = Substitute.For <IMessageListViewModel>();
            StatusbarManager  = Substitute.For <IStatusBarManager>();
            EventAggregator   = Substitute.For <IEventAggregator>();
            MessageFlow       = Substitute.For <IMessageFlowViewModel>();
            SagaWindow        = Substitute.For <ISagaWindowViewModel>();
            MessageBodyView   = Substitute.For <IMessageBodyViewModel>();
            MessageProperties = Substitute.For <IMessagePropertiesViewModel>();
            View               = Substitute.For <IShellViewStub>();
            HeaderView         = Substitute.For <IMessageHeadersViewModel>();
            SettingsProvider   = Substitute.For <ISettingsProvider>();
            LicenseManager     = Substitute.For <AppLicenseManager>();
            LogWindow          = Substitute.For <ILogWindowViewModel>();
            ConnectToViewModel = Substitute.For <IConnectToMachineViewModel>();
            SettingsProvider.GetSettings <ProfilerSettings>().Returns(DefaultAppSetting());
            App = Substitute.For <IAppCommands>();
            CommandLineArgParser = MockEmptyStartupOptions();

            shell = new ShellViewModel(App, ScreenFactory, WindowManager, QueueExplorer,
                                       EndpointExplorer, MessageList, StatusbarManager,
                                       EventAggregator, LicenseManager, MessageFlow, SagaWindow,
                                       MessageBodyView, HeaderView, SettingsProvider, MessageProperties,
                                       LogWindow, CommandLineArgParser);

            ScreenFactory.CreateScreen <IConnectToMachineViewModel>().Returns(ConnectToViewModel);

            shell.AttachView(View, null);
        }
コード例 #3
0
        public const int AutoRefreshInterval = 15000; //TODO: Wire to configuration/settings

        public ShellViewModel(
            IScreenFactory screenFactory,
            IWindowManagerEx windowManager,
            IExplorerViewModel explorer,
            IMessageListViewModel messages,
            IStatusBarManager statusBarManager,
            IEventAggregator eventAggregator,
            IConversationViewModel conversation,
            IMessageBodyViewModel messageBodyViewer,
            IEnumerable <IHeaderInfoViewModel> headers)
        {
            _screenFactory   = screenFactory;
            _windowManager   = windowManager;
            _eventAggregator = eventAggregator;
            Headers          = headers;
            Conversation     = conversation;
            StatusBarManager = statusBarManager;
            Explorer         = explorer;
            MessageBody      = messageBodyViewer;
            Messages         = messages;

            Items.Add(messageBodyViewer);
            Items.Add(conversation);
            Items.Add(explorer);
            Items.Add(messages);

            InitializeAutoRefreshTimer();
        }
コード例 #4
0
        public MessageListViewModel(
            IEventAggregator eventAggregator,
            IWindowManagerEx windowManager,
            IServiceControl serviceControl,
            IQueueManagerAsync asyncQueueManager,
            ISearchBarViewModel searchBarViewModel,
            IErrorHeaderViewModel errorHeaderDisplay,
            IGeneralHeaderViewModel generalHeaderDisplay,
            IClipboard clipboard,
            IStatusBarManager statusBar)
        {
            _eventAggregator      = eventAggregator;
            _windowManager        = windowManager;
            _serviceControl       = serviceControl;
            _asyncQueueManager    = asyncQueueManager;
            _errorHeaderDisplay   = errorHeaderDisplay;
            _generalHeaderDisplay = generalHeaderDisplay;
            _clipboard            = clipboard;
            _statusBar            = statusBar;

            SearchBar = searchBarViewModel;

            Items.Add(SearchBar);
            Messages         = new BindableCollection <MessageInfo>();
            SelectedMessages = new BindableCollection <MessageInfo>();
            ContextMenuItems = new BindableCollection <ContextMenuModel>
            {
                new ContextMenuModel(this, "ReturnToSource", "Return To Source", Properties.Resources.MessageReturn),
                new ContextMenuModel(this, "RetryMessage", "Retry Message", Properties.Resources.MessageReturn),
                new ContextMenuModel(this, "CopyMessageId", "Copy Message Identifier"),
                new ContextMenuModel(this, "CopyHeaders", "Copy Headers")
            };
        }
コード例 #5
0
 public MyPlugin([Import(AllowDefault = true)] IStatusBarManager manager)
 {
     _manager = manager;
     if (_manager != null)
     {
         _manager.Display("Hi from MyPlugin!");
     }
 }
コード例 #6
0
        public ShellViewModel(
            IAppCommands appCommander,
            IScreenFactory screenFactory,
            IWindowManagerEx windowManager,
            IQueueExplorerViewModel queueExplorer,
            IEndpointExplorerViewModel endpointExplorer,
            IMessageListViewModel messages,
            IStatusBarManager statusBarManager,
            IEventAggregator eventAggregator,
            AppLicenseManager licenseManager,
            IMessageFlowViewModel messageFlow,
            ISagaWindowViewModel sagaWindow,
            IMessageBodyViewModel messageBodyViewer,
            IMessageHeadersViewModel messageHeadersViewer,
            ISettingsProvider settingsProvider,
            IMessagePropertiesViewModel messageProperties,
            ILogWindowViewModel logWindow,
            ICommandLineArgParser comandLineArgParser)
        {
            _appCommander        = appCommander;
            _screenFactory       = screenFactory;
            _windowManager       = windowManager;
            _eventAggregator     = eventAggregator;
            _licenseManager      = licenseManager;
            _settingsProvider    = settingsProvider;
            _comandLineArgParser = comandLineArgParser;
            MessageProperties    = messageProperties;
            MessageFlow          = messageFlow;
            SagaWindow           = sagaWindow;
            StatusBarManager     = statusBarManager;
            QueueExplorer        = queueExplorer;
            EndpointExplorer     = endpointExplorer;
            MessageHeaders       = messageHeadersViewer;
            MessageBody          = messageBodyViewer;
            Messages             = messages;
            LogWindow            = logWindow;

            Items.Add(queueExplorer);
            Items.Add(endpointExplorer);
            Items.Add(messages);
            Items.Add(messageHeadersViewer);
            Items.Add(messageBodyViewer);
            Items.Add(messageFlow);

            InitializeAutoRefreshTimer();
            InitializeIdleTimer();
        }
コード例 #7
0
        public MessageFlowViewModel(
            IServiceControl serviceControl,
            IEventAggregator eventAggregator,
            IContentDecoder <IList <HeaderInfo> > decoder,
            IHeaderInfoSerializer headerInfoSerializer,
            IClipboard clipboard,
            IStatusBarManager statusBar)
        {
            _serviceControl       = serviceControl;
            _eventAggregator      = eventAggregator;
            _decoder              = decoder;
            _headerInfoSerializer = headerInfoSerializer;
            _clipboard            = clipboard;
            _statusBar            = statusBar;

            Diagram  = new MessageFlowDiagram();
            _nodeMap = new ConcurrentDictionary <string, MessageNode>();
        }
コード例 #8
0
 public void TestInitialize()
 {
     EventAggregator  = Substitute.For <IEventAggregator>();
     ServiceControl   = Substitute.For <IServiceControl>();
     MessageStore     = new Dictionary <Queue, List <MessageInfo> >();
     QueueManager     = new FakeQueueManager(MessageStore);
     WindowManager    = Substitute.For <IWindowManagerEx>();
     SearchBar        = Substitute.For <ISearchBarViewModel>();
     StatusBarManager = Substitute.For <IStatusBarManager>();
     View             = Substitute.For <IMessageListView>();
     MessageList      = new MessageListViewModel(EventAggregator, WindowManager, ServiceControl,
                                                 QueueManager, SearchBar,
                                                 Substitute.For <IErrorHeaderViewModel>(),
                                                 Substitute.For <IGeneralHeaderViewModel>(),
                                                 Substitute.For <IClipboard>(),
                                                 StatusBarManager);
     MessageList.AttachView(View, null);
 }
コード例 #9
0
 public void TestInitialize()
 {
     EventAggregator = Substitute.For<IEventAggregator>();
     ServiceControl = Substitute.For<IServiceControl>();
     MessageStore = new Dictionary<Queue, List<MessageInfo>>();
     QueueManager = new FakeQueueManager(MessageStore);
     WindowManager = Substitute.For<IWindowManagerEx>();
     SearchBar = Substitute.For<ISearchBarViewModel>();
     StatusBarManager = Substitute.For<IStatusBarManager>();
     View = Substitute.For<IMessageListView>();
     MessageList = new MessageListViewModel(EventAggregator, WindowManager, ServiceControl,
                                            QueueManager, SearchBar,
                                            Substitute.For<IErrorHeaderViewModel>(),
                                            Substitute.For<IGeneralHeaderViewModel>(),
                                            Substitute.For<IClipboard>(),
                                            StatusBarManager);
     MessageList.AttachView(View, null);
 }
コード例 #10
0
        public void TestInitialize()
        {
            ScreenFactory = Substitute.For<IScreenFactory>();
            WindowManager = Substitute.For<IWindowManagerEx>();
            QueueExplorer = Substitute.For<IQueueExplorerViewModel>();
            EndpointExplorer = Substitute.For<IEndpointExplorerViewModel>();
            MessageList = Substitute.For<IMessageListViewModel>();
            NetworkOperations = Substitute.For<INetworkOperations>();
            ExceptionHandler = Substitute.For<IExceptionHandler>();
            StatusbarManager = Substitute.For<StatusBarManager>();
            EventAggregator = Substitute.For<IEventAggregator>();
            MessageFlow = Substitute.For<IMessageFlowViewModel>();
            MessageBodyView = Substitute.For<IMessageBodyViewModel>();
            MessageProperties = Substitute.For<IMessagePropertiesViewModel>();
            View = Substitute.For<IShellViewStub>();
            SettingsProvider = Substitute.For<ISettingsProvider>();
            LicenseManager = Substitute.For<ILicenseManager>();
            LogWindow = Substitute.For<ILogWindowViewModel>();
            ConnectToViewModel = Substitute.For<ConnectToMachineViewModel>(NetworkOperations);
            SettingsProvider.GetSettings<ProfilerSettings>().Returns(DefaultAppSetting());
            App = Substitute.For<IAppCommands>();
            shell = new ShellViewModel(App, ScreenFactory, WindowManager, QueueExplorer, EndpointExplorer, MessageList,
                                       StatusbarManager, EventAggregator, LicenseManager, MessageFlow, MessageBodyView,
                                       SettingsProvider, MessageProperties, LogWindow);

            ScreenFactory.CreateScreen<ConnectToMachineViewModel>().Returns(ConnectToViewModel);

            shell.AttachView(View, null);
        }
コード例 #11
0
        public void TestInitialize()
        {
            ScreenFactory = Substitute.For<IScreenFactory>();
            WindowManager = Substitute.For<IWindowManagerEx>();
            QueueExplorer = Substitute.For<IQueueExplorerViewModel>();
            EndpointExplorer = Substitute.For<IEndpointExplorerViewModel>();
            MessageList = Substitute.For<IMessageListViewModel>();
            StatusbarManager = Substitute.For<IStatusBarManager>();
            EventAggregator = Substitute.For<IEventAggregator>();
            MessageFlow = Substitute.For<IMessageFlowViewModel>();
            SagaWindow = Substitute.For<ISagaWindowViewModel>();
            MessageBodyView = Substitute.For<IMessageBodyViewModel>();
            MessageProperties = Substitute.For<IMessagePropertiesViewModel>();
            View = Substitute.For<IShellViewStub>();
            HeaderView = Substitute.For<IMessageHeadersViewModel>();
            SettingsProvider = Substitute.For<ISettingsProvider>();
            LicenseManager = Substitute.For<AppLicenseManager>();
            LogWindow = Substitute.For<ILogWindowViewModel>();
            ConnectToViewModel = Substitute.For<IConnectToMachineViewModel>();
            SettingsProvider.GetSettings<ProfilerSettings>().Returns(DefaultAppSetting());
            App = Substitute.For<IAppCommands>();
            CommandLineArgParser = MockEmptyStartupOptions();

            shell = new ShellViewModel(App, ScreenFactory, WindowManager, QueueExplorer,
                                       EndpointExplorer, MessageList, StatusbarManager,
                                       EventAggregator, LicenseManager, MessageFlow, SagaWindow,
                                       MessageBodyView, HeaderView, SettingsProvider, MessageProperties,
                                       LogWindow, CommandLineArgParser);

            ScreenFactory.CreateScreen<IConnectToMachineViewModel>().Returns(ConnectToViewModel);

            shell.AttachView(View, null);
        }