/// <summary>
        /// Initializes a new instance of the <see cref="Shell"/> class. 
        /// </summary>
        /// <param name="moduleManager">
        /// The module Manager.
        /// </param>
        /// <param name="moduleTracker">
        /// The module Tracker.
        /// </param>
        /// <param name="logger">
        /// The logger.
        /// </param>
        /// <exception cref="System.ArgumentNullException">The <paramref name="logger"/> is <c>null</c>.</exception>
        /// <exception cref="System.ArgumentNullException">The <paramref name="moduleTracker"/> is <c>null</c>.</exception>
        /// <exception cref="System.ArgumentNullException">The <paramref name="moduleManager"/> is <c>null</c>.</exception>
        public Shell(IModuleManager moduleManager, IModuleTracker moduleTracker, CallbackLogger logger)
        {
            Argument.IsNotNull("moduleManager", moduleManager);
            Argument.IsNotNull("moduleTracker", moduleTracker);
            Argument.IsNotNull("logger", logger);

            this.moduleManager = moduleManager;
            this.moduleTracker = moduleTracker;
            this.logger = logger;

            InitializeComponent();
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Shell"/> class.
        /// </summary>
        /// <param name="moduleManager">
        /// The module Manager.
        /// </param>
        /// <param name="moduleTracker">
        /// The module Tracker.
        /// </param>
        /// <param name="logger">
        /// The logger.
        /// </param>
        /// <exception cref="System.ArgumentNullException">The <paramref name="logger"/> is <c>null</c>.</exception>
        /// <exception cref="System.ArgumentNullException">The <paramref name="moduleTracker"/> is <c>null</c>.</exception>
        /// <exception cref="System.ArgumentNullException">The <paramref name="moduleManager"/> is <c>null</c>.</exception>
        public Shell(IModuleManager moduleManager, IModuleTracker moduleTracker, CallbackLogger logger)
        {
            Argument.IsNotNull("moduleManager", moduleManager);
            Argument.IsNotNull("moduleTracker", moduleTracker);
            Argument.IsNotNull("logger", logger);

            this.moduleManager = moduleManager;
            this.moduleTracker = moduleTracker;
            this.logger        = logger;

            InitializeComponent();
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Shell"/> class.
        /// </summary>
        /// <param name="moduleManager">
        /// The module Manager.
        /// </param>
        /// <param name="moduleTracker">
        /// The module Tracker.
        /// </param>
        /// <param name="logger">
        /// The logger.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// The <paramref name="logger"/> is <c>null</c>.
        /// </exception>
        /// <exception cref="System.ArgumentNullException">
        /// The <paramref name="moduleTracker"/> is <c>null</c>.
        /// </exception>
        /// <exception cref="System.ArgumentNullException">
        /// The <paramref name="moduleManager"/> is <c>null</c>.
        /// </exception>
        public Shell(IModuleManager moduleManager, IModuleTracker moduleTracker, CallbackLogger logger)
        {
            Argument.IsNotNull("moduleManager", moduleManager);
            Argument.IsNotNull("moduleTracker", moduleTracker);
            Argument.IsNotNull("logger", logger);
            this.moduleManager = moduleManager;
            this.moduleTracker = moduleTracker;
            this.logger        = logger;

            // I use the IModuleTracker as the data-context for data-binding.
            // This quickstart only demonstrates modularity for Prism and does not use data-binding patterns such as MVVM.
            DataContext = this.moduleTracker;

            // I set this shell's Log method as the callback for receiving log messages.
            this.logger.Callback = Log;

            // I subscribe to events to help track module loading/loaded progress.
            // The ModuleManager uses the Async Events Pattern.
            this.moduleManager.LoadModuleCompleted           += ModuleManager_LoadModuleCompleted;
            this.moduleManager.ModuleDownloadProgressChanged += ModuleManager_ModuleDownloadProgressChanged;

            InitializeComponent();
        }