Beispiel #1
0
        public void Render(ViewContext viewContext, TextWriter writer)
        {
            var context = viewContext.HttpContext;

            try
            {
                var tile = _cache.GetView(_viewName);
                RenderTile(viewContext, context, writer, tile);
            } catch (Exception e)
            {
                HanddleErrors(context, e);
            }
        }
        private ITile GetTile(object actual)
        {
            if (_cache == null)
            {
                throw new NullReferenceException("A tile cache is required. Please state one with the From method.");
            }
            var actualStr = (string)actual;
            var breakUp   = actualStr.Split('@');
            var tile      = _cache.GetView(breakUp[0]);

            if (breakUp.Length > 1)
            {
                tile = tile.Attributes[breakUp[1]].Value;
            }
            return(tile);
        }