public DeleteServiceControlInstanceCommand(IWindowManagerEx windowManager, IEventAggregator eventAggregator, ServiceControlInstanceInstaller installer, Func <DeleteServiceControlConfirmationViewModel> deleteInstanceConfirmation) : base(model => model != null)
 {
     this.windowManager = windowManager;
     this.deleteInstanceConfirmation = deleteInstanceConfirmation;
     this.eventAggregator            = eventAggregator;
     this.installer = installer;
 }
Пример #2
0
        public void TestInitialize()
        {
            queueManager      = Substitute.For <IQueueManagerAsync>();
            view              = Substitute.For <IExplorerView>();
            eventAggregator   = Substitute.For <IEventAggregator>();
            windowManagerEx   = Substitute.For <IWindowManagerEx>();
            networkOperations = Substitute.For <INetworkOperations>();
            explorer          = new QueueExplorerViewModel(queueManager, eventAggregator, windowManagerEx, networkOperations);

            queue    = new Queue("TestQueue");
            subQueue = new Queue("TestQueue.Subscriptions");

            IList <Queue> queues = new List <Queue> {
                queue, subQueue
            };

            queueManager.GetQueues(Arg.Any <string>()).Returns(Task.Run(() => queues));
            queueManager.GetQueues().Returns(Task.Run(() => queues));
            queueManager.GetMessageCount(Arg.Any <Queue>()).Returns(Task.Run(() => queues.Count));
            queueManager.IsMsmqInstalled(Arg.Any <string>()).Returns(Task.Run(() => true));

            AsyncHelper.Run(() => explorer.AttachView(view, null));
            AsyncHelper.Run(() => explorer.ConnectToQueue(Environment.MachineName));

            queueNode = explorer.MachineRoot.Children.OfType <QueueExplorerItem>().First();
        }
        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")
            };
        }
Пример #4
0
        public MessageFlowViewModel(
            IServiceControl serviceControl,
            IEventAggregator eventAggregator,
            IWindowManagerEx windowManager,
            SearchBarViewModel searchBar,
            MessageListViewModel messageList,
            Func <ExceptionDetailViewModel> exceptionDetail,
            ISettingsProvider settingsProvider,
            EndpointExplorerViewModel endpointExplorer,
            IClipboard clipboard)
        {
            this.serviceControl   = serviceControl;
            this.eventAggregator  = eventAggregator;
            this.windowManager    = windowManager;
            this.settingsProvider = settingsProvider;
            this.messageList      = messageList;
            this.endpointExplorer = endpointExplorer;
            this.exceptionDetail  = exceptionDetail;

            CopyConversationIDCommand = new CopyConversationIDCommand(clipboard);
            CopyMessageURICommand     = new CopyMessageURICommand(clipboard, serviceControl);
            SearchByMessageIDCommand  = new SearchByMessageIDCommand(eventAggregator, searchBar);
            RetryMessageCommand       = new RetryMessageCommand(eventAggregator, serviceControl);

            Diagram = new MessageFlowDiagram();
            nodeMap = new ConcurrentDictionary <string, MessageNode>();
        }
Пример #5
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();
        }
Пример #6
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);
        }
        public MessageFlowViewModel(
            IServiceControl serviceControl,
            IEventAggregator eventAggregator,
            IWindowManagerEx windowManager,
            IContainer container,
            Func <ExceptionDetailViewModel> exceptionDetail,
            ISettingsProvider settingsProvider,
            MessageSelectionContext selectionContext,
            IWorkNotifier workNotifier)
        {
            this.workNotifier     = workNotifier;
            this.serviceControl   = serviceControl;
            this.eventAggregator  = eventAggregator;
            this.windowManager    = windowManager;
            this.settingsProvider = settingsProvider;
            selection             = selectionContext;
            this.exceptionDetail  = exceptionDetail;

            CopyConversationIDCommand = container.Resolve <CopyConversationIDCommand>();
            CopyMessageURICommand     = container.Resolve <CopyMessageURICommand>();
            RetryMessageCommand       = container.Resolve <RetryMessageCommand>();
            SearchByMessageIDCommand  = container.Resolve <SearchByMessageIDCommand>();

            Diagram = new FlowDiagramModel();
            nodeMap = new ConcurrentDictionary <string, MessageNode>();
        }
 public ServiceControlAddAttachment(IWindowManagerEx windowManager, IEventAggregator eventAggregator, ServiceControlInstanceInstaller serviceControlinstaller, ServiceControlAuditInstanceInstaller serviceControlAuditInstaller)
 {
     this.windowManager                = windowManager;
     this.serviceControlInstaller      = serviceControlinstaller;
     this.serviceControlAuditInstaller = serviceControlAuditInstaller;
     this.eventAggregator              = eventAggregator;
 }
        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);
        }
