private static string[] GetParameters(FieldRendererArgs args)
        {
            var list = new List <string>();

            AddRendererParameter(list, "format", args.Format);

            if (args.Width != default(int))
            {
                AddRendererParameter(list, "mw", args.Width.ToString());
            }

            if (args.Height != default(int))
            {
                AddRendererParameter(list, "mh", args.Height.ToString());
            }

            AddRendererParameter(list, "text", args.LinkText);

            if (args.HideCopyrightMessage)
            {
                AddRendererParameter(list, "hideCopyright", args.HideCopyrightMessage ? "1" : "0");
            }

            if (!string.IsNullOrEmpty(args.LineBreaks))
            {
                AddRendererParameter(list, "linebreaks", args.LineBreaks);
            }

            if (!string.IsNullOrEmpty(args.CssClass))
            {
                AddRendererParameter(list, "class", args.CssClass);
            }
            return(list.ToArray());
        }
        public string Render <TProperty>(Expression <Func <TDomainEntity, TProperty> > expression, FieldRendererArgs args)
        {
            var renderer = new FieldRenderer
            {
                Item       = GetItem(),
                FieldName  = GetFieldName(expression),
                Parameters = String.Join("&", GetParameters(args))
            };

            // maybe i'm losing it but if you want line breaks on multi-line text fields then you to add 'linebreaks'
            // to both Parameters and RenderParameters
            if (!string.IsNullOrEmpty(args.LineBreaks))
            {
                renderer.RenderParameters.Add("linebreaks", args.LineBreaks);
            }
            return(renderer.Render());
        }