Exemplo n.º 1
0
 public string Render(TagModel model, AttributeSet attributes)
 {
     try
     {
         using (model.Decorate().With(attributes))
         {
             return(_template.Evaluate(model));
         }
     }
     catch (TileExceptionWithContext)
     {
         throw;
     }
     catch (TileException)
     {
         throw;
     }
     catch (ExceptionWithContext EWC)
     {
         throw TileExceptionWithContext.ErrorInTile(_template.Description, EWC);
     }
     catch (Exception e)
     {
         throw TileException.ErrorInTile(_template.Description, e);
     }
 }
Exemplo n.º 2
0
        public string Evaluate(TagModel model)
        {
            var tileName = GetAutoValueAsString("Template", model);

            try
            {
                LoadTile(model, tileName);
                return(_tile.Render(model) ?? String.Empty);
            }
            catch (TileExceptionWithContext)
            {
                throw;
            }
            catch (TileException)
            {
                throw;
            }
            catch (ExceptionWithContext EWC)
            {
                throw TileExceptionWithContext.ErrorInTile(tileName, EWC);
            }
            catch (Exception e)
            {
                throw TileException.ErrorInTile(tileName, e);
            }
        }
Exemplo n.º 3
0
 public IAttributeEntry Yield(TagModel model)
 {
     try
     {
         return(new PutAttributeEntry
                (
                    GetAutoValueAsString("Name", model),
                    GetAutoValueAsString("Value", model),
                    GetAs <TileType>(TileType, model)
                ));
     }
     catch (TileException Te)
     {
         throw TileExceptionWithContext.ErrorInTile(Te, Context);
     }
 }
Exemplo n.º 4
0
 public string Evaluate(TagModel model)
 {
     try
     {
         string tileName  = GetAutoValueAsString("Name", model);
         bool   mandatory = GetAutoValueAsBool("Mandatory", model);
         using (var stack = new TagModelAttributeStack(model))
         {
             if (!mandatory && !stack.Current.HasDefinitionFor(tileName))
             {
                 return(String.Empty);
             }
             string result = stack.Current[tileName].Value.Render(model);
             return(result ?? String.Empty);
         }
     } catch (TileException Te)
     {
         throw TileExceptionWithContext.ErrorInTile(Te, Context);
     }
 }