Exemplo n.º 1
0
 public IEnumerable <Models.Page> ByLayout(Models.Layout layout)
 {
     return(AllPagesNested(layout.Site)
            .Select(it => it.AsActual())
            .Where(it => it.Layout.EqualsOrNullEmpty(layout.Name, StringComparison.CurrentCultureIgnoreCase))
            .ToArray());
 }
Exemplo n.º 2
0
 public static Layout ToLayoutContract(Models.Layout from)
 {
     return(new Layout
     {
         AreaList = from.List.Select(x => AreaParser.ToAreaContract(x)).ToArray(),
         Description = from.Description,
         Id = from.Id,
         VenueId = from.VenueId
     });
 }
Exemplo n.º 3
0
 public void Localize(Models.Layout o, Models.Site targetSite)
 {
     try
     {
         inner.Localize(o, targetSite);
     }
     finally
     {
         ClearObjectCache(targetSite);
     }
 }
Exemplo n.º 4
0
        // <summary>
        /// Open new window to edit selected layout
        /// </summary>
        /// <param name="obj">Layout</param>
        private async void OnEditLayout(object obj)
        {
            if (!(obj is Models.Layout layout))
            {
                return;
            }

            var vm = await _windowHelper.GetViewModel <LayoutMapViewModel>() as LayoutMapViewModel;

            vm.DisplayObject    = layout;
            _markedLayoutToEdit = layout;
            _windowHelper.ShowDialog(vm);
        }
Exemplo n.º 5
0
        public virtual void Localize(string name, Site targetSite, string userName = null)
        {
            var target = new Models.Layout(targetSite, name);
            var source = target.LastVersion();

            if (target.Site != source.Site)
            {
                Provider.Localize(source, targetSite);
                target = target.AsActual();
                if (target != null)
                {
                    target.UserName = userName;
                    Update(targetSite, target, target);
                }
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Callback method to insert a layout to list
        /// </summary>
        /// <param name="obj">Layout</param>
        private void AcceptChanges(object obj)
        {
            if (!(obj is Models.Layout layout))
            {
                return;
            }

            int index = Venue.LayoutList.Count;

            if (_markedLayoutToEdit != null)
            {
                index = Venue.LayoutList.IndexOf(_markedLayoutToEdit);
                Venue.LayoutList.Remove(_markedLayoutToEdit);
                _markedLayoutToEdit = layout;
            }

            Venue.LayoutList.Insert(index, layout);
        }
Exemplo n.º 7
0
 private void ClearMarkedLayoutToEdit(object obj = null)
 {
     _markedLayoutToEdit = null;
 }
Exemplo n.º 8
0
 public IEnumerable <Models.Page> ByLayout(Models.Layout layout)
 {
     return(inner.ByLayout(layout));
 }
Exemplo n.º 9
0
        public virtual void Localize(string name, Site targetSite)
        {
            var source = new Models.Layout(targetSite, name).LastVersion();

            Provider.Localize(source, targetSite);
        }
Exemplo n.º 10
0
        public void Localize(Models.Layout o, Models.Site targetSite)
        {
            ClearObjectCache(new Layout(targetSite, o.Name));

            inner.Localize(o, targetSite);
        }
Exemplo n.º 11
0
        //public Models.Page GetPageByUrl(Models.Site site, string url)
        //{
        //    return inner.GetPageByUrl(site, url);
        //}

        public IQueryable <Models.Page> ByLayout(Models.Layout layout)
        {
            return(inner.ByLayout(layout));
        }