Пример #10
0
        public LicenseStatusBar(IWindowManagerEx windowManager, NetworkOperations network)
        {
            this.network       = network;
            this.windowManager = windowManager;

            ContactUs     = Command.Create(OnContactUsClicked);
            ManageLicense = Command.Create(OnManageLicense);
        }
 public AppExceptionHandler(
     IWindowManagerEx windowManager,
     IEventAggregator eventAggregator,
     ShellViewModel shell)
 {
     this.windowManager = windowManager;
     this.eventAggregator = eventAggregator;
     this.shell = shell;
 }
 public LicenseRegistrationViewModel(
     AppLicenseManager licenseManager,
     IWindowManagerEx dialogManager,
     NetworkOperations network)
 {
     this.licenseManager = licenseManager;
     this.dialogManager = dialogManager;
     this.network = network;
 }
Пример #13
0
 public AppExceptionHandler(
     IWindowManagerEx windowManager,
     IEventAggregator eventAggregator,
     ShellViewModel shell)
 {
     this.windowManager   = windowManager;
     this.eventAggregator = eventAggregator;
     this.shell           = shell;
 }
 public LicenseRegistrationViewModel(
     AppLicenseManager licenseManager,
     IWindowManagerEx dialogManager,
     NetworkOperations network)
 {
     this.licenseManager = licenseManager;
     this.dialogManager  = dialogManager;
     this.network        = network;
 }
Пример #15
0
 public ExplorerViewModel(
     IQueueManager queueManager,
     IEventAggregator eventAggregator,
     IWindowManagerEx windowManager)
 {
     _queueManager    = queueManager;
     _eventAggregator = eventAggregator;
     _windowManager   = windowManager;
     Items            = new BindableCollection <ExplorerItem>();
 }
Пример #16
0
 public ExplorerViewModel(
     IQueueManager queueManager,
     IEventAggregator eventAggregator,
     IWindowManagerEx windowManager)
 {
     _queueManager = queueManager;
     _eventAggregator = eventAggregator;
     _windowManager = windowManager;
     Items = new BindableCollection<ExplorerItem>();
 }
 public UpgradeAuditInstanceCommand(
     IWindowManagerEx windowManager,
     IEventAggregator eventAggregator,
     ServiceControlInstanceInstaller serviceControlInstaller,
     ServiceControlAuditInstanceInstaller serviceControlAuditInstaller)
 {
     this.windowManager                = windowManager;
     this.eventAggregator              = eventAggregator;
     this.serviceControlInstaller      = serviceControlInstaller;
     this.serviceControlAuditInstaller = serviceControlAuditInstaller;
 }
 public QueueExplorerViewModel(
     IQueueManagerAsync queueManager,
     IEventAggregator eventAggregator,
     IWindowManagerEx windowManager,
     INetworkOperations networkOperations)
 {
     _queueManager = queueManager;
     _eventAggregator = eventAggregator;
     _windowManager = windowManager;
     _networkOperations = networkOperations;
     Items = new BindableCollection<ExplorerItem>();
     IsMSMQInstalled = true;
 }
