Example #1
0
 public void Add(string key, SystemLabel label)
 {
     Messages.AddOrUpdate(key, (theKey) => {
         return(label);
     }, (theKey, value) => {
         return(label);
     });
 }
Example #2
0
        private SystemMessages CreateMSystemMessages(string lang, IMongoCollection <SystemMessages> msgCollection)
        {
            var msgs = new SystemMessages()
            {
                Language = lang
            };
            var                   culture     = new CultureInfo(lang);
            ResourceSet           resourceSet = IlevusResources.Manager.GetResourceSet(culture, true, true);
            IDictionaryEnumerator enumerator  = resourceSet.GetEnumerator();

            while (enumerator.MoveNext())
            {
                var msg = new SystemLabel()
                {
                    Content  = enumerator.Value.ToString(),
                    Reviewed = true,
                    New      = false
                };
                msgs.Add(enumerator.Key.ToString(), msg);
            }
            msgCollection.InsertOne(msgs);
            return(msgs);
        }