Format() public static method

Renders the specified key as a formatted string
public static Format ( string key ) : string
key string The key.
return string
Beispiel #1
0
        protected override void RenderContents(HtmlTextWriter output)
        {
            List <string> args = null;

            if (Arg0 != null)
            {
                args = new List <string>();
                args.Add(Arg0);
                if (Arg1 != null)
                {
                    args.Add(Arg1);
                }
                if (Arg2 != null)
                {
                    args.Add(Arg2);
                }
            }

            if (args != null && !Sitecore.Context.PageMode.IsPageEditor)
            {
                output.Write(Translator.Format(Key, args.ToArray()));
            }
            else
            {
                output.Write(Translator.Render(Key));
            }
        }
Beispiel #2
0
        protected override void RenderContents(HtmlTextWriter output)
        {
            List <string> args = null;

            if (Arg0 != null)
            {
                args = new List <string>();
                args.Add(Arg0);
                if (Arg1 != null)
                {
                    args.Add(Arg1);
                }
                if (Arg2 != null)
                {
                    args.Add(Arg2);
                }
            }

#if !FEATURE_EXPERIENCE_EDITOR
            if (args != null && !Sitecore.Context.PageMode.IsPageEditor)
#else
            if (args != null && !Sitecore.Context.PageMode.IsExperienceEditor)
#endif
            {
                output.Write(Translator.Format(Key, args.ToArray()));
            }
            else
            {
                output.Write(Translator.Render(Key));
            }
        }