Пример #19
0
 public MessageListViewModel(
     IEventAggregator eventAggregator,
     IWindowManagerEx windowManager,
     IManagementService managementService,
     IQueueManagerAsync asyncQueueManager)
 {
     _eventAggregator = eventAggregator;
     _windowManager = windowManager;
     _managementService = managementService;
     _asyncQueueManager = asyncQueueManager;
     Messages = new BindableCollection<MessageInfo>();
     SelectedMessages = new BindableCollection<MessageInfo>();
 }
Пример #20
0
 public QueueExplorerViewModel(
     IQueueManagerAsync queueManager,
     IEventAggregator eventAggregator,
     IWindowManagerEx windowManager,
     INetworkOperations networkOperations)
 {
     _queueManager      = queueManager;
     _eventAggregator   = eventAggregator;
     _windowManager     = windowManager;
     _networkOperations = networkOperations;
     Items           = new BindableCollection <ExplorerItem>();
     IsMSMQInstalled = true;
 }
Пример #21
0
 public MessageListViewModel(
     IEventAggregator eventAggregator,
     IWindowManagerEx windowManager,
     IManagementService managementService,
     IQueueManagerAsync asyncQueueManager)
 {
     _eventAggregator   = eventAggregator;
     _windowManager     = windowManager;
     _managementService = managementService;
     _asyncQueueManager = asyncQueueManager;
     Messages           = new BindableCollection <MessageInfo>();
     SelectedMessages   = new BindableCollection <MessageInfo>();
 }
Пример #22
0
 public UpgradeServiceControlInstanceCommand(
     IWindowManagerEx windowManager,
     IEventAggregator eventAggregator,
     ServiceControlInstanceInstaller serviceControlInstaller,
     ServiceControlAuditInstanceInstaller serviceControlAuditInstaller,
     Func <string, AddNewAuditInstanceViewModel> auditUpgradeViewModelFactory)
 {
     this.windowManager                = windowManager;
     this.eventAggregator              = eventAggregator;
     this.serviceControlInstaller      = serviceControlInstaller;
     this.serviceControlAuditInstaller = serviceControlAuditInstaller;
     this.auditUpgradeViewModelFactory = auditUpgradeViewModelFactory;
 }
 public FeedBackAttachment(
     RaygunFeedback raygunFeedBack,
     IWindowManagerEx windowManager,
     Func <FeedBackViewModel> feedBackFactory,
     Func <FeedBackResultViewModel> feedBackResultFactory,
     Func <FeedBackNoticeViewModel> feedBackNoticeFactory)
 {
     this.feedBackNoticeFactory = feedBackNoticeFactory;
     this.feedBackResultFactory = feedBackResultFactory;
     this.feedBackFactory       = feedBackFactory;
     this.raygunFeedBack        = raygunFeedBack;
     this.windowManager         = windowManager;
 }
 public DefaultExceptionHandler(
     IWindowManagerEx windowManager,
     IViewModelFactory screenFactory,
     IAppCommands appCommands,
     IEventAggregator eventAggregator,
     IShellViewModel shell)
     : base(screenFactory.Create <IExceptionViewModel>())
 {
     _windowManager   = windowManager;
     _appCommands     = appCommands;
     _eventAggregator = eventAggregator;
     _shell           = shell;
 }
 public DefaultExceptionHandler(
     IWindowManagerEx windowManager, 
     IViewModelFactory screenFactory,
     IAppCommands appCommands, 
     IEventAggregator eventAggregator,
     IShellViewModel shell) 
     : base(windowManager, screenFactory)
 {
     _windowManager = windowManager;
     _appCommands = appCommands;
     _eventAggregator = eventAggregator;
     _shell = shell;
 }
Пример #26
0
        public LicenseMessageBoxViewModel(
            AppLicenseManager licenseManager,
            NetworkOperations networkOperations,
            IWindowManagerEx windowManager,
            IAppCommands appCommands)
        {
            this.licenseManager    = licenseManager;
            this.networkOperations = networkOperations;
            this.windowManager     = windowManager;
            this.appCommands       = appCommands;

            SetupLicenseOptions();
        }
