Beispiel #1
0
        /// <summary>
        ///     Initializes new instance of the <see cref="ModuleLoader"/> class.
        /// </summary>
        /// <param name="rootContainer">Container that will be used as a root container.
        /// Module's sub-containers will be created based on this container. Must not be <c>null</c>.</param>
        /// <param name="guiThreadProvider">Used to execute OnLoad method on module's bootstraper. Must not be <c>null</c>.</param>
        /// <exception cref="ArgumentNullException">When <paramref name="rootContainer"/> or <paramref name="guiThreadProvider"/> is <c>null</c></exception>
        public ModuleLoader(IWindsorContainer rootContainer, IGuiThreadProvider guiThreadProvider)
        {
            if (rootContainer == null) throw new ArgumentNullException("rootContainer");
            if (guiThreadProvider == null) throw new ArgumentNullException("guiThreadProvider");

            _rootContainer = rootContainer;
            _guiThreadProvider = guiThreadProvider;
        }
Beispiel #2
0
 /// <summary>
 /// Creates ticket for specified action
 /// </summary>
 /// <param name="action"></param>
 /// <param name="deliveryMethod"></param>
 ///<param name="guiThreadProvider">implementation of gui thread</param>
 public EventAggregatorTicket(Action <T> action, DeliveryMethod deliveryMethod,
                              IGuiThreadProvider guiThreadProvider)
 {
     _guiThreadProvider = guiThreadProvider;
     Action             = action;
     DeliveryMethod     = deliveryMethod;
     ActionType         = typeof(T);
 }
Beispiel #3
0
        /// <summary>
        ///     Initializes new instance of the <see cref="ModuleLoader"/> class.
        /// </summary>
        /// <param name="rootContainer">Container that will be used as a root container.
        /// Module's sub-containers will be created based on this container. Must not be <c>null</c>.</param>
        /// <param name="guiThreadProvider">Used to execute OnLoad method on module's bootstraper. Must not be <c>null</c>.</param>
        /// <exception cref="ArgumentNullException">When <paramref name="rootContainer"/> or <paramref name="guiThreadProvider"/> is <c>null</c></exception>
        public ModuleLoader(IWindsorContainer rootContainer, IGuiThreadProvider guiThreadProvider)
        {
            if (rootContainer == null) throw new ArgumentNullException("rootContainer");
            if (guiThreadProvider == null) throw new ArgumentNullException("guiThreadProvider");

            _rootContainer = rootContainer;
            _guiThreadProvider = guiThreadProvider;

            _assemblies = new Dictionary<string, Assembly>();
            AppDomain.CurrentDomain.AssemblyLoad += OnAssemblyLoad;
            AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve;
        }
Beispiel #4
0
        /// <summary>
        ///     Initializes new instance of the <see cref="ModuleLoader"/> class.
        /// </summary>
        /// <param name="rootContainer">Container that will be used as a root container.
        /// Module's sub-containers will be created based on this container. Must not be <c>null</c>.</param>
        /// <param name="guiThreadProvider">Used to execute OnLoad method on module's bootstraper. Must not be <c>null</c>.</param>
        /// <exception cref="ArgumentNullException">When <paramref name="rootContainer"/> or <paramref name="guiThreadProvider"/> is <c>null</c></exception>
        public ModuleLoader(IWindsorContainer rootContainer, IGuiThreadProvider guiThreadProvider)
        {
            if (rootContainer == null)
            {
                throw new ArgumentNullException("rootContainer");
            }
            if (guiThreadProvider == null)
            {
                throw new ArgumentNullException("guiThreadProvider");
            }

            _rootContainer     = rootContainer;
            _guiThreadProvider = guiThreadProvider;

            _assemblies = new Dictionary <string, Assembly>();
            AppDomain.CurrentDomain.AssemblyLoad    += OnAssemblyLoad;
            AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve;
        }
Beispiel #5
0
 private void GuiThreadChanged(WpfGuiChangedMessage wpfGuiChangedMessage)
 {
     _guiThreadProvider = wpfGuiChangedMessage.NewGuiThreadProvider;
     Unsubscribe(_ticket);
     _ticket = Subscribe <WpfGuiChangedMessage>(GuiThreadChangedInvalid);
 }
Beispiel #6
0
 ///<summary>
 /// Initializes <see cref="EventAggregator"/> with provided <see cref="guiThreadProvider"/>.
 ///</summary>
 public EventAggregator(IGuiThreadProvider guiThreadProvider)
 {
     _guiThreadProvider = guiThreadProvider;
     _ticket            = Subscribe <WpfGuiChangedMessage>(GuiThreadChanged);
 }
Beispiel #7
0
 /// <summary>
 /// Provides <see cref="guiThreadProvider"/>
 /// </summary>
 /// <param name="guiThreadProvider">gui thread</param>
 public WpfGuiChangedMessage(IGuiThreadProvider guiThreadProvider)
 {
     NewGuiThreadProvider = guiThreadProvider;
 }
Beispiel #8
0
 /// <summary>
 /// Provides <see cref="guiThreadProvider"/>
 /// </summary>
 /// <param name="guiThreadProvider">gui thread</param>
 public WpfGuiChangedMessage(IGuiThreadProvider guiThreadProvider)
 {
     NewGuiThreadProvider = guiThreadProvider;
 }