コード例 #1
0
        public static IContext AddRegion(this IContext context, IViewRegion region)
        {
            var child = context.CreateChild();

            child.AddHandlers(region);
            return(child);
        }
コード例 #2
0
ファイル: Controller.cs プロジェクト: lotsahelp/Miruken.Mvc
        protected IContext AddRegion(IViewRegion region, Action <IViewRegion> init = null)
        {
            var context = Context.AddRegion(region);

            init?.Invoke(Region(context));
            return(context);
        }
コード例 #3
0
ファイル: RegionMgr.cs プロジェクト: radtek/AppModules
        public IViewRegion GetViewRegion(string name)
        {
            IViewRegion region = null;

            if (_ViewRegions.TryGetValue(name, out region))
            {
                return(region);
            }
            else
            {
                return(null);
            }
        }
コード例 #4
0
        /// <summary>
        /// Displays a new controller in a new context as the
        /// top layer in a <see cref="IViewStackView"/>.  When
        /// the layer is destroyed, the associated controller's
        /// context is ended.
        /// </summary>
        /// <param name="region">The actual region to display in</param>
        /// <returns>The layer representing the new controller</returns>
        public override IViewLayer Display(IViewRegion region)
        {
            var stack        = P <IViewRegion>(_composer).View <IViewStackView>();
            var stackAdapter = new ViewStackAdapter(region, stack);
            // Temporarily install the stack region adapter.
            var controller = new Handler(stackAdapter).Chain(_composer).Push <C>();
            var context    = controller.Context;

            context.AddHandlers(stack);
            _action(controller);
            stackAdapter.ViewLayer.Disposed += (s, e) => context.End();
            return(Layer = stackAdapter.ViewLayer);
        }
コード例 #5
0
ファイル: RegionMgr.cs プロジェクト: radtek/AppModules
        public void RestoreLayout(List <KeyValuePair <string, byte[]> > layoutList)
        {
            _logger.Debug("RestoreLayout");
            if (layoutList == null)
            {
                return;
            }

            foreach (KeyValuePair <string, byte[]> pair in layoutList)
            {
                IViewRegion region = GetViewRegion(pair.Key);
                if (region != null)
                {
                    region.RestoreLayout(pair.Value);
                }
            }
        }
コード例 #6
0
ファイル: RegionMgr.cs プロジェクト: radtek/AppModules
        public void AddViewRegion(string name, IViewRegion region)
        {
            if (region == null)
            {
                throw new ArgumentException("Region can not be null.");
            }

            IViewRegion r = null;

            if (_ViewRegions.TryGetValue(name, out r))
            {
                throw new ArgumentException("Region with this name already exists.");
            }

            _ViewRegions.Add(name, region);
            _RegionNames.Add(name);
            _logger.Debug("Added view region with name " + name);
        }
コード例 #7
0
 public NavigateHandler(IViewRegion mainRegion)
 {
     AddHandlers(mainRegion);
 }
コード例 #8
0
 public ViewStackAdapter(IViewRegion region, IViewStackView stack)
     : base(region)
 {
     _stack = stack;
 }
コード例 #9
0
ファイル: ViewAdapter.cs プロジェクト: lotsahelp/Miruken.Mvc
 public RegionAdapter(IViewRegion inner)
 {
     Inner = inner;
 }
コード例 #10
0
ファイル: ViewAdapter.cs プロジェクト: lotsahelp/Miruken.Mvc
 public abstract IViewLayer Display(IViewRegion region);