Пример #27
0
        public ManageLicenseViewModel(
            AppLicenseManager licenseManager,
            NetworkOperations network,
            IWindowManagerEx windowManager,
            IEventAggregator eventAggregator)
        {
            this.licenseManager  = licenseManager;
            this.network         = network;
            this.windowManager   = windowManager;
            this.eventAggregator = eventAggregator;

            DisplayName      = "License Information";
            ContactUsCommand = Command.Create(ContactUs);
        }
Пример #28
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();
        }
Пример #29
0
 public SagaWindowViewModel(
     IEventAggregator eventAggregator,
     IWorkNotifier workNotifier,
     IServiceControl serviceControl,
     IClipboard clipboard,
     IWindowManagerEx windowManager,
     MessageSelectionContext selectionContext)
 {
     this.eventAggregator     = eventAggregator;
     this.workNotifier        = workNotifier;
     this.serviceControl      = serviceControl;
     this.windowManager       = windowManager;
     selection                = selectionContext;
     ShowSagaNotFoundWarning  = false;
     CopyCommand              = Command.Create(arg => clipboard.CopyTo(InstallScriptText));
     ShowEntireContentCommand = Command.Create(arg => ShowEntireContent((SagaUpdatedValue)arg));
 }
Пример #30
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);
 }
        public SequenceDiagramViewModel(
            IClipboard clipboard,
            IEventAggregator eventAggregator,
            IWindowManagerEx windowManager,
            IServiceControl serviceControl,
            Func <ExceptionDetailViewModel> exceptionDetailViewModel,
            SearchBarViewModel searchBar,
            EndpointExplorerViewModel endpointExplorer,
            MessageListViewModel messageList)
        {
            this.windowManager            = windowManager;
            this.eventAggregator          = eventAggregator;
            this.serviceControl           = serviceControl;
            this.exceptionDetailViewModel = exceptionDetailViewModel;

            CopyConversationIDCommand = new CopyConversationIDCommand(clipboard);
            CopyMessageURICommand     = new CopyMessageURICommand(clipboard, serviceControl);
            RetryMessageCommand       = new RetryMessageCommand(eventAggregator, serviceControl);
            SearchByMessageIDCommand  = new SearchByMessageIDCommand(eventAggregator, searchBar);
            ShowSagaCommand           = new ShowSagaCommand(eventAggregator, endpointExplorer, messageList);
        }
Пример #32
0
        public MessageInfo(
            IEventAggregator eventAggregator,
            IWindowManagerEx windowManager,
            Func <ExceptionDetailViewModel> exceptionDetailViewModel,
            SequenceDiagramViewModel viewModel,
            StoredMessage message,
            ReactiveList <EndpointInfo> endpoints)
        {
            this.windowManager            = windowManager;
            this.eventAggregator          = eventAggregator;
            this.exceptionDetailViewModel = exceptionDetailViewModel;
            Message   = message;
            Endpoints = endpoints;

            RetryMessageCommand       = viewModel.RetryMessageCommand;
            CopyConversationIDCommand = viewModel.CopyConversationIDCommand;
            CopyMessageURICommand     = viewModel.CopyMessageURICommand;
            SearchByMessageIDCommand  = viewModel.SearchByMessageIDCommand;
            ShowSagaCommand           = viewModel.ShowSagaCommand;
            var cmd = new ReactiveCommand();

            cmd.Subscribe(_ => ShowException());
            DisplayExceptionDetailsCommand = cmd;

            Name = message.FriendlyMessageType;
            if (message.Sagas != null && message.Sagas.Any())
            {
                SagaName = TypeHumanizer.ToName(message.Sagas.First().SagaType);
            }
            CriticalTime   = message.CriticalTime;
            DeliveryTime   = message.DeliveryTime;
            ProcessingTime = message.ProcessingTime;

            ExceptionType    = message.GetHeaderByKey(MessageHeaderKeys.ExceptionType);
            ExceptionMessage = message.GetHeaderByKey(MessageHeaderKeys.ExceptionMessage);

            endpoints.Changed.Subscribe(_ => UpdateIndicies());

            UpdateIndicies();
        }
