Ejemplo n.º 1
0
        public async Task <ActionResult <BoolResult> > Width([FromBody] WidthRequest request)
        {
            if (!await _authManager.HasSitePermissionsAsync(request.SiteId,
                                                            MenuUtils.SitePermissions.ContentsSearch))
            {
                return(Unauthorized());
            }

            var site = await _siteRepository.GetAsync(request.SiteId);

            if (site == null)
            {
                return(NotFound());
            }

            var channel = await _channelRepository.GetAsync(request.SiteId);

            var name = ColumnsManager.GetColumnWidthName(request.AttributeName);

            channel.Set(name, request.Width);

            await _channelRepository.UpdateAsync(channel);

            return(new BoolResult
            {
                Value = true
            });
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <BoolResult> > Width([FromBody] WidthRequest request)
        {
            if (!await _authManager.HasSitePermissionsAsync(request.SiteId,
                                                            MenuUtils.SitePermissions.Contents))
            {
                return(Unauthorized());
            }

            var site = await _siteRepository.GetAsync(request.SiteId);

            if (site == null)
            {
                return(NotFound());
            }

            var channel = await _channelRepository.GetAsync(request.ChannelId);

            if (!string.IsNullOrEmpty(request.PrevAttributeName) && request.PrevWidth > 0)
            {
                var prevName = ColumnsManager.GetColumnWidthName(request.PrevAttributeName);
                channel.Set(prevName, request.PrevWidth);
            }
            if (!string.IsNullOrEmpty(request.NextAttributeName) && request.NextWidth > 0)
            {
                var nextName = ColumnsManager.GetColumnWidthName(request.NextAttributeName);
                channel.Set(nextName, request.NextWidth);
            }

            await _channelRepository.UpdateAsync(channel);

            return(new BoolResult
            {
                Value = true
            });
        }
Ejemplo n.º 3
0
        //public override bool TouchesEnded(IEnumerable<NGraphics.Point> points)
        //{
        //    IsChecked = !IsChecked;
        //    return true;
        //}


        protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            //base.OnPropertyChanged(propertyName);

            if (HeightRequest.ToString() != "-1" && WidthRequest.ToString() != "-1")
            {
                if (HeightRequest.ToString() != WidthRequest.ToString())
                {
                    HeightRequest = WidthRequest;
                }
            }
        }