public NotificationMessage(StringToken stringToken, params TemplateValue[] values)
        {
            StringToken = stringToken;

            _template = new Template(stringToken, values);
            _message = new Lazy<string>(() => _template.Render());
        }
 private NotificationMessage(StringToken stringToken, Dictionary<string, string> messageSubstitutions)
 {
     _messageSubstitutions = messageSubstitutions;
     StringToken = stringToken;
     _message = new Lazy<string>(() =>
     {
         var localizedMessage = StringToken.ToString();
         return TemplateParser.Parse(localizedMessage, _messageSubstitutions);
     });
 }
        public string FindMissingText(StringToken key, CultureInfo culture)
        {
            var defaultValue = culture.Name + "_" + key.ToLocalizationKey();
            if (key.DefaultValue.IsNotEmpty() && culture.Equals(_defaultCulture))
            {
                defaultValue = key.DefaultValue;
            }

            writeMissing(key.ToLocalizationKey().ToString(), defaultValue, culture);

            return defaultValue;
        }
 public MenuChain MenuFor(StringToken key)
 {
     return _chains[key];
 }
 public static AjaxContinuation ForMessage(StringToken message)
 {
     return ForMessage(message.ToString());
 }
 public MenuItemAttribute(string title)
 {
     _title = new NavigationKey(title);
 }
 public NotificationMessage(StringToken stringToken)
     : this(stringToken, new Dictionary<string, string>())
 {
 }
 public MaxValueFieldRule(IComparable bounds, StringToken token)
 {
     _bounds = bounds;
     Token = token;
 }
Beispiel #9
0
 public bool Matches(StringToken token)
 {
     return _token.Equals(token);
 }
Beispiel #10
0
        public static AjaxContinuation ForMessage(StringToken key, object target)
        {
            var continuation = ForMessage(key);
            continuation.Target = target;

            return continuation;
        }
Beispiel #11
0
 public bool DependsOn(StringToken token)
 {
     return _matcher.Matches(token);
 }
 public GreaterOrEqualToZeroRule(StringToken token)
 {
     Token = token;
 }
 public string FindMissingText(StringToken key, CultureInfo culture)
 {
     return FindMissingText(key.Key, key.DefaultValue, culture);
 }
Beispiel #14
0
 public IEnumerable<MenuItemToken> MenuFor(StringToken key)
 {
     var chain = _navigation.MenuFor(key);
     return chain.Select(BuildToken);
 }
        public MaximumLengthRule(int length, StringToken token)
        {
            _length = length;

            Token = token;
        }
 public RangeLengthFieldRule(int min, int max, StringToken token)
 {
     _min = min;
     _max = max;
     Token = token;
 }
 public MenuItemAttribute(string key, string defaultText)
 {
     _title = new NavigationKey(key, defaultText);
 }
 public void AddChildNode(StringToken parent, MenuNode node)
 {
     var registration = new MenuRegistration(new AddChild(), new Literal(parent), node);
     _registrations.Add(registration);
 }
Beispiel #19
0
 public EmailFieldRule(StringToken token)
 {
     Token = token;
 }
Beispiel #20
0
 public Literal(StringToken token)
 {
     _token = token;
 }
 public NotificationMessage(StringToken stringToken)
 {
     StringToken = stringToken;
 }
Beispiel #22
0
 public static AjaxContinuation ForMessage(StringToken key)
 {
     return new AjaxContinuation
     {
         message = LocalizationManager.GetTextForKey(key),
         success = false
     };
 }
Beispiel #23
0
 public bool Matches(StringToken token)
 {
     return token.ToLocalizationKey().ToString() == _name || token.Key == _name;
 }
Beispiel #24
0
        public AddExpression ForMenu(StringToken key)
        {
            _lastKey = key;

            return new AddExpression(this);
        }
Beispiel #25
0
 public LocalString(StringToken token)
 {
     value   = token.Key;
     display = token.ToString();
 }
Beispiel #26
0
 public MenuNode this[StringToken parentKey]
 {
     set
     {
         var registration = new MenuRegistration(new AddBefore(), new Literal(parentKey), value);
         _registry._registrations.Add(registration);
     }
 }
        public CollectionLengthRule(int length, StringToken token)
        {
            _length = length;

            Token = token;
        }
Beispiel #28
0
 public string FormatDescription(string matcherDescription, StringToken nodeKey)
 {
     return "Insert '{0}' before '{1}'".ToFormat(nodeKey.ToLocalizationKey(), matcherDescription);
 }
 public IMenuNode FindNode(StringToken key)
 {
     return AllNodes().FirstOrDefault(x => x.Key.Equals(key));
 }
	    public RequiredFieldRule(StringToken token)
	    {
		    Token = token;
	    }
Beispiel #31
0
 public ImageTag AlternateText(StringToken token)
 {
     Attr("alt", token.ToString());
     return this;
 }