Prism 5.0 source code for reading Bootstrapper and bootstrapper

Source: Internet
Author: User

Prism 5.0 source code for reading Bootstrapper and bootstrapper

The Prism framework needs to initialize the application when it starts. the Bootstrapper is used as the starting point.

Bootstrapper mainly involves creating and configuring module catalog, creating DI Container, configuring the default region adapter for UI, creating and initializing shell and initializing module.

    /// <summary>    /// Base class that provides a basic bootstrapping sequence and hooks    /// that specific implementations can override    /// </summary>    /// <remarks>    /// This class must be overridden to provide application specific configuration.    /// </remarks>    public abstract class Bootstrapper    {        /// <summary>        /// Gets the <see cref="ILoggerFacade"/> for the application.        /// </summary>        /// <value>A <see cref="ILoggerFacade"/> instance.</value>        protected ILoggerFacade Logger { get; set; }        /// <summary>        /// Gets the default <see cref="IModuleCatalog"/> for the application.        /// </summary>        /// <value>The default <see cref="IModuleCatalog"/> instance.</value>        protected IModuleCatalog ModuleCatalog { get; set; }        /// <summary>        /// Gets the shell user interface        /// </summary>        /// <value>The shell user interface.</value>        protected DependencyObject Shell { get; set; }        /// <summary>        /// Create the <see cref="ILoggerFacade" /> used by the bootstrapper.        /// </summary>        /// <remarks>        /// The base implementation returns a new TextLogger.        /// </remarks>        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "The Logger is added to the container which will dispose it when the container goes out of scope.")]        protected virtual ILoggerFacade CreateLogger()        {            return new TextLogger();        }        /// <summary>        /// Runs the bootstrapper process.        /// </summary>        public void Run()        {            this.Run(true);        }        /// <summary>        /// Creates the <see cref="IModuleCatalog"/> used by Prism.        /// </summary>        ///  <remarks>        /// The base implementation returns a new ModuleCatalog.        /// </remarks>        protected virtual IModuleCatalog CreateModuleCatalog()        {            return new ModuleCatalog();        }        /// <summary>        /// Configures the <see cref="IModuleCatalog"/> used by Prism.        /// </summary>        protected virtual void ConfigureModuleCatalog()        {        }        /// <summary>        /// Registers the <see cref="Type"/>s of the Exceptions that are not considered         /// root exceptions by the <see cref="ExceptionExtensions"/>.        /// </summary>        protected virtual void RegisterFrameworkExceptionTypes()        {            ExceptionExtensions.RegisterFrameworkExceptionType(                typeof(Microsoft.Practices.ServiceLocation.ActivationException));        }        /// <summary>        /// Initializes the modules. May be overwritten in a derived class to use a custom Modules Catalog        /// </summary>        protected virtual void InitializeModules()        {            IModuleManager manager = ServiceLocator.Current.GetInstance<IModuleManager>();            manager.Run();        }        /// <summary>        /// Configures the default region adapter mappings to use in the application, in order        /// to adapt UI controls defined in XAML to use a region and register it automatically.        /// May be overwritten in a derived class to add specific mappings required by the application.        /// </summary>        /// <returns>The <see cref="RegionAdapterMappings"/> instance containing all the mappings.</returns>        protected virtual RegionAdapterMappings ConfigureRegionAdapterMappings()        {            RegionAdapterMappings regionAdapterMappings = ServiceLocator.Current.GetInstance<RegionAdapterMappings>();            if (regionAdapterMappings != null)            {                regionAdapterMappings.RegisterMapping(typeof(Selector), ServiceLocator.Current.GetInstance<SelectorRegionAdapter>());                regionAdapterMappings.RegisterMapping(typeof(ItemsControl), ServiceLocator.Current.GetInstance<ItemsControlRegionAdapter>());                regionAdapterMappings.RegisterMapping(typeof(ContentControl), ServiceLocator.Current.GetInstance<ContentControlRegionAdapter>());            }            return regionAdapterMappings;        }        /// <summary>        /// Configures the <see cref="IRegionBehaviorFactory"/>.         /// This will be the list of default behaviors that will be added to a region.         /// </summary>        protected virtual IRegionBehaviorFactory ConfigureDefaultRegionBehaviors()        {            var defaultRegionBehaviorTypesDictionary = ServiceLocator.Current.GetInstance<IRegionBehaviorFactory>();            if (defaultRegionBehaviorTypesDictionary != null)            {                defaultRegionBehaviorTypesDictionary.AddIfMissing(BindRegionContextToDependencyObjectBehavior.BehaviorKey,                                                                  typeof(BindRegionContextToDependencyObjectBehavior));                defaultRegionBehaviorTypesDictionary.AddIfMissing(RegionActiveAwareBehavior.BehaviorKey,                                                                  typeof(RegionActiveAwareBehavior));                defaultRegionBehaviorTypesDictionary.AddIfMissing(SyncRegionContextWithHostBehavior.BehaviorKey,                                                                  typeof(SyncRegionContextWithHostBehavior));                defaultRegionBehaviorTypesDictionary.AddIfMissing(RegionManagerRegistrationBehavior.BehaviorKey,                                                                  typeof(RegionManagerRegistrationBehavior));                defaultRegionBehaviorTypesDictionary.AddIfMissing(RegionMemberLifetimeBehavior.BehaviorKey,                                                  typeof(RegionMemberLifetimeBehavior));                defaultRegionBehaviorTypesDictionary.AddIfMissing(ClearChildViewsRegionBehavior.BehaviorKey,                                                  typeof(ClearChildViewsRegionBehavior));                defaultRegionBehaviorTypesDictionary.AddIfMissing(AutoPopulateRegionBehavior.BehaviorKey,                                                  typeof(AutoPopulateRegionBehavior));            }            return defaultRegionBehaviorTypesDictionary;        }        /// <summary>        /// Initializes the shell.        /// </summary>        protected virtual void InitializeShell()        {        }        /// <summary>        /// Run the bootstrapper process.        /// </summary>        /// <param name="runWithDefaultConfiguration">If <see langword="true"/>, registers default         /// Prism Library services in the container. This is the default behavior.</param>        public abstract void Run(bool runWithDefaultConfiguration);        /// <summary>        /// Creates the shell or main window of the application.        /// </summary>        /// <returns>The shell of the application.</returns>        /// <remarks>        /// If the returned instance is a <see cref="DependencyObject"/>, the        /// <see cref="Bootstrapper"/> will attach the default <see cref="IRegionManager"/> of        /// the application in its <see cref="RegionManager.RegionManagerProperty"/> attached property        /// in order to be able to add regions by using the <see cref="RegionManager.RegionNameProperty"/>        /// attached property from XAML.        /// </remarks>        protected abstract DependencyObject CreateShell();        /// <summary>        /// Configures the LocatorProvider for the <see cref="Microsoft.Practices.ServiceLocation.ServiceLocator" />.        /// </summary>        protected abstract void ConfigureServiceLocator();    }

  


What is the use of WinBootstrapper in photoshop cs4 installation ??

This software package accelerates photoshop boot and provides physical acceleration for graphics cards.
Photoshop cs4 requires that the physical acceleration be enabled for the geforce6 series or later or radeon1950pro series.

What is winmediemeditstrapper used? What is the folder where the serial number is stored after adobe cs3 is installed?

CS3 has a green version on the Internet, which is quite useful. It is troublesome to install it with the registration version, but it is also prone to errors.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.