Пример #33
0
        private MessageFlowViewModel CreateSUT()
        {
            _serviceControl   = Substitute.For <IServiceControl>();
            _eventAggregator  = Substitute.For <IEventAggregator>();
            _clipboard        = Substitute.For <IClipboard>();
            _windowManager    = Substitute.For <IWindowManagerEx>();
            _screenFactory    = Substitute.For <IScreenFactory>();
            _searchBar        = Substitute.For <ISearchBarViewModel>();
            _messageList      = Substitute.For <IMessageListViewModel>();
            _settingProvider  = Substitute.For <ISettingsProvider>();
            _endpointExplorer = Substitute.For <IEndpointExplorerViewModel>();

            return(new MessageFlowViewModel(_serviceControl,
                                            _eventAggregator,
                                            _clipboard,
                                            _windowManager,
                                            _screenFactory,
                                            _searchBar,
                                            _messageList,
                                            _settingProvider,
                                            _endpointExplorer));
        }
        private MessageFlowViewModel CreateSUT()
        {
            _serviceControl = Substitute.For<IServiceControl>();
            _eventAggregator = Substitute.For<IEventAggregator>();
            _clipboard = Substitute.For<IClipboard>();
            _windowManager = Substitute.For<IWindowManagerEx>();
            _screenFactory = Substitute.For<IScreenFactory>();
            _searchBar = Substitute.For<ISearchBarViewModel>();
            _messageList = Substitute.For<IMessageListViewModel>();
            _settingProvider = Substitute.For<ISettingsProvider>();
            _endpointExplorer = Substitute.For<IEndpointExplorerViewModel>();

            return new MessageFlowViewModel(_serviceControl,
                                            _eventAggregator,
                                            _clipboard,
                                            _windowManager,
                                            _screenFactory,
                                            _searchBar,
                                            _messageList,
                                            _settingProvider,
                                            _endpointExplorer);
        }
        public MessageFlowViewModel(
            IServiceControl serviceControl,
            IEventAggregator eventAggregator,
            IClipboard clipboard,
            IWindowManagerEx windowManager,
            IScreenFactory screenFactory,
            ISearchBarViewModel searchBar,
            IMessageListViewModel messageList,
            ISettingsProvider settingsProvider,
            IEndpointExplorerViewModel endpointExplorer)
        {
            _serviceControl   = serviceControl;
            _eventAggregator  = eventAggregator;
            _clipboard        = clipboard;
            _windowManager    = windowManager;
            _screenFactory    = screenFactory;
            _searchBar        = searchBar;
            _settingsProvider = settingsProvider;
            _messageList      = messageList;
            _endpointExplorer = endpointExplorer;

            Diagram  = new MessageFlowDiagram();
            _nodeMap = new ConcurrentDictionary <string, MessageNode>();
        }
 public ReportMessageCommand(IWindowManagerEx windowManager)
 {
     this.windowManager = windowManager;
     client = RaygunUtility.GetClient();
 }
        public ShellViewModel(
            IAppCommands appCommander,
            IWindowManagerEx windowManager,
            EndpointExplorerViewModel endpointExplorer,
            MessageListViewModel messages,
            Func <ServiceControlConnectionViewModel> serviceControlConnection,
            Func <LicenseRegistrationViewModel> licenceRegistration,
            StatusBarManager statusBarManager,
            IEventAggregator eventAggregator,
            AppLicenseManager licenseManager,
            MessageFlowViewModel messageFlow,
            SagaWindowViewModel sagaWindow,
            MessageBodyViewModel messageBodyViewer,
            MessageHeadersViewModel messageHeadersViewer,
            SequenceDiagramViewModel sequenceDiagramViewer,
            ISettingsProvider settingsProvider,
            MessagePropertiesViewModel messageProperties,
            LogWindowViewModel logWindow,
            CommandLineArgParser comandLineArgParser)
        {
            this.appCommander             = appCommander;
            this.windowManager            = windowManager;
            this.eventAggregator          = eventAggregator;
            this.licenseManager           = licenseManager;
            this.settingsProvider         = settingsProvider;
            this.comandLineArgParser      = comandLineArgParser;
            this.serviceControlConnection = serviceControlConnection;
            this.licenceRegistration      = licenceRegistration;
            MessageProperties             = messageProperties;
            MessageFlow      = messageFlow;
            SagaWindow       = sagaWindow;
            StatusBarManager = statusBarManager;
            EndpointExplorer = endpointExplorer;
            MessageHeaders   = messageHeadersViewer;
            MessageBody      = messageBodyViewer;
            SequenceDiagram  = sequenceDiagramViewer;
            Messages         = messages;
            LogWindow        = logWindow;

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

            InitializeAutoRefreshTimer();
            InitializeIdleTimer();

            ShutDownCommand = this.CreateCommand(() => this.appCommander.ShutdownImmediately());
            AboutCommand    = this.CreateCommand(() => this.windowManager.ShowDialog <AboutViewModel>());
            HelpCommand     = this.CreateCommand(() => Process.Start(@"http://docs.particular.net/"));
            ConnectToServiceControlCommand = this.CreateCommand(ConnectToServiceControl, vm => vm.CanConnectToServiceControl);

            RefreshAllCommand = this.CreateCommand(RefreshAll);

            RegisterCommand = this.CreateCommand(() =>
            {
                this.windowManager.ShowDialog <LicenseRegistrationViewModel>();
                DisplayRegistrationStatus();
            });

            ResetLayoutCommand = this.CreateCommand(() => View.OnResetLayout(settingsProvider));

            OptionsCommand = this.CreateCommand(() => windowManager.ShowDialog <OptionsViewModel>());
        }
Пример #38
0
 public DefaultExceptionHandler(IWindowManagerEx windowManager, IViewModelFactory screenFactory)
     : base(windowManager, screenFactory)
 {
     _windowManager = windowManager;
 }
 public ShowExceptionCommand(IWindowManagerEx windowManager, ISettingsProvider settingsProvider)
 {
     this.windowManager = windowManager;
     this.settingsProvider = settingsProvider;
 }
        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);
        }
Пример #41
0
        public void TestInitialize()
        {
            queueManager = Substitute.For<IQueueManagerAsync>();
            view = Substitute.For<IExplorerView>();
            eventAggregator = Substitute.For<IEventAggregator>();
            windowManagerEx = Substitute.For<IWindowManagerEx>();
            networkOperations = Substitute.For<INetworkOperations>();
            explorer = new QueueExplorerViewModel(queueManager, eventAggregator, windowManagerEx, networkOperations);

            queue = new Queue("TestQueue");
            subQueue = new Queue("TestQueue.Subscriptions");

            IList<Queue> queues = new List<Queue> { queue, subQueue };
            queueManager.GetQueues(Arg.Any<string>()).Returns(Task.Run(() => queues));
            queueManager.GetQueues().Returns(Task.Run(() => queues));
            queueManager.GetMessageCount(Arg.Any<Queue>()).Returns(Task.Run(() => queues.Count));
            queueManager.IsMsmqInstalled(Arg.Any<string>()).Returns(Task.Run(() => true));

            AsyncHelper.Run(() => explorer.AttachView(view, null));
            AsyncHelper.Run(() => explorer.ConnectToQueue(Environment.MachineName));

            queueNode = explorer.MachineRoot.Children.OfType<QueueExplorerItem>().First();
        }
Пример #42
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);
        }
 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);
 }
Пример #44
0
 public DefaultExceptionHandler(IWindowManagerEx windowManager, IViewModelFactory screenFactory)
     : base(windowManager, screenFactory)
 {
     _windowManager = windowManager;
 }