Esempio n. 1
1
        /// <summary>Initializes a new instance of the <see cref="Shell"/> class.</summary>
        /// <param name="msgBoxService">The msg Box Service.</param>
        /// <param name="eventAggregator"></param>
        /// <param name="commands">The commands.</param>
        /// <param name="fileManagerService">The file Manager Service.</param>
        /// <param name="buttonsCommands">The buttons Commands.</param>
        public Shell(
            IMessageBoxService msgBoxService,
            IEventAggregator eventAggregator,
            List<IToolbarCommand> commands,
            IFileManagerService fileManagerService,
            List<IButtonsCommand> buttonsCommands)
        {
            this.InitializeComponent();

            // Wire up our view presenters
            var toolbarButtonsView = new ToolbarView { Dock = DockStyle.Top };
            var toolbarViewPresenter = new ToolbarPresenter(toolbarButtonsView, commands);

            var buttonCommandView = new ButtonView { Dock = DockStyle.Bottom };
            var buttonCommandViewPresenter = new ButtonsPresenter(buttonCommandView, buttonsCommands);

            var levelsTreeView = new LevelsView { Dock = DockStyle.Fill };
            var levelsTreeViewPresenter = new LevelsViewPresenter(levelsTreeView, msgBoxService, eventAggregator);

            var infoView = new InformationView { Dock = DockStyle.Fill };
            var inforViewPresenter = new InformationViewPresenter(infoView);

            // Wire up our views
            this.toolbarView = toolbarButtonsView;
            this.buttonView = buttonCommandView;
            this.levelsView = levelsTreeView;
            this.informationView = infoView;

            // Wire up our event messaging
            this.aggregator = eventAggregator;
            this.aggregator.GetEvent<CloseShellMessage>().Subscribe(this.OnCloseShell);

            // Place the views in the correct regions
            this.InjectViews();
        }
Esempio n. 2
0
        /// <summary>Initializes a new instance of the <see cref="Shell"/> class.</summary>
        /// <param name="msgBoxService">The msg Box Service.</param>
        /// <param name="eventAggregator"></param>
        /// <param name="commands">The commands.</param>
        /// <param name="fileManagerService">The file Manager Service.</param>
        /// <param name="buttonsCommands">The buttons Commands.</param>
        public Shell(
            IMessageBoxService msgBoxService,
            IEventAggregator eventAggregator,
            List <IToolbarCommand> commands,
            IFileManagerService fileManagerService,
            List <IButtonsCommand> buttonsCommands)
        {
            this.InitializeComponent();

            // Wire up our view presenters
            var toolbarButtonsView = new ToolbarView {
                Dock = DockStyle.Top
            };
            var toolbarViewPresenter = new ToolbarPresenter(toolbarButtonsView, commands);

            var buttonCommandView = new ButtonView {
                Dock = DockStyle.Bottom
            };
            var buttonCommandViewPresenter = new ButtonsPresenter(buttonCommandView, buttonsCommands);

            var levelsTreeView = new LevelsView {
                Dock = DockStyle.Fill
            };
            var levelsTreeViewPresenter = new LevelsViewPresenter(levelsTreeView, msgBoxService, eventAggregator);

            var infoView = new InformationView {
                Dock = DockStyle.Fill
            };
            var inforViewPresenter = new InformationViewPresenter(infoView);

            // Wire up our views
            this.toolbarView     = toolbarButtonsView;
            this.buttonView      = buttonCommandView;
            this.levelsView      = levelsTreeView;
            this.informationView = infoView;

            // Wire up our event messaging
            this.aggregator = eventAggregator;
            this.aggregator.GetEvent <CloseShellMessage>().Subscribe(this.OnCloseShell);

            // Place the views in the correct regions
            this.InjectViews();
        }
Esempio n. 3
0
        /// <summary>Initializes a new instance of the <see cref="ShellView"/> class.</summary>
        /// <param name="msgBoxService">The msg Box Service.</param>
        /// <param name="fileBrowserService">The file Browser Service.</param>
        /// <param name="eventAggregator">The event Aggregator.</param>
        /// <param name="operationscommands"></param>
        /// <param name="levelscommands"></param>
        /// <param name="fileManagerService"></param>
        /// <param name="buttonsCommands"></param>
        /// <param name="strategyService"></param>
        public ShellView(IMessageBoxService msgBoxService, 
            IFileBrowserService fileBrowserService, 
            IEventAggregator eventAggregator,
            List<IToolbarCommand> operationscommands, 
            List<IToolbarCommand> levelscommands, 
            IFileManagerService fileManagerService, 
            List<IButtonsCommand> buttonsCommands, 
            IStrategyService strategyService)
        {
            this.InitializeComponent();

            // Wire up our view presenters
            var toolbarOperationsView = new ToolbarButtonView { Dock = DockStyle.Top };
            var toolbarViewPresenter = new ToolbarViewPresenter(toolbarOperationsView, operationscommands);

            var toolbarLevelsView = new ToolbarButtonView { Dock = DockStyle.Top };
            var toolbarLevelsViewPresenter = new ToolbarViewPresenter(toolbarLevelsView, levelscommands);


            var buttonView = new ButtonBarView { Dock = DockStyle.Fill };
            var buttonViewPresenter = new ButtonBarViewPresenter(buttonView, buttonsCommands);

            var levelView = new LevelsView { Dock = DockStyle.Fill, Margin = new Padding(5) };
            var levelViewPresenter = new LevelsViewPresenter(levelView, msgBoxService, fileBrowserService, eventAggregator, fileManagerService, strategyService);

            var opsView = new OperationsView { Dock = DockStyle.Fill, Margin = new Padding(5) };
            var opsViewPresenter = new OperationsViewPresenter(opsView, msgBoxService, fileBrowserService, eventAggregator, strategyService);

            // Wire up the views
            this.buttonBarView = buttonView;
            this.toolbarOperationsButtonView = toolbarOperationsView;
            this.toolbarLevelsButtonView = toolbarLevelsView;
            this.levelsView = levelView;
            this.operationsView = opsView;

            this.eventAggregator = eventAggregator;
            this.eventAggregator.GetEvent<CloseShellMessage>().Subscribe(this.OnCloseShell);
           
            // Place the views in the correct regions
            this.InjectViews();
        }