public TabSubscriptionContainer(TabItem item, IModuleToken token)
 {
     _item               = item;
     _token              = token;
     _token.Deactivated += DeactivationHandler;
     item.Unloaded      += DeactivationHandler;
 }
 protected AbstractReducer(IModuleToken token, Storage storage)
 {
     _id     = token.Id;
     Storage = storage;
     Storage.RegisterReducer(_id, this);
     InitializeState();
 }
        protected override void UnregisterHandlers(IModuleToken token)
        {
            var windowSubscriptionContainer = this._subscriptionContainers[token.Id];

            windowSubscriptionContainer.Disposed -= DestroyModule;
            windowSubscriptionContainer.Dispose();
            _subscriptionContainers.Remove(token.Id);
        }
Beispiel #4
0
 public PageInfo(string id, T container, Control page, IModuleToken token, SimpleModule module)
 {
     this.Id        = id;
     this.Page      = page;
     this.Token     = token;
     Module         = module;
     this.Container = container;
 }
        protected override void UnregisterHandlers(IModuleToken token)
        {
            _tabRemoved.OnNext(Pages[token.Id].Container);
            var tabSubscriptionContainer = _subscriptionContainers[token.Id];

            tabSubscriptionContainer.Disposed -= DestroyModule;
            tabSubscriptionContainer.Dispose();
            _subscriptionContainers.Remove(token.Id);
        }
        private static void SetupDestructor(IDisposable scope, IModuleToken token)
        {
            void Handler(object sender, object args)
            {
                scope.Dispose();
                token.Deactivated -= Handler;
            }

            token.Deactivated += Handler;
        }
Beispiel #7
0
        public SimpleModule Detach(IModuleToken token)
        {
            var id = token.Id;

            if (id == null)
            {
                throw new ArgumentException("id is null");
            }

            var pageInfo = this.Pages[id];

            UnregisterHandlers(token);
            this.Pages.Remove(id);
            return(pageInfo.Module);
        }
        public WindowSubscriptionContainer(
            Window window,
            IModuleToken token,
            MainReducer reducer
            )
        {
            _window  = window;
            _token   = token;
            _reducer = reducer;

            window.KeyDown    += OnWindowOnKeyDown;
            token.Deactivated += OuterDeactivationHandler;
            window.Closed     += DeactivationHandler;
            _subscription      = reducer.Select(state => state.FullscreenMode)
                                 .Subscribe(isFullscreen => {
                window.WindowStyle = isFullscreen ? WindowStyle.None : WindowStyle.SingleBorderWindow;
                window.WindowState = isFullscreen ? WindowState.Maximized : WindowState.Normal;
            });
        }
Beispiel #9
0
 public RegisterControlsAction(IModuleToken token, List <ButtonConfig> configs)
 {
     this.Token   = token;
     this.Configs = configs;
 }
 public TabPageHost(IModuleToken token, ModuleActivator activator) : base(activator)
 {
     _token = token;
 }
 public WindowPageHost(IModuleToken token, ModuleActivator activator, MainReducer reducer) : base(activator)
 {
     _token   = token;
     _reducer = reducer;
 }
 public ModuleDestroyEventArgs(Control container, IModuleToken token)
 {
     Container = container;
     Token     = token;
 }
Beispiel #13
0
 protected abstract void UnregisterHandlers(IModuleToken token);
Beispiel #14
0
 public PageInfo(PageInfo <T> info, T container, Control page, IModuleToken token, SimpleModule module) :
     this(info.Id, container, page, token, module)
 {
     info.Next     = this;
     this.Previous = info;
 }
Beispiel #15
0
 public PageControllerToken([NotNull] IModuleToken contentToken, SimpleModule content = null) : base("")
 {
     ContentToken = contentToken;
     Content      = content